accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject accumulo git commit: ACCUMULO-3238 Rename Namespaces biconsumer method
Date Tue, 01 Aug 2017 20:37:06 GMT
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 <mmiller@apache.org>
Authored: Tue Aug 1 16:26:56 2017 -0400
Committer: Mike Miller <mmiller@apache.org>
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<String,String> biConsumer)
{
+  private static void getAllNamespaces(Instance instance, BiConsumer<String,String>
biConsumer) {
     final ZooCache zc = getZooCache(instance);
     List<String> namespaceIds = zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES);
     for (String id : namespaceIds) {
@@ -125,7 +125,7 @@ public class Namespaces {
    */
   public static SortedMap<Namespace.ID,String> getIdToNameMap(Instance instance) {
     SortedMap<Namespace.ID,String> 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<String,Namespace.ID> getNameToIdMap(Instance instance) {
     SortedMap<String,Namespace.ID> 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<Namespace.ID> singleId = new ArrayList<>(1);
-    populateMap(instance, (id, name) -> {
+    getAllNamespaces(instance, (id, name) -> {
       if (name.equals(namespaceName))
         singleId.add(new Namespace.ID(id));
     });


Mime
View raw message