Package org.graylog2.cluster
Class NodeServiceImpl
java.lang.Object
org.graylog2.database.PersistedServiceImpl
org.graylog2.cluster.NodeServiceImpl
- All Implemented Interfaces:
NodeService
,PersistedService
-
Field Summary
FieldsFields inherited from class org.graylog2.database.PersistedServiceImpl
mongoConnection
-
Constructor Summary
ConstructorsConstructorDescriptionNodeServiceImpl
(MongoConnection mongoConnection, int staleLeaderTimeout) NodeServiceImpl
(MongoConnection mongoConnection, Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.byNodeIds
(Collection<String> nodeIds) void
boolean
boolean
isOnlyLeader
(NodeId nodeId) void
markAsAlive
(NodeId node, boolean isLeader, URI restTransportAddress, String clusterAddress) Mark this node as alive and probably update some settings that may have changed since last server boot.boolean
registerServer
(String nodeId, boolean isLeader, URI httpPublishUri, String clusterUri, String hostname) type()
Methods inherited from class org.graylog2.database.PersistedServiceImpl
collection, collection, collectionName, count, count, cursorToList, destroy, destroy, destroyAll, destroyAll, destroyAll, embed, fieldTransformations, findOne, findOne, findOne, findOne, get, get, get, mongoCollection, query, query, query, query, query, removeEmbedded, removeEmbedded, save, saveWithoutValidation, totalCount, totalCount, validate, validate, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.graylog2.cluster.NodeService
markAsAlive, registerServer
-
Field Details
-
LAST_SEEN_FIELD
- See Also:
-
-
Constructor Details
-
NodeServiceImpl
-
NodeServiceImpl
-
-
Method Details
-
type
- Specified by:
type
in interfaceNodeService
-
registerServer
public boolean registerServer(String nodeId, boolean isLeader, URI httpPublishUri, String clusterUri, String hostname) - Specified by:
registerServer
in interfaceNodeService
-
byNodeId
- Specified by:
byNodeId
in interfaceNodeService
- Throws:
NodeNotFoundException
-
byNodeId
- Specified by:
byNodeId
in interfaceNodeService
- Throws:
NodeNotFoundException
-
byNodeIds
- Specified by:
byNodeIds
in interfaceNodeService
-
allActive
- Specified by:
allActive
in interfaceNodeService
-
allActive
Deprecated.Description copied from interface:NodeService
Please use theNodeService.allActive(Node.Type)
method and provide explicit type of the node. Otherwise, the implementation will fall back toNodeService.type()
and provide only nodes of this type.- Specified by:
allActive
in interfaceNodeService
-
dropOutdated
public void dropOutdated()- Specified by:
dropOutdated
in interfaceNodeService
-
markAsAlive
public void markAsAlive(NodeId node, boolean isLeader, URI restTransportAddress, String clusterAddress) throws NodeNotFoundException Mark this node as alive and probably update some settings that may have changed since last server boot.- Specified by:
markAsAlive
in interfaceNodeService
- Throws:
NodeNotFoundException
-
isOnlyLeader
- Specified by:
isOnlyLeader
in interfaceNodeService
-
isAnyLeaderPresent
public boolean isAnyLeaderPresent()- Specified by:
isAnyLeaderPresent
in interfaceNodeService
-