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 3DF611833F for ; Tue, 11 Aug 2015 14:47:08 +0000 (UTC) Received: (qmail 13802 invoked by uid 500); 11 Aug 2015 14:46:46 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 13333 invoked by uid 500); 11 Aug 2015 14:46:46 -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 13134 invoked by uid 99); 11 Aug 2015 14:46:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Aug 2015 14:46:46 +0000 Date: Tue, 11 Aug 2015 14:46:46 +0000 (UTC) From: "Heng Chen (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-14203) remove duplicate code getTableDescriptor in HTable 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-14203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14681891#comment-14681891 ] Heng Chen commented on HBASE-14203: ----------------------------------- {quote} Creating an Admin is a costly operation. Maybe we can extract the method to be a static one. {quote} Thanks for your reply! I check the code, it has some difficulty to extract {{getTableDescriptor}} to be a static one. Because in this function it calls non-static function. To avoid create {{Admin}} every time when call {{Connection.getAdmin()}}, we can use Singleton instance. I update the patch. > remove duplicate code getTableDescriptor in HTable > -------------------------------------------------- > > Key: HBASE-14203 > URL: https://issues.apache.org/jira/browse/HBASE-14203 > Project: HBase > Issue Type: Improvement > Reporter: Heng Chen > Priority: Trivial > Attachments: HBASE-14203.patch, HBASE-14203_v2.patch > > > As TODO in comment said, > {{HTable.getTableDescriptor}} is same as {{HAdmin.getTableDescriptor}}. remove the duplicate code. -- This message was sent by Atlassian JIRA (v6.3.4#6332)