public interface ClusterCoordinator
Responsible for coordinating nodes in the cluster
| Modifier and Type | Method and Description |
|---|---|
void |
addRole(String clusterRole)
Notifies the cluster coordinator that this node has been granted the given role
|
void |
disconnectionRequestedByNode(NodeIdentifier nodeId,
DisconnectionCode disconnectionCode,
String explanation)
Notifies the Cluster Coordinator that the node with the given ID has requested to disconnect
from the cluster.
|
void |
finishNodeConnection(NodeIdentifier nodeId)
Indicates that the node has sent a valid heartbeat and should now
be considered part of the cluster
|
Map<NodeConnectionState,List<NodeIdentifier>> |
getConnectionStates()
Returns a Map of NodeConnectionStatus to all Node Identifiers that have that status.
|
NodeConnectionStatus |
getConnectionStatus(NodeIdentifier nodeId)
Returns the current status of the node with the given identifier
|
NodeIdentifier |
getElectedActiveCoordinatorNode() |
NodeIdentifier |
getLocalNodeIdentifier() |
List<NodeEvent> |
getNodeEvents(NodeIdentifier nodeId)
Returns all of the events that have occurred for the given node
|
NodeIdentifier |
getNodeIdentifier(String uuid)
Returns the NodeIdentifier that exists that has the given UUID, or
null if no NodeIdentifier
exists for the given UUID |
Set<NodeIdentifier> |
getNodeIdentifiers(NodeConnectionState... states)
Returns the identifiers of all nodes that have the given connection state
|
NodeIdentifier |
getPrimaryNode() |
boolean |
isActiveClusterCoordinator() |
boolean |
isBlockedByFirewall(String hostname)
Checks if the given hostname is blocked by the configured firewall, returning
true if the node is blocked, false if the node is
allowed through the firewall or if there is no firewall configured |
boolean |
isConnected()
Indicates whether or not the node is currently connected to the cluster
|
void |
removeNode(NodeIdentifier nodeId,
String userDn)
Removes the given disconnected node from the cluster
|
void |
removeRole(String clusterRole)
Notifies the cluster coordinator that this node is no longer responsible for the given role
|
void |
reportEvent(NodeIdentifier nodeId,
Severity severity,
String event)
Reports that some event occurred that is relevant to the cluster
|
void |
requestNodeConnect(NodeIdentifier nodeId,
String userDn)
Sends a request to the node to connect to the cluster.
|
void |
requestNodeDisconnect(NodeIdentifier nodeId,
DisconnectionCode disconnectionCode,
String explanation)
Sends a request to the node to disconnect from the cluster.
|
void |
resetNodeStatuses(Map<NodeIdentifier,NodeConnectionStatus> statusMap)
Clears the current state of all nodes and replaces them with the values provided in the given map
|
void |
setConnected(boolean connected)
Notifies the Cluster Coordinator whether or not the node is connected to the cluster
|
void |
setFlowService(FlowService flowService)
Updates the Flow Service to use for obtaining the current flow
|
void |
setLocalNodeIdentifier(NodeIdentifier nodeId)
Notifies the Cluster Coordinator of the Node Identifier that the coordinator is currently running on
|
void |
shutdown()
Notifies the Cluster Coordinator that the NiFi instance is being shutdown so that
the coordinator is able to perform cleanup of resources
|
void |
updateNodeRoles(NodeIdentifier nodeId,
Set<String> roles)
Updates the roles held by the given node
|
void requestNodeConnect(NodeIdentifier nodeId, String userDn)
nodeId - the identifier of the nodeuserDn - the DN of the user that requested that the node connect, or null if the action is not user-drivenvoid shutdown()
void finishNodeConnection(NodeIdentifier nodeId)
nodeId - the identifier of the nodevoid requestNodeDisconnect(NodeIdentifier nodeId, DisconnectionCode disconnectionCode, String explanation)
nodeId - the identifier of the nodedisconnectionCode - the code that represents why this node is being asked to disconnectexplanation - an explanation as to why the node is being asked to disconnect
from the clustervoid disconnectionRequestedByNode(NodeIdentifier nodeId, DisconnectionCode disconnectionCode, String explanation)
nodeId - the identifier of the nodedisconnectionCode - the code that represents why this node is requesting to disconnectexplanation - an explanation as to why the node is requesting to disconnect from the clustervoid removeNode(NodeIdentifier nodeId, String userDn)
nodeId - the node to removeuserDn - the DN of the user requesting that the node be removedNodeConnectionStatus getConnectionStatus(NodeIdentifier nodeId)
nodeId - the identifier of the nodenull if no node is known with the given identifierSet<NodeIdentifier> getNodeIdentifiers(NodeConnectionState... states)
states - the states of interestMap<NodeConnectionState,List<NodeIdentifier>> getConnectionStates()
boolean isBlockedByFirewall(String hostname)
true if the node is blocked, false if the node is
allowed through the firewall or if there is no firewall configuredhostname - the hostname of the node that is attempting to connect to the clustertrue if the node is blocked, false if the node is
allowed through the firewall or if there is no firewall configuredvoid reportEvent(NodeIdentifier nodeId, Severity severity, String event)
nodeId - the identifier of the node that the event pertains to, or null if not applicableseverity - the severity of the eventevent - an explanation of the eventvoid updateNodeRoles(NodeIdentifier nodeId, Set<String> roles)
nodeId - the id of the node to updateroles - the new roles that the node possessesNodeIdentifier getNodeIdentifier(String uuid)
null if no NodeIdentifier
exists for the given UUIDuuid - the UUID of the NodeIdentifier to obtainnull if no NodeIdentifier
exists for the given UUIDList<NodeEvent> getNodeEvents(NodeIdentifier nodeId)
nodeId - the identifier of the nodeNodeIdentifier getPrimaryNode()
null if either there is no
primary or the primary is not known by this node.NodeIdentifier getElectedActiveCoordinatorNode()
null if
there is no active cluster coordinator elected.NodeIdentifier getLocalNodeIdentifier()
null if the Node Identifier has not yet been established.boolean isActiveClusterCoordinator()
true if this node has been elected the active cluster coordinator, false otherwise.void setFlowService(FlowService flowService)
flowService - the flow service to use for obtaining the current flowvoid resetNodeStatuses(Map<NodeIdentifier,NodeConnectionStatus> statusMap)
statusMap - the new states of all nodes in the clustervoid setLocalNodeIdentifier(NodeIdentifier nodeId)
nodeId - the ID of the current nodevoid setConnected(boolean connected)
connected - true if the node is connected to a cluster, false otherwise.boolean isConnected()
true if connected, false otherwisevoid addRole(String clusterRole)
clusterRole - the role that this node has been grantedvoid removeRole(String clusterRole)
clusterRole - the role that this node is no longer responsible forCopyright © 2016 Apache NiFi Project. All rights reserved.