public class DruidLeaderClient extends Object
| Constructor and Description |
|---|
DruidLeaderClient(HttpClient httpClient,
DruidNodeDiscoveryProvider druidNodeDiscoveryProvider,
String nodeTypeToWatch,
String leaderRequestPath,
ServerDiscoverySelector serverDiscoverySelector) |
| Modifier and Type | Method and Description |
|---|---|
String |
findCurrentLeader() |
FullResponseHolder |
go(Request request) |
FullResponseHolder |
go(Request request,
HttpResponseHandler<FullResponseHolder,FullResponseHolder> responseHandler)
Executes a Request object aimed at the leader.
|
<Intermediate,Final> |
goAsync(Request request,
HttpResponseHandler<Intermediate,Final> handler)
Executes the request object aimed at the leader and process the response with given handler
Note: this method doesn't do retrying on errors or handle leader changes occurred during communication
|
Request |
makeRequest(org.jboss.netty.handler.codec.http.HttpMethod httpMethod,
String urlPath)
Make a Request object aimed at the leader.
|
Request |
makeRequest(org.jboss.netty.handler.codec.http.HttpMethod httpMethod,
String urlPath,
boolean cached)
Make a Request object aimed at the leader.
|
void |
start() |
void |
stop() |
public DruidLeaderClient(HttpClient httpClient, DruidNodeDiscoveryProvider druidNodeDiscoveryProvider, String nodeTypeToWatch, String leaderRequestPath, ServerDiscoverySelector serverDiscoverySelector)
public void start()
public void stop()
public Request makeRequest(org.jboss.netty.handler.codec.http.HttpMethod httpMethod, String urlPath, boolean cached) throws IOException
cached - Uses cached leader if true, else uses the current leaderIOExceptionpublic Request makeRequest(org.jboss.netty.handler.codec.http.HttpMethod httpMethod, String urlPath) throws IOException
IOExceptionpublic FullResponseHolder go(Request request) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic <Intermediate,Final> com.google.common.util.concurrent.ListenableFuture<Final> goAsync(Request request, HttpResponseHandler<Intermediate,Final> handler)
public FullResponseHolder go(Request request, HttpResponseHandler<FullResponseHolder,FullResponseHolder> responseHandler) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic String findCurrentLeader()
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.