Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB08C11E67 for ; Sat, 7 Jun 2014 20:25:07 +0000 (UTC) Received: (qmail 24294 invoked by uid 500); 7 Jun 2014 20:25:02 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 24137 invoked by uid 500); 7 Jun 2014 20:25:02 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 24001 invoked by uid 99); 7 Jun 2014 20:25:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2014 20:25:01 +0000 Date: Sat, 7 Jun 2014 20:25:01 +0000 (UTC) From: "Ted Yu (JIRA)" To: dev@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HBASE-11308) Reuse NameStringPair#Builder instances in loops MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Ted Yu created HBASE-11308: ------------------------------ Summary: Reuse NameStringPair#Builder instances in loops Key: HBASE-11308 URL: https://issues.apache.org/jira/browse/HBASE-11308 Project: HBase Issue Type: Task Reporter: Ted Yu Priority: Minor The following code is from HColumnDescriptor#convert() but the pattern can be found in other classes, such as HBaseAdmin: {code} for (Map.Entry e : this.configuration.entrySet()) { NameStringPair.Builder aBuilder = NameStringPair.newBuilder(); aBuilder.setName(e.getKey()); aBuilder.setValue(e.getValue()); builder.addConfiguration(aBuilder.build()); } {code} NameStringPair.Builder instance can be reused across iterations of the loop. This would save creation of short-lived objects. -- This message was sent by Atlassian JIRA (v6.2#6252)