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 0703A200CD7 for ; Tue, 1 Aug 2017 22:37:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 05A44167E8D; Tue, 1 Aug 2017 20:37:08 +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 4CD9B167E8C for ; Tue, 1 Aug 2017 22:37:07 +0200 (CEST) Received: (qmail 86535 invoked by uid 500); 1 Aug 2017 20:37:06 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 86526 invoked by uid 99); 1 Aug 2017 20:37:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2017 20:37:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 613A1E117B; Tue, 1 Aug 2017 20:37:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mmiller@apache.org To: commits@accumulo.apache.org Message-Id: <83c0e853bcfe42bfa3ec4a69bc90d693@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: accumulo git commit: ACCUMULO-3238 Rename Namespaces biconsumer method Date: Tue, 1 Aug 2017 20:37:06 +0000 (UTC) archived-at: Tue, 01 Aug 2017 20:37:08 -0000 Repository: accumulo Updated Branches: refs/heads/master f2d400119 -> 542fd6e9c ACCUMULO-3238 Rename Namespaces biconsumer method Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/542fd6e9 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/542fd6e9 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/542fd6e9 Branch: refs/heads/master Commit: 542fd6e9c7e6c9cf1599d36ce8d2e8b75a4a96e9 Parents: f2d4001 Author: Mike Miller Authored: Tue Aug 1 16:26:56 2017 -0400 Committer: Mike Miller Committed: Tue Aug 1 16:26:56 2017 -0400 ---------------------------------------------------------------------- .../org/apache/accumulo/core/client/impl/Namespaces.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/542fd6e9/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java index 52cac59..17f5c18 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java @@ -107,9 +107,9 @@ public class Namespaces { } /** - * Populate map passed in as the BiConsumer. key = ID, value = namespaceName + * Gets all the namespaces from ZK. The first arg (t) the BiConsumer accepts is the ID and the second (u) is the namespaceName. */ - private static void populateMap(Instance instance, BiConsumer biConsumer) { + private static void getAllNamespaces(Instance instance, BiConsumer biConsumer) { final ZooCache zc = getZooCache(instance); List namespaceIds = zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES); for (String id : namespaceIds) { @@ -125,7 +125,7 @@ public class Namespaces { */ public static SortedMap getIdToNameMap(Instance instance) { SortedMap idMap = new TreeMap<>(); - populateMap(instance, (id, name) -> idMap.put(new Namespace.ID(id), name)); + getAllNamespaces(instance, (id, name) -> idMap.put(new Namespace.ID(id), name)); return idMap; } @@ -134,7 +134,7 @@ public class Namespaces { */ public static SortedMap getNameToIdMap(Instance instance) { SortedMap nameMap = new TreeMap<>(); - populateMap(instance, (id, name) -> nameMap.put(name, new Namespace.ID(id))); + getAllNamespaces(instance, (id, name) -> nameMap.put(name, new Namespace.ID(id))); return nameMap; } @@ -143,7 +143,7 @@ public class Namespaces { */ public static Namespace.ID getNamespaceId(Instance instance, String namespaceName) throws NamespaceNotFoundException { final ArrayList singleId = new ArrayList<>(1); - populateMap(instance, (id, name) -> { + getAllNamespaces(instance, (id, name) -> { if (name.equals(namespaceName)) singleId.add(new Namespace.ID(id)); });