Package com.clickhouse.client
Interface ClickHouseNodeManager
- All Superinterfaces:
Function<ClickHouseNodeSelector,,ClickHouseNode> Serializable
- All Known Implementing Classes:
ClickHouseCluster,ClickHouseNodes
@Deprecated
public interface ClickHouseNodeManager
extends Function<ClickHouseNodeSelector,ClickHouseNode>, Serializable
Deprecated.
Node manager is responsible for managing list of nodes and their status. It
also runs scheduled tasks in background for node discovery and health check.
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets a copy of faulty nodes.getFaultyNodes(ClickHouseNodeSelector selector, int groupSize) Deprecated.Gets a copy of filtered faulty nodes.getNodes()Deprecated.Gets a copy of nodes, which in most cases are in healthy status.getNodes(ClickHouseNodeSelector selector, int groupSize) Deprecated.Gets a copy of filtered nodes.Deprecated.Gets node selector for filtering out nodes.Deprecated.Gets load balancing policy.Deprecated.Schedule node discovery task immediately.Deprecated.Schedule node discovery task immediately.voidshutdown()Deprecated.Shuts down scheduled tasks if any.suggestNode(ClickHouseNode server, Throwable failure) Deprecated.Suggests a different node in order to recover from a failure, which is usually a connection error.voidupdate(ClickHouseNode node, ClickHouseNode.Status status) Deprecated.Updates node status to one ofClickHouseNode.Status.
-
Method Details
-
getNodes
List<ClickHouseNode> getNodes()Deprecated.Gets a copy of nodes, which in most cases are in healthy status. However, this really depends on howClickHouseLoadBalancingPolicymanages node status. In first-alive policy, it's acutally a full list regardless node status.- Returns:
- non-null nodes
-
getNodes
Deprecated.Gets a copy of filtered nodes.- Parameters:
selector- node selector for filtering out nodes, null means no filtergroupSize- maximum number of nodes to get, zero or negative value means all- Returns:
- non-null nodes
-
getFaultyNodes
List<ClickHouseNode> getFaultyNodes()Deprecated.Gets a copy of faulty nodes.- Returns:
- non-null faulty nodes
-
getFaultyNodes
Deprecated.Gets a copy of filtered faulty nodes.- Parameters:
selector- node selector for filtering out nodes, null means no filtergroupSize- maximum number of nodes to get, zero or negative value means all- Returns:
- non-null faulty nodes
-
getPolicy
ClickHouseLoadBalancingPolicy getPolicy()Deprecated.Gets load balancing policy.- Returns:
- non-null load balancing policy
-
getNodeSelector
ClickHouseNodeSelector getNodeSelector()Deprecated.Gets node selector for filtering out nodes.- Returns:
- non-null node selector
-
scheduleDiscovery
Optional<ScheduledFuture<?>> scheduleDiscovery()Deprecated.Schedule node discovery task immediately. Nothing will happen when task scheduler does not exist(e.g.getPolicy().getScheduler()returns null) or there's a task running for node discovery.- Returns:
- optional future for retrieving the running task
-
scheduleHealthCheck
Optional<ScheduledFuture<?>> scheduleHealthCheck()Deprecated.Schedule node discovery task immediately. Nothing will happen when task scheduler does not exist(e.g.getPolicy().getScheduler()returns null) or there's a task running for health check.- Returns:
- optional future for retrieving the running task
-
suggestNode
Deprecated.Suggests a different node in order to recover from a failure, which is usually a connection error.- Parameters:
server- node related to the failure(e.g. the node couldn't be connected)failure- recoverable failure- Returns:
- non-null node which may or may not be same as the given one
-
update
Deprecated.Updates node status to one ofClickHouseNode.Status. It simply delegates the call togetPolicy().update(node, status)in a thread-safe manner.- Parameters:
node- non-null node to updatestatus- non-null status of the node
-
shutdown
void shutdown()Deprecated.Shuts down scheduled tasks if any.
-