*1.Coprocessor on all tables:* When coprocessor on all tables, config hbase-site.xml:
> <property> > <name>hbase.coprocessor.region.classes</name> > <value>cp classPath....</value> > </property> and config the hbase-env.sh > # Extra Java CLASSPATH elements. Optional. > export > HBASE_CLASSPATH=$HBASE_HOME/libextra/xxx.jar:$HBASE_HOME/libextra/xxxb.jar then the coprocessor class are added to the classpath of HBase, It will autoload it. *This type of coprocessor could not load dynamic* *2.Coprocessor on single table:* When attach to a single table, just the the table's coprocessor attr...put the jar in the HDFS on somewhere where attr point to: > alter 'TableName', METHOD => 'table-att', 'COPROCESSOR' => ' > hdfs://localhost:8020/users/**leon/test.jar|coprocessor.**Test||[some > attrs you can use inside the coprocessor]' like this, *the coprocessor will dynamic loaded, you can replace this jar without restart hbase*. Or you can leave the jar path blank: > alter 'TableName', METHOD => 'table-att', 'COPROCESSOR' => ' |coprocessor. > **Test||[some attrs you can use inside the coprocessor]' and config the hbase-env.sh > # Extra Java CLASSPATH elements. Optional. > export > HBASE_CLASSPATH=$HBASE_HOME/libextra/xxx.jar:$HBASE_HOME/libextra/xxxb.jar So the coprocessor class in the jar are loaded to hbase's classpath when start. *This config of single-talbe coprocessor cannot load dynamic, too.* Wish it helps. Yours, NN 2012/6/7 Andrew Purtell <[email protected]> > When using the table attribute method you must specify a fully qualified > Hadoop path URI to a jar, and it must be accessible to all regionservers > i.e. on HDFS. (When opening a region of this table the regionserver will > use the Hadoop Filesystem abstraction to copy the jar to a local temporary > directory and then load the specified coprocessor class from it.) > > Since you put it on the classpath of the regionservers instead, you can > update the hbase-site.xml file to load it as a system coprocessor according > to the instructions in the HBase online manual. > > - Andy > > On Thursday, June 7, 2012, Amit Sela wrote: > > > Hi all, > > > > I can't seem to understand if there is a way to dynamically load > > coprocessors ? > > > > The best way I found so far is using the shell: > > > > *alter 'URLS', METHOD => 'table_att', > > > > > 'coprocessor'=>'|com.infolinks.hbase.coprocessors.HBaseTestRegionObserver||' > > * > > > > I leave the path empty because I put the jar in my file path and I don't > > use priority or arguments. > > > > After re-enabling I don't see the coprocessor in the webapp. I also tried > > re-starting hbase which didn't help as well... > > > > Is there a need to add to the configuration as well ? if so, does it mean > > that re-starting HBase is mandatory when adding/removing coprocessors ? > > > > Is there a dynamic load method ? without disable/enable to the table ? > > > > Thanks. > > > > > -- > Best regards, > > - Andy > > Problems worthy of attack prove their worth by hitting back. - Piet Hein > (via Tom White) >
