hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars George (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-13417) batchCoprocessorService() does not handle NULL keys
Date Tue, 07 Apr 2015 07:28:12 GMT
Lars George created HBASE-13417:

             Summary: batchCoprocessorService() does not handle NULL keys
                 Key: HBASE-13417
                 URL: https://issues.apache.org/jira/browse/HBASE-13417
             Project: HBase
          Issue Type: Bug
          Components: Coprocessors
    Affects Versions: 1.0.0
            Reporter: Lars George
            Priority: Minor
             Fix For: 2.0.0, 1.0.1, 1.1.0

The JavaDoc for {{batchCoprocessorService()}} reads:

* @param startKey
*          start region selection with region containing this row. If {@code null}, the
*          selection will start with the first table region.
* @param endKey
*          select regions up to and including the region containing this row. If {@code null},
*          selection will continue through the last table region.

Setting the call to {{null}} keys like so

      Map<byte[], CountResponse> results = table.batchCoprocessorService(
        request, null, null, CountResponse.getDefaultInstance());

yields an exception:

	at org.apache.hadoop.hbase.util.Bytes.compareTo(Bytes.java:1187)
	at org.apache.hadoop.hbase.client.HTable.getKeysAndRegionsInRange(HTable.java:744)
	at org.apache.hadoop.hbase.client.HTable.getKeysAndRegionsInRange(HTable.java:723)
	at org.apache.hadoop.hbase.client.HTable.batchCoprocessorService(HTable.java:1801)
	at org.apache.hadoop.hbase.client.HTable.batchCoprocessorService(HTable.java:1778)
	at coprocessor.EndpointBatchExample.main(EndpointBatchExample.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

This is caused by the call shipping off the keys to {{getStartKeysInRange()}} as-is and that
method uses {{Bytes.compareTo()}} on the {{null}} keys and fails. 

One can work around using {{HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW}} instead,
but that is not documented, nor standard behavior. Need to handle {{null}} keys as advertised.

This message was sent by Atlassian JIRA

View raw message