curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [24/35] curator git commit: Make getSchemaSet() public
Date Thu, 19 May 2016 19:02:39 GMT
Make getSchemaSet() public


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

Branch: refs/heads/CURATOR-3.0
Commit: 5730f21f999e3056e55d44b2f0b7160c5ab8690b
Parents: f039be9
Author: randgalt <randgalt@apache.org>
Authored: Tue May 3 13:47:33 2016 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Tue May 3 13:47:33 2016 -0500

----------------------------------------------------------------------
 .../java/org/apache/curator/framework/CuratorFramework.java | 8 ++++++++
 .../apache/curator/framework/imps/CuratorFrameworkImpl.java | 3 ++-
 curator-framework/src/site/confluence/schema.confluence     | 9 +++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/5730f21f/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
index c8fa4a5..9423631 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
@@ -27,6 +27,7 @@ import org.apache.curator.framework.api.transaction.CuratorTransaction;
 import org.apache.curator.framework.api.transaction.TransactionOp;
 import org.apache.curator.framework.imps.CuratorFrameworkState;
 import org.apache.curator.framework.listen.Listenable;
+import org.apache.curator.framework.schema.SchemaSet;
 import org.apache.curator.framework.state.ConnectionStateListener;
 import org.apache.curator.framework.state.ConnectionStateErrorPolicy;
 import org.apache.curator.utils.EnsurePath;
@@ -315,4 +316,11 @@ public interface CuratorFramework extends Closeable
      * @return the current config
      */
     public QuorumVerifier getCurrentConfig();
+
+    /**
+     * Return this instance's schema set
+     *
+     * @return schema set
+     */
+    SchemaSet getSchemaSet();
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/5730f21f/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
index f5ae213..51485f2 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
@@ -554,7 +554,8 @@ public class CuratorFrameworkImpl implements CuratorFramework
         return namespace.newNamespaceAwareEnsurePath(path);
     }
 
-    SchemaSet getSchemaSet()
+    @Override
+    public SchemaSet getSchemaSet()
     {
         return schemaSet;
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/5730f21f/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 dc79fb0..444f9d5 100644
--- a/curator-framework/src/site/confluence/schema.confluence
+++ b/curator-framework/src/site/confluence/schema.confluence
@@ -40,6 +40,15 @@ data is being set. It is a functor of the form:
 boolean isValid(String path, byte[] data);
 {code}
 
+h2. Getting ZNode paths/schemas by name
+
+Use SchemaSets to access ZNode paths by a simple name. E.g.
+
+{code}
+CuratorFramework client = ...
+String path = client.getSchemaSet().getNamedSchema("locks").getRawPath();
+{code}
+
 h2. Loading JSON Schema from a file/stream
 
 An optional utility is provided to load SchemaSets from a JSON file or stream: SchemaSetLoader


Mime
View raw message