@Validated public class AgentRoutingServiceSingleNodeImpl extends java.lang.Object implements AgentRoutingService
AgentRoutingService that assumes a single Genie node and tracks connections in-memory.| Constructor and Description |
|---|
AgentRoutingServiceSingleNodeImpl(com.netflix.genie.common.internal.util.GenieHostInfo genieHostInfo)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<java.lang.String> |
getHostnameForAgentConnection(@NotBlank java.lang.String jobId)
Look up the hostname of the Genie node currently handling the agent connection for a given job.
|
void |
handleClientConnected(@NotBlank java.lang.String jobId)
Handle a new agent connection.
|
void |
handleClientDisconnected(@NotBlank java.lang.String jobId)
Handle connected agent disconnection.
|
boolean |
isAgentConnected(java.lang.String jobId)
Whether the agent executing a given job is currently connected.
|
boolean |
isAgentConnectionLocal(@NotBlank java.lang.String jobId)
Tells wether the agent running a given job is connected to the local node.
|
public AgentRoutingServiceSingleNodeImpl(com.netflix.genie.common.internal.util.GenieHostInfo genieHostInfo)
genieHostInfo - local genie node host informationpublic java.util.Optional<java.lang.String> getHostnameForAgentConnection(@NotBlank
@NotBlank java.lang.String jobId)
getHostnameForAgentConnection in interface AgentRoutingServicejobId - the job idpublic boolean isAgentConnectionLocal(@NotBlank
@NotBlank java.lang.String jobId)
isAgentConnectionLocal in interface AgentRoutingServicejobId - the job idpublic void handleClientConnected(@NotBlank
@NotBlank java.lang.String jobId)
handleClientConnected in interface AgentRoutingServicejobId - the job id the connected agent is runningpublic void handleClientDisconnected(@NotBlank
@NotBlank java.lang.String jobId)
handleClientDisconnected in interface AgentRoutingServicejobId - the job id the disconnected agent is runningpublic boolean isAgentConnected(java.lang.String jobId)
isAgentConnected in interface AgentRoutingServicejobId - the job id