Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@locus.apache.org Received: (qmail 31295 invoked from network); 14 May 2008 17:27:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 May 2008 17:27:23 -0000 Received: (qmail 1489 invoked by uid 500); 14 May 2008 17:27:23 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 1473 invoked by uid 500); 14 May 2008 17:27:23 -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 1236 invoked by uid 99); 14 May 2008 17:27:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2008 10:27:22 -0700 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; Wed, 14 May 2008 17:26:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C3DBA234C119 for ; Wed, 14 May 2008 10:26:56 -0700 (PDT) Message-ID: <1728362393.1210786016801.JavaMail.jira@brutus> Date: Wed, 14 May 2008 10:26:56 -0700 (PDT) From: "Jean-Daniel Cryans (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Commented: (HBASE-626) Use Visitor pattern in MetaRegion to reduce code clones in HTable and HConnectionManager In-Reply-To: <1612727624.1210709155629.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HBASE-626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596838#action_12596838 ] Jean-Daniel Cryans commented on HBASE-626: ------------------------------------------ Well in fact I checked this and this is already uses a form of visitor. The listener (usually called observer) reacts to events, which is not the case in this piece of code. But this is the good place I think to do the modification. What I plan is : - Refactor the scanMetaRegion method so it uses RowResult. - Modify the listener (renamed visitor) so it accepts a RowResult and a HRegionInfo. - Add a method to scan all the meta regions which will take a visitor in argument and optionally a row start key. - Modify all impacted code. Question : In the TODO it says that it has to "Allow multiple Visitors". Since the ScannerListener already has to be implemented, I don't see the purpose of that comment. Am I missing something bigger? > Use Visitor pattern in MetaRegion to reduce code clones in HTable and HConnectionManager > ---------------------------------------------------------------------------------------- > > Key: HBASE-626 > URL: https://issues.apache.org/jira/browse/HBASE-626 > Project: Hadoop HBase > Issue Type: Improvement > Components: master > Reporter: Jean-Daniel Cryans > Priority: Minor > Fix For: 0.2.0 > > > HTable and HConnectionManager.TableServers both scan the meta region in the same way (but the later also retry one time if it fails). A Visitor pattern should be used in a new scanning method in MetaRegion to accept visitors that gather information such as region names for a table or the list of all tables. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.