>
>
> HTable table = util.createTable(tableName, families);
> for (int x=0; x < 20; x++) {
>  byte[] row = Bytes.toBytes(x);
>  Put put = new Put(row);
>  String s = "test hbase lucene";
>  put.add(headersFam, to, Bytes.toBytes(s));
>  table.put(put);
> }
>
...

> Maybe I need to set the Coprocessor on the table then.
>
>
So to load the cp from a table, you could do something like:

HTableDescriptor desc = new HTableDescriptor(tableName);
for (String fam : families) {
     desc.addFamily(new HColumnDescriptor(fam));
}
desc.setValue("COPROCESSOR$1",
    String.format("/:%s:USER", LuceneCoprocessor.class.getName()));

HBaseAdmin admin = util.getHBaseAdmin();
admin.createTable(desc);
HTable table = new HTable(util.getConfiguration(), tableName);


Then carry on with the puts, etc.  And see how that works out.  That should
limit the coprocessor to only load on your table.

Let me know if you run into problems with this.

Thanks,
Gary

Reply via email to