public class HttpServiceSchedulerClient extends java.lang.Object implements ISchedulerClient
Constructor and Description |
---|
HttpServiceSchedulerClient(Config config,
Config runtime,
java.lang.String schedulerHttpEndpoint) |
Modifier and Type | Method and Description |
---|---|
protected java.net.HttpURLConnection |
createHttpConnection(Command command)
Create a http connection, if the scheduler end point is present
|
protected java.lang.String |
getCommandEndpoint(java.lang.String schedulerEndpoint,
Command command)
Construct the endpoint to send http request for a particular command
Make sure the construction matches server sides.
|
boolean |
killTopology(Scheduler.KillTopologyRequest killTopologyRequest)
Kill a topology on given KillTopologyRequest
|
protected boolean |
requestSchedulerService(Command command,
byte[] data)
Send payload to target HTTP connection to request a service
|
boolean |
restartTopology(Scheduler.RestartTopologyRequest restartTopologyRequest)
Restart a topology on given RestartTopologyRequest
|
public boolean restartTopology(Scheduler.RestartTopologyRequest restartTopologyRequest)
ISchedulerClient
restartTopology
in interface ISchedulerClient
restartTopologyRequest
- info for restart commandpublic boolean killTopology(Scheduler.KillTopologyRequest killTopologyRequest)
ISchedulerClient
killTopology
in interface ISchedulerClient
killTopologyRequest
- info for kill commandprotected boolean requestSchedulerService(Command command, byte[] data)
data
- the byte[] to sendprotected java.net.HttpURLConnection createHttpConnection(Command command)
protected java.lang.String getCommandEndpoint(java.lang.String schedulerEndpoint, Command command)
schedulerEndpoint
- The scheduler http endpointcommand
- The command to request