Closed graphex closed 10 years ago
Because of this issue and the comments there
I'd rather have us compiling on bigtop ci than have this class. Will remove it and turn it into an example in a day or so unless we come up w/ a resolution.
I committed the patch to 0.95, the one that removes all to do w/ AggregationClient.
I had the impression that AggregationClient was permanently removed from HBase code base. And it really looks like that CDH5 (which is based on HBase 0.96.1) does not include it. However, I realized the class reappeared in the recent versions.
jruby-1.7.12 :002 > HBase.resolve_dependency! '0.98'
jruby-1.7.12 :003 > org.apache.hadoop.hbase.client.coprocessor.AggregationClient
=> Java::OrgApacheHadoopHbaseClientCoprocessor::AggregationClient
I haven't had time to test AggregationClient on 0.98 or above.
I think after 0.95 the method takes a string instead of an HTable instance. Using the 0.98 dependency I get:
jruby-1.7.12 :002 > table.project("n:mynum").aggregate(:sum)
NameError: no method 'sum' for arguments (org.jruby.java.proxies.ArrayJavaProxy,org.apache.hadoop.hbase.client.coprocessor.LongColumnInterpreter,org.apache.hadoop.hbase.client.Scan) on Java::OrgApacheHadoopHbaseClientCoprocessor::AggregationClient
available overloads:
(org.apache.hadoop.hbase.TableName,org.apache.hadoop.hbase.coprocessor.ColumnInterpreter,org.apache.hadoop.hbase.client.Scan)
(org.apache.hadoop.hbase.client.HTable,org.apache.hadoop.hbase.coprocessor.ColumnInterpreter,org.apache.hadoop.hbase.client.Scan)
Maybe related to the switch to protobuf coprocessors? https://issues.apache.org/jira/browse/HBASE-6785
Hmm, obviously the method signature has changed.
public <R, S> S sum(final byte[] tableName, final ColumnInterpreter<R, S> ci, final Scan scan) throws Throwable
public <R, S, P extends Message, Q extends Message, T extends Message> S sum(final HTable table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable
The first argument used to be a byte array denoting the name of the table, but now the method expects HTable instance instead. The tricky thing is that hbase-jruby should support both versions of the API. I'll see what I can do.
Just released 0.5.1 with the above commit. Let me know if you run into any problem. Thanks.
I can't seem to do any aggregation operations against hbase 0.95 or above. resolve_dependency! gives this output (similar for
0.96
0.95
as well):Attempting to call aggregation methods results in this error:
It looks like the protocol for communicating with coprocessors changed at 0.95, but I haven't yet found any documentation on how it was restructured.