curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragonsi...@apache.org
Subject [4/6] git commit: Address feedback
Date Mon, 06 Oct 2014 23:52:27 GMT
Address feedback


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

Branch: refs/heads/master
Commit: c7a1ea0e00a6580fe7c0e0ce4869930b32770ae7
Parents: 180a159
Author: Scott Blum <scottb@squareup.com>
Authored: Fri Aug 29 13:55:36 2014 -0400
Committer: Scott Blum <scottb@squareup.com>
Committed: Fri Aug 29 13:55:36 2014 -0400

----------------------------------------------------------------------
 .../curator/utils/CloseableExecutorService.java       |  2 +-
 .../curator/framework/recipes/cache/TreeCache.java    | 14 +++-----------
 2 files changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/c7a1ea0e/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java
b/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java
index 721754d..6a84bc4 100644
--- a/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java
+++ b/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java
@@ -116,7 +116,7 @@ public class CloseableExecutorService implements Closeable
      */
     public CloseableExecutorService(ExecutorService executorService, boolean shutdownOnClose)
     {
-        this.executorService = Preconditions.checkNotNull(executorService);
+        this.executorService = Preconditions.checkNotNull(executorService, "executorService
cannot be null");
         this.shutdownOnClose = shutdownOnClose;
     }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/c7a1ea0e/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
index 3a7a1de..03ed982 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
@@ -97,16 +97,6 @@ public class TreeCache implements Closeable
         }
 
         /**
-         * Builds the {@link TreeCache} based on configured values, and starts it.
-         */
-        public TreeCache buildAndStart() throws Exception
-        {
-            TreeCache treeCache = build();
-            treeCache.start();
-            return treeCache;
-        }
-
-        /**
          * Sets whether or not to cache byte data per node; default {@code true}.
          */
         public Builder setCacheData(boolean cacheData)
@@ -507,9 +497,10 @@ public class TreeCache implements Closeable
     /**
      * Start the cache. The cache is not started automatically. You must call this method.
      *
+     * @return this
      * @throws Exception errors
      */
-    public void start() throws Exception
+    public TreeCache start() throws Exception
     {
         Preconditions.checkState(treeState.compareAndSet(TreeState.LATENT, TreeState.STARTED),
"already started");
         client.getConnectionStateListenable().addListener(connectionStateListener);
@@ -517,6 +508,7 @@ public class TreeCache implements Closeable
         {
             root.wasCreated();
         }
+        return this;
     }
 
     /**


Mime
View raw message