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 DAD671827A for ; Fri, 12 Feb 2016 18:34:23 +0000 (UTC) Received: (qmail 12271 invoked by uid 500); 12 Feb 2016 18:34:18 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 12185 invoked by uid 500); 12 Feb 2016 18:34:18 -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 12034 invoked by uid 99); 12 Feb 2016 18:34:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2016 18:34:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 20BE52C1F5D for ; Fri, 12 Feb 2016 18:34:18 +0000 (UTC) Date: Fri, 12 Feb 2016 18:34:18 +0000 (UTC) From: "Ankit Singhal (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-15260) Should we check zero length value in checkAndMutate when null is passes as expected value? 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-15260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15145019#comment-15145019 ] Ankit Singhal commented on HBASE-15260: --------------------------------------- [~anoopsamjohn], but there is also a zero length check on column value in checkAndMutate() when null is passed as expected value. So checkAndPut will still succeed even when column is present but value of column is empty byte array. WDYT about this case? > Should we check zero length value in checkAndMutate when null is passes as expected value? > ------------------------------------------------------------------------------------------ > > Key: HBASE-15260 > URL: https://issues.apache.org/jira/browse/HBASE-15260 > Project: HBase > Issue Type: Bug > Reporter: Ankit Singhal > > Should we check zero length value in checkAndMutate when null is passes as expected value? > If yes, then I think we should update the documentation for checkAndPut with the same as sometimes column are used for marker with empty byte array. > {code} > If the passed value is null, the check > * is for the lack of column (ie: non-existance) > boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, > byte[] value, Put put) throws IOException; > {code} > otherwise , we should remove this check. > {code} > HRegion.class > @Override > public boolean checkAndMutate(byte [] row, byte [] family, byte [] qualifier, > CompareOp compareOp, ByteArrayComparable comparator, Mutation w, > boolean writeToWAL) > throws IOException{ > ... > else if (result.size() > 0 && result.get(0).getValueLength() == 0 && > valueIsNull) { > matches = true; > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)