hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anil gupta <anilgupt...@gmail.com>
Subject Re: Unable to add co-processor to table through HBase api
Date Wed, 17 Oct 2012 18:04:06 GMT
Hi Ram,

The table exists and I don't get any error while running the program(i
would get an error if the table did not exist). I am running a distributed
cluster.

Tried following additional ways also:

   1. I tried loading the AggregationImplementation coproc.
   2. I also tried adding the coprocs while the table is enabled.


Also had a look at the JUnit test cases and could not find any difference.

I am going to try adding the coproc along with jar in Hdfs and see what
happens.

Thanks,
Anil Gupta

On Tue, Oct 16, 2012 at 11:44 PM, Ramkrishna.S.Vasudevan <
ramkrishna.vasudevan@huawei.com> wrote:

> I tried out a sample test class.  It is working properly.  I just have a
> doubt whether you are doing the
> Htd.addCoprocessor() step before creating the table?  Try that way hope it
> should work.
>
> Regards
> Ram
>
> > -----Original Message-----
> > From: anil gupta [mailto:anilgupta84@gmail.com]
> > Sent: Wednesday, October 17, 2012 4:05 AM
> > To: user@hbase.apache.org
> > Subject: Unable to add co-processor to table through HBase api
> >
> > Hi All,
> >
> > I would like to add a RegionObserver to a HBase table through HBase
> > api. I
> > don't want to put this RegionObserver as a user or system co-processor
> > in
> > hbase-site.xml since this is specific to a table. So, option of using
> > hbase
> > properties is out. I have already copied the jar file in the classpath
> > of
> > region server and restarted the cluster.
> >
> > Can any one point out the problem in following code for adding the
> > co-processor to the table:
> >     private void modifyTable(String name) throws IOException
> >     {
> >     Configuration conf = HBaseConfiguration.create();
> >     HBaseAdmin hAdmin = new HBaseAdmin(conf);
> >     hAdmin.disableTable("txn_subset");
> >     if(!hAdmin.isTableEnabled("txn_subset"))
> >     {
> >       System.err.println("Trying to add coproc to table"); // using err
> > so
> > that it's easy to read this on eclipse console.
> >
> > hAdmin.getTableDescriptor(Bytes.toBytes("txn_subset")).addCoprocessor("
> > com.intuit.hbase.poc.coprocessor.observer.IhubTxnRegionObserver");
> >       if(
> > hAdmin.getTableDescriptor(Bytes.toBytes("txn_subset")).hasCoprocessor("
> > com.intuit.hbase.poc.coprocessor.observer.IhubTxnRegionObserver")
> > )
> >       {
> >         System.err.println("YIPPPPPPPPPIEEEEE!!!!!!!");
> >       }
> >       hAdmin.enableTable("ihub_txn_subset");
> >     }
> >     hAdmin.close();
> >         }*
> > *
> > --
> > Thanks & Regards,
> > Anil Gupta
>
>


-- 
Thanks & Regards,
Anil Gupta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message