public class ClusterManagerImpl extends Object implements ClusterManager
| Modifier and Type | Field and Description |
|---|---|
private com.spotify.docker.client.DockerClient |
dockerClient
Docker client instance
|
private Integer |
expectedNumberOfNodes |
private static org.slf4j.Logger |
LOGGER |
private String |
SWARM_NODE_NUMBER |
| Constructor and Description |
|---|
ClusterManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
com.spotify.docker.client.messages.Info |
getClusterInfo()
Get cluster info
|
Integer |
getExpectedNumberOfNodes()
Get expected number of nodes in the cluster
Set externally by SWARM_NODE_NUMBER env variable
|
Integer |
getNumberOfNodes()
Get number of nodes in the cluster
|
Integer |
getTaskHistoryLimit()
Get task history limit for the swarm cluster
|
boolean |
isClusterHealthy()
Get the health status of the cluster
|
void |
setTaskHistoryLimit(Integer taskHistoryLimit)
Set task history limit for the swarm cluster
For production history limit should be set to 0
Then the cluster will not keep containers after the services are removed
|
private static final org.slf4j.Logger LOGGER
private com.spotify.docker.client.DockerClient dockerClient
private Integer expectedNumberOfNodes
private String SWARM_NODE_NUMBER
public ClusterManagerImpl()
throws com.spotify.docker.client.exceptions.DockerCertificateException
com.spotify.docker.client.exceptions.DockerCertificateExceptionpublic com.spotify.docker.client.messages.Info getClusterInfo()
throws com.spotify.docker.client.exceptions.DockerException,
InterruptedException
ClusterManagergetClusterInfo in interface ClusterManagercom.spotify.docker.client.exceptions.DockerExceptionInterruptedExceptionpublic Integer getNumberOfNodes() throws com.spotify.docker.client.exceptions.DockerException, InterruptedException
ClusterManagergetNumberOfNodes in interface ClusterManagercom.spotify.docker.client.exceptions.DockerExceptionInterruptedExceptionpublic boolean isClusterHealthy()
throws com.spotify.docker.client.exceptions.DockerException,
InterruptedException
ClusterManagerisClusterHealthy in interface ClusterManagercom.spotify.docker.client.exceptions.DockerExceptionInterruptedExceptionpublic Integer getExpectedNumberOfNodes()
ClusterManagergetExpectedNumberOfNodes in interface ClusterManagerpublic void setTaskHistoryLimit(Integer taskHistoryLimit) throws com.spotify.docker.client.exceptions.DockerException, InterruptedException
ClusterManagersetTaskHistoryLimit in interface ClusterManagercom.spotify.docker.client.exceptions.DockerExceptionInterruptedExceptionpublic Integer getTaskHistoryLimit() throws com.spotify.docker.client.exceptions.DockerException, InterruptedException
ClusterManagergetTaskHistoryLimit in interface ClusterManagercom.spotify.docker.client.exceptions.DockerExceptionInterruptedExceptionCopyright © 2017–2018. All rights reserved.