Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6FBD617573 for ; Tue, 14 Apr 2015 11:28:13 +0000 (UTC) Received: (qmail 58751 invoked by uid 500); 14 Apr 2015 11:28:13 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 58698 invoked by uid 500); 14 Apr 2015 11:28:13 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 58686 invoked by uid 99); 14 Apr 2015 11:28:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2015 11:28:13 +0000 Date: Tue, 14 Apr 2015 11:28:13 +0000 (UTC) From: "Abhishek Singh Chouhan (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-13417) batchCoprocessorService() does not handle NULL keys MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-13417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Abhishek Singh Chouhan updated HBASE-13417: ------------------------------------------- Status: Patch Available (was: Open) > 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 > Labels: noob > Fix For: 2.0.0, 1.1.0, 1.0.2 > > Attachments: HBASE-13417.patch > > > The JavaDoc for {{batchCoprocessorService()}} reads: > {noformat} > * @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. > {noformat} > Setting the call to {{null}} keys like so > {code} > Map results = table.batchCoprocessorService( > RowCountService.getDescriptor().findMethodByName("getRowCount"), > request, null, null, CountResponse.getDefaultInstance()); > {code} > yields an exception: > {noformat} > java.lang.NullPointerException > 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) > {noformat} > 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 (v6.3.4#6332)