public class ExhibitorEnsembleProvider extends Object implements EnsembleProvider
| Constructor and Description |
|---|
ExhibitorEnsembleProvider(Exhibitors exhibitors,
ExhibitorRestClient restClient,
String restUriPath,
int pollingMs,
RetryPolicy retryPolicy) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Curator will call this method when
CuratorZookeeperClient.close() is called |
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 |
setExhibitors(Exhibitors newExhibitors)
Change the set of exhibitors to poll
|
void |
start()
Curator will call this method when
CuratorZookeeperClient.start() is
called |
public ExhibitorEnsembleProvider(Exhibitors exhibitors, ExhibitorRestClient restClient, 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 Exception
Exception - errorspublic void start()
throws Exception
EnsembleProviderCuratorZookeeperClient.start() is
calledstart in interface EnsembleProviderException - errorspublic void close()
throws IOException
EnsembleProviderCuratorZookeeperClient.close() is calledclose in interface Closeableclose in interface AutoCloseableclose in interface EnsembleProviderIOException - errorspublic String getConnectionString()
EnsembleProvidergetConnectionString in interface EnsembleProviderZooKeeper.ZooKeeper(String, int, Watcher) etc.)protected void poll()
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.