Merge branch 'master' into CURATOR-3.0
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0e23fbac Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0e23fbac Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0e23fbac Branch: refs/heads/CURATOR-3.0 Commit: 0e23fbac1be51df269f1b396af03980f8a614cab Parents: 7d44bae 337b9d9 Author: randgalt <randg...@apache.org> Authored: Sat Mar 11 15:51:56 2017 -0800 Committer: randgalt <randg...@apache.org> Committed: Sat Mar 11 15:51:56 2017 -0800 ---------------------------------------------------------------------- .../org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/0e23fbac/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java ---------------------------------------------------------------------- diff --cc curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java index 5f486f4,ce650a9..0762607 --- a/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java +++ b/curator-client/src/main/java/org/apache/curator/ensemble/fixed/FixedEnsembleProvider.java @@@ -19,10 -19,9 +19,11 @@@ package org.apache.curator.ensemble.fixed; import com.google.common.base.Preconditions; + import com.google.common.base.Strings; import org.apache.curator.ensemble.EnsembleProvider; +import org.apache.zookeeper.ZooKeeper; import java.io.IOException; +import java.util.concurrent.atomic.AtomicReference; /** * Standard ensemble provider that wraps a fixed connection string @@@ -39,19 -37,9 +40,20 @@@ public class FixedEnsembleProvider impl */ public FixedEnsembleProvider(String connectionString) { - Preconditions.checkArgument(!Strings.isNullOrEmpty(connectionString), - "connectionString cannot be null or empty"); - this.connectionString = connectionString; + this(connectionString, true); + } + + /** + * The connection string to use + * + * @param connectionString connection string + * @param updateServerListEnabled if true, allow Curator to call {@link ZooKeeper#updateServerList(String)} + */ + public FixedEnsembleProvider(String connectionString, boolean updateServerListEnabled) + { + this.updateServerListEnabled = updateServerListEnabled; - this.connectionString.set(Preconditions.checkNotNull(connectionString, "connectionString cannot be null")); ++ Preconditions.checkArgument(!Strings.isNullOrEmpty(connectionString), "connectionString cannot be null or empty"); ++ this.connectionString.set(connectionString); } @Override