curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [26/35] curator git commit: Added getNamedPath() utility
Date Thu, 19 May 2016 19:02:41 GMT
Added getNamedPath() utility


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/fd0f3b0c
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/fd0f3b0c
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/fd0f3b0c

Branch: refs/heads/CURATOR-3.0
Commit: fd0f3b0c886a73667d2e4115e6ed83e684fbfef3
Parents: 032af45
Author: randgalt <randgalt@apache.org>
Authored: Tue May 3 14:11:43 2016 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Tue May 3 14:11:43 2016 -0500

----------------------------------------------------------------------
 .../org/apache/curator/framework/schema/SchemaSet.java | 13 +++++++++++++
 .../src/site/confluence/schema.confluence              |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/fd0f3b0c/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
b/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
index fe27cbd..76dd36b 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
@@ -26,6 +26,7 @@ import com.google.common.cache.LoadingCache;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Maps;
+import org.apache.curator.framework.CuratorFramework;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.util.Collections;
@@ -163,6 +164,18 @@ public class SchemaSet
     }
 
     /**
+     * Utility to return a ZNode path for the given name
+     *
+     * @param client Curator client
+     * @param name path/schema name
+     * @return ZNode path
+     */
+    public static String getNamedPath(CuratorFramework client, String name)
+    {
+        return client.getSchemaSet().getNamedSchema(name).getRawPath();
+    }
+
+    /**
      * Return the schema with the given key/name
      *
      * @param name name

http://git-wip-us.apache.org/repos/asf/curator/blob/fd0f3b0c/curator-framework/src/site/confluence/schema.confluence
----------------------------------------------------------------------
diff --git a/curator-framework/src/site/confluence/schema.confluence b/curator-framework/src/site/confluence/schema.confluence
index 444f9d5..7478763 100644
--- a/curator-framework/src/site/confluence/schema.confluence
+++ b/curator-framework/src/site/confluence/schema.confluence
@@ -46,7 +46,7 @@ Use SchemaSets to access ZNode paths by a simple name. E.g.
 
 {code}
 CuratorFramework client = ...
-String path = client.getSchemaSet().getNamedSchema("locks").getRawPath();
+String path = SchemaSet.getNamedPath(client, "locks");
 {code}
 
 h2. Loading JSON Schema from a file/stream


Mime
View raw message