Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@minotaur.apache.org Received: (qmail 51610 invoked from network); 18 Aug 2009 02:39:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Aug 2009 02:39:18 -0000 Received: (qmail 65522 invoked by uid 500); 18 Aug 2009 02:39:36 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 65457 invoked by uid 500); 18 Aug 2009 02:39:36 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 65447 invoked by uid 99); 18 Aug 2009 02:39:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2009 02:39:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2009 02:39:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C5242234C044 for ; Mon, 17 Aug 2009 19:39:14 -0700 (PDT) Message-ID: <631996365.1250563154793.JavaMail.jira@brutus> Date: Mon, 17 Aug 2009 19:39:14 -0700 (PDT) From: "Jim Kellerman (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Created: (HBASE-1774) HTable$ClientScanner modifies its input parameters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org HTable$ClientScanner modifies its input parameters -------------------------------------------------- Key: HBASE-1774 URL: https://issues.apache.org/jira/browse/HBASE-1774 Project: Hadoop HBase Issue Type: Bug Components: client Affects Versions: 0.20.0 Reporter: Jim Kellerman Assignee: Jim Kellerman Priority: Critical HTable$ClientScanner modifies the Scan that is passed to it on construction. I would consider this to be bad programming practice because if I wanted to use the same Scan object to scan multiple tables, I would not expect one table scan to effect the other, but it does. If input parameters are going to be modified either now or later it should be called out *loudly* in the javadoc. The only way I found this behavior was by creating an application that did scan multiple tables using the same Scan object and having 'wierd stuff' happen. In my opinion, if you want to modify a field in an input parameter, you should: - make a copy of the original object - optionally return a reference to the copy. There is no javadoc about this behavior. The only thing I found was a comment in HTable$ClientScanner: {code} // HEADSUP: The scan internal start row can change as we move through table. {code} Is there a use case that requires this behavior? If so, I would recommend that ResultScanner (and the classes that implement it) provide an accessor to the mutable copy of the input Scan and leave the input argument alone. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.