Package org.graylog2.cluster
Class NodeServiceImpl
java.lang.Object
org.graylog2.database.PersistedServiceImpl
org.graylog2.cluster.NodeServiceImpl
- All Implemented Interfaces:
NodeService
,PersistedService
-
Field Summary
Fields inherited from class org.graylog2.database.PersistedServiceImpl
mongoConnection
-
Constructor Summary
ConstructorDescriptionNodeServiceImpl
(MongoConnection mongoConnection, int staleLeaderTimeout) NodeServiceImpl
(MongoConnection mongoConnection, Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.void
boolean
boolean
isOnlyLeader
(NodeId nodeId) void
markAsAlive
(NodeId node, boolean isLeader, URI restTransportAddress) 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 hostname) type()
Methods inherited from class org.graylog2.database.PersistedServiceImpl
collection, collection, count, count, cursorToList, destroy, destroy, destroyAll, destroyAll, destroyAll, embed, fieldTransformations, findOne, findOne, findOne, findOne, get, get, get, 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.plugin.database.PersistedService
destroy, destroyAll, save, saveWithoutValidation, validate, validate, validate
-
Field Details
-
LAST_SEEN_FIELD
- See Also:
-
-
Constructor Details
-
NodeServiceImpl
-
NodeServiceImpl
-
-
Method Details
-
type
- Specified by:
type
in interfaceNodeService
-
registerServer
- Specified by:
registerServer
in interfaceNodeService
-
byNodeId
- Specified by:
byNodeId
in interfaceNodeService
- Throws:
NodeNotFoundException
-
byNodeId
- Specified by:
byNodeId
in interfaceNodeService
- Throws:
NodeNotFoundException
-
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) 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
-