Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4F69B200CC9 for ; Mon, 17 Jul 2017 20:09:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4DC43164A94; Mon, 17 Jul 2017 18:09:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 94289164A91 for ; Mon, 17 Jul 2017 20:09:03 +0200 (CEST) Received: (qmail 29429 invoked by uid 500); 17 Jul 2017 18:09:02 -0000 Mailing-List: contact dev-help@gora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gora.apache.org Delivered-To: mailing list dev@gora.apache.org Received: (qmail 29418 invoked by uid 99); 17 Jul 2017 18:09:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2017 18:09:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 41CF9C0C14 for ; Mon, 17 Jul 2017 18:09:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id dsVKllQ6U-0w for ; Mon, 17 Jul 2017 18:09:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 135595F613 for ; Mon, 17 Jul 2017 18:09:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4E51FE0051 for ; Mon, 17 Jul 2017 18:09:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 09EBC24744 for ; Mon, 17 Jul 2017 18:09:00 +0000 (UTC) Date: Mon, 17 Jul 2017 18:09:00 +0000 (UTC) From: "Alfonso Nishikawa (JIRA)" To: dev@gora.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (GORA-514) Scan of a single key with a limit clears the persistent instance when iterating results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 17 Jul 2017 18:09:04 -0000 [ https://issues.apache.org/jira/browse/GORA-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alfonso Nishikawa updated GORA-514: ----------------------------------- Attachment: GORA-514-Example-Test.diff > Scan of a single key with a limit clears the persistent instance when iterating results > --------------------------------------------------------------------------------------- > > Key: GORA-514 > URL: https://issues.apache.org/jira/browse/GORA-514 > Project: Apache Gora > Issue Type: Bug > Components: gora-accumulo, gora-cassandra, gora-core, gora-hbase, gora-jcache, gora-mongodb, gora-solr > Affects Versions: 0.7, 0.8 > Reporter: Alfonso Nishikawa > Priority: Minor > Attachments: GORA-514-Example-Test.diff > > > To put in context, I am just doing a scan where the start key, end key and limit are configurable: > {code:java} > Query dataQuery = dataStore.newQuery() ; > if (startKey != null && !startKey.equals("")) { > dataQuery.setStartKey(startKey); > } > if (endKey != null && !endKey.equals("")) { > dataQuery.setEndKey(endKey); > } > dataQuery.setLimit(limit); > Result result = dataQuery.execute(); > > while (result.next()) { > results.put(result.getKey(), result.get()) ; > } > {code} > When the start key is equal to end key, and the limit is configured to a value >= (the default value is -1), the second call to result.next() in the while bucle clears the instance previously returned by result.get(). > We could think that this would be an expected behaviour since result.get() -especifically for HBase- is a reusable instance when performing a Get operation, but this clashes with the actual expected general behaviour in the usual Scan operation shown in the former code example. > This is: next() and get() when performing a scan should behave the same no matter what initial/end keys you configure, and what maximum number of results you want. > I implemented a test than shows the issue affecting Accumulo, Cassandra, HBase, JCache, MongoDB and Solr, probably because it is some issue in the core. > To see the error, you can apply the attached patch with the tests example and execute: > {code:sh} > mvn -Dtest=#testScanSingleResultWithLimit -fn -DfailIfNoTests=false test > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)