public class Node extends Object implements Cloneable, Comparable<Node>
Modifier and Type | Class and Description |
---|---|
static class |
Node.Status
The semantics of a Node status are as follows:
CONNECTED -- a flow controller that is connected to the cluster.
|
Modifier and Type | Field and Description |
---|---|
private AtomicLong |
connectionRequestedTimestamp
the last time the connection for this node was requested
|
private boolean |
heartbeatDisconnection
a flag to indicate this node was disconnected because of a lack of heartbeat
|
private Heartbeat |
lastHeartbeat
the last heartbeat received by from the node
|
private HeartbeatPayload |
lastHeartbeatPayload
the payload of the last heartbeat received from the node
|
private static org.slf4j.Logger |
lockLogger |
private NodeIdentifier |
nodeId
the node's unique identifier
|
private Node.Status |
status
the node statue
|
Constructor and Description |
---|
Node(NodeIdentifier id,
Node.Status status) |
Modifier and Type | Method and Description |
---|---|
Node |
clone() |
int |
compareTo(Node o) |
boolean |
equals(Object obj) |
long |
getConnectionRequestedTimestamp()
Returns the time of the last received connection request for this node.
|
Heartbeat |
getHeartbeat()
Returns the last received heartbeat or null if no heartbeat has been set.
|
HeartbeatPayload |
getHeartbeatPayload() |
NodeIdentifier |
getNodeId() |
Node.Status |
getStatus() |
int |
hashCode() |
boolean |
isHeartbeatDisconnection()
Returns true if the node was disconnected due to lack of heartbeat; false otherwise.
|
void |
setConnectionRequestedTimestamp(long connectionRequestedTimestamp)
Sets the time when the connection request for this node was last received.
|
void |
setHeartbeat(Heartbeat heartbeat)
Sets the last heartbeat received.
|
void |
setHeartbeatDisconnection()
Sets the status to disconnected and flags the node as being disconnected by lack of heartbeat.
|
void |
setStatus(Node.Status status) |
String |
toString() |
private static final org.slf4j.Logger lockLogger
private final NodeIdentifier nodeId
private Node.Status status
private Heartbeat lastHeartbeat
private HeartbeatPayload lastHeartbeatPayload
private AtomicLong connectionRequestedTimestamp
private boolean heartbeatDisconnection
public Node(NodeIdentifier id, Node.Status status)
public NodeIdentifier getNodeId()
public Heartbeat getHeartbeat()
public HeartbeatPayload getHeartbeatPayload()
public void setHeartbeat(Heartbeat heartbeat) throws ProtocolException
heartbeat
- a heartbeatProtocolException
- if the heartbeat's payload failed unmarshallingpublic long getConnectionRequestedTimestamp()
public void setConnectionRequestedTimestamp(long connectionRequestedTimestamp)
connectionRequestedTimestamp
- timestamppublic boolean isHeartbeatDisconnection()
public void setHeartbeatDisconnection()
public Node.Status getStatus()
public void setStatus(Node.Status status)
status
- a statuspublic int compareTo(Node o)
compareTo
in interface Comparable<Node>
Copyright © 2015 Apache NiFi Project. All rights reserved.