java.io.Closeable, java.lang.AutoCloseable, EnsembleProviderpublic class ExhibitorEnsembleProvider extends java.lang.Object implements EnsembleProvider
| Constructor | Description |
|---|---|
ExhibitorEnsembleProvider(Exhibitors exhibitors,
ExhibitorRestClient restClient,
java.lang.String restUriPath,
int pollingMs,
RetryPolicy retryPolicy) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Curator will call this method when
CuratorZookeeperClient.close() is called |
java.lang.String |
getConnectionString() |
Return the current connection string to use.
|
protected void |
poll() |
|
void |
pollForInitialEnsemble() |
Can be called prior to starting the Curator instance to set the current connection string
|
void |
setConnectionString(java.lang.String connectionString) |
A new connection string event was received
|
void |
setExhibitors(Exhibitors newExhibitors) |
Change the set of exhibitors to poll
|
void |
start() |
Curator will call this method when
CuratorZookeeperClient.start() is
called |
boolean |
updateServerListEnabled() |
Return true if this ensemble provider supports
ZooKeeper.updateServerList(String) |
public ExhibitorEnsembleProvider(Exhibitors exhibitors, ExhibitorRestClient restClient, java.lang.String restUriPath, int pollingMs, RetryPolicy retryPolicy)
exhibitors - the current set of exhibitor instances (can be changed later via setExhibitors(Exhibitors))restClient - the rest client to use (use DefaultExhibitorRestClient for most cases)restUriPath - the path of the REST call used to get the server set. Usually: /exhibitor/v1/cluster/listpollingMs - how ofter to poll the exhibitors for the listretryPolicy - retry policy to use when connecting to the exhibitorspublic void setExhibitors(Exhibitors newExhibitors)
newExhibitors - new setpublic void pollForInitialEnsemble()
throws java.lang.Exception
java.lang.Exception - errorspublic void start()
throws java.lang.Exception
EnsembleProviderCuratorZookeeperClient.start() is
calledstart in interface EnsembleProviderjava.lang.Exception - errorspublic void close()
throws java.io.IOException
EnsembleProviderCuratorZookeeperClient.close() is calledclose in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in interface EnsembleProviderjava.io.IOException - errorspublic java.lang.String getConnectionString()
EnsembleProvidergetConnectionString in interface EnsembleProviderZooKeeper(String, int, Watcher) etc.)public void setConnectionString(java.lang.String connectionString)
EnsembleProvidersetConnectionString in interface EnsembleProviderconnectionString - the new connection stringpublic boolean updateServerListEnabled()
EnsembleProviderZooKeeper.updateServerList(String)updateServerListEnabled in interface EnsembleProviderprotected void poll()
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.