public class NodeEngineImpl extends Object implements NodeEngine
But the crucial thing is that we don't want to leak concrete dependencies to the outside. For example
we don't leak OperationServiceImpl to the outside.
| Modifier and Type | Class and Description |
|---|---|
static interface |
NodeEngineImpl.JetPacketConsumer |
| Constructor and Description |
|---|
NodeEngineImpl(Node node) |
| Modifier and Type | Method and Description |
|---|---|
ClusterService |
getClusterService()
Gets the ClusterService.
|
Config |
getConfig()
Returns the Config that was used to create the HazelcastInstance.
|
ClassLoader |
getConfigClassLoader()
Returns the Config ClassLoader.
|
ClusterWideConfigurationService |
getConfigurationService() |
Diagnostics |
getDiagnostics() |
InternalEventService |
getEventService()
Gets the EventService.
|
InternalExecutionService |
getExecutionService()
Gets the ExecutionService.
|
HazelcastInstance |
getHazelcastInstance()
Returns the HazelcastInstance that this
NodeEngine belongs to. |
MemberImpl |
getLocalMember()
Returns the local member.
|
ILogger |
getLogger(Class clazz)
Gets the logger for a given class.
|
ILogger |
getLogger(String name)
Gets the logger for a given name.
|
LoggingService |
getLoggingService() |
ManagementCenterService |
getManagementCenterService() |
Address |
getMasterAddress()
Gets the address of the master member.
|
MetricsRegistry |
getMetricsRegistry() |
Node |
getNode() |
OperationParker |
getOperationParker() |
InternalOperationService |
getOperationService()
Gets the OperationService.
|
Consumer<Packet> |
getPacketDispatcher() |
InternalPartitionService |
getPartitionService()
Gets the IPartitionService.
|
Operation[] |
getPostJoinOperations()
Collects all post-join operations from
PostJoinAwareServices. |
Operation[] |
getPreJoinOperations() |
HazelcastProperties |
getProperties()
Returns the HazelcastProperties.
|
InternalProxyService |
getProxyService()
Gets the ProxyService.
|
QuorumServiceImpl |
getQuorumService()
Gets the QuorumService.
|
SerializationService |
getSerializationService()
Gets the SerializationService.
|
<T> T |
getService(String serviceName)
Gets the service with the given name.
|
Collection<ServiceInfo> |
getServiceInfos(Class serviceClass) |
ServiceManager |
getServiceManager() |
<S> Collection<S> |
getServices(Class<S> serviceClass)
Returns a list of services matching provides service class/interface.
|
<T extends SharedService> |
getSharedService(String serviceName)
Gets the
SharedService for the given serviceName. |
SplitBrainMergePolicyProvider |
getSplitBrainMergePolicyProvider()
Returns the
SplitBrainMergePolicyProvider for this instance. |
Address |
getThisAddress()
Get the address of this member.
|
TransactionManagerService |
getTransactionManagerService()
Gets the TransactionManagerService.
|
MemberVersion |
getVersion()
Returns the codebase version of the node.
|
WanReplicationService |
getWanReplicationService()
Gets the WanReplicationService.
|
boolean |
isActive()
Checks if the HazelcastInstance that this
NodeEngine belongs to is still active. |
boolean |
isRunning()
Indicates that node is not shutting down or it has not already shut down
|
void |
onClientDisconnected(String clientUuid) |
void |
onMemberLeft(MemberImpl member) |
void |
onPartitionMigrate(MigrationInfo migrationInfo) |
void |
reset() |
void |
shutdown(boolean terminate) |
void |
start() |
Data |
toData(Object object)
Serializes an object to a
Data. |
<T> T |
toObject(Object object)
Deserializes an object.
|
<T> T |
toObject(Object object,
Class klazz)
Deserializes an object.
|
public NodeEngineImpl(Node node)
public LoggingService getLoggingService()
public MetricsRegistry getMetricsRegistry()
public void start()
public Diagnostics getDiagnostics()
public ClusterWideConfigurationService getConfigurationService()
public ServiceManager getServiceManager()
public Address getThisAddress()
NodeEngine
The returned value will never change and will never be null.
getThisAddress in interface NodeEnginepublic Address getMasterAddress()
NodeEngineThis value can be null if no master is elected yet.
The value can change over time.
getMasterAddress in interface NodeEnginepublic MemberImpl getLocalMember()
NodeEngineThe returned value will never be null but it may change when local lite member is promoted to a data member or when this member merges to a new cluster after split-brain detected. Returned value should not be cached but instead this method should be called each time when local member is needed.
getLocalMember in interface NodeEnginepublic Config getConfig()
NodeEngine
The returned value will never change and will never be null.
getConfig in interface NodeEnginepublic ClassLoader getConfigClassLoader()
NodeEngineTODO: add more documentation what the purpose is of the config classloader
getConfigClassLoader in interface NodeEnginepublic InternalEventService getEventService()
NodeEnginegetEventService in interface NodeEnginepublic SerializationService getSerializationService()
NodeEnginegetSerializationService in interface NodeEnginepublic InternalOperationService getOperationService()
NodeEnginegetOperationService in interface NodeEnginepublic InternalExecutionService getExecutionService()
NodeEnginegetExecutionService in interface NodeEnginepublic InternalPartitionService getPartitionService()
NodeEnginegetPartitionService in interface NodeEnginepublic ClusterService getClusterService()
NodeEnginegetClusterService in interface NodeEnginepublic ManagementCenterService getManagementCenterService()
public InternalProxyService getProxyService()
NodeEnginegetProxyService in interface NodeEnginepublic OperationParker getOperationParker()
public WanReplicationService getWanReplicationService()
NodeEnginegetWanReplicationService in interface NodeEnginepublic QuorumServiceImpl getQuorumService()
NodeEnginegetQuorumService in interface NodeEnginepublic TransactionManagerService getTransactionManagerService()
NodeEnginegetTransactionManagerService in interface NodeEnginepublic Data toData(Object object)
NodeEngineData.
This method can safely be called with a Data instance. In that case, that instance is returned.
If this method is called with null, null is returned.
toData in interface NodeEngineobject - the object to serializepublic <T> T toObject(Object object)
NodeEngineThis method can safely be called on an object that is already deserialized. In that case, that instance is returned.
If this method is called with null, null is returned.
toObject in interface NodeEngineobject - the object to deserializepublic <T> T toObject(Object object, Class klazz)
NodeEngineThis method can safely be called on an object that is already deserialized. In that case, that instance is returned.
If this method is called with null, null is returned.
toObject in interface NodeEngineobject - the object to deserializeklazz - The class to instantiate when deserializing the objectpublic boolean isActive()
NodeEngineNodeEngine belongs to is still active.
A HazelcastInstance is not active when it is shutting down or already shut down.
Also see NodeEngine.isRunning().
isActive in interface NodeEnginetrue if active, false otherwisepublic boolean isRunning()
NodeEngineisRunning in interface NodeEnginetrue if node is not shutting down or it has not already shut down, false otherwisepublic HazelcastInstance getHazelcastInstance()
NodeEngineNodeEngine belongs to.getHazelcastInstance in interface NodeEnginepublic ILogger getLogger(String name)
NodeEngine
It is best to get an ILogger through this method instead of calling Logger.getLogger(String).
getLogger in interface NodeEnginename - the name of the loggerNodeEngine.getLogger(String)public ILogger getLogger(Class clazz)
NodeEngine
It is best to get an ILogger through this method instead of calling Logger.getLogger(Class).
getLogger in interface NodeEngineclazz - the class of the loggerNodeEngine.getLogger(Class)public HazelcastProperties getProperties()
NodeEngine
The returned value will never change and will never be null.
getProperties in interface NodeEnginepublic <T> T getService(String serviceName)
NodeEnginegetService in interface NodeEngineT - the type of the serviceserviceName - the name of the servicenull will never be returned)public <T extends SharedService> T getSharedService(String serviceName)
NodeEngineSharedService for the given serviceName.getSharedService in interface NodeEngineT - the type of the serviceserviceName - the name of the shared service to getpublic MemberVersion getVersion()
NodeEngineVersion.of(3,8,0). A node's codebase version may be different than cluster version.getVersion in interface NodeEngineCluster.getClusterVersion()public SplitBrainMergePolicyProvider getSplitBrainMergePolicyProvider()
NodeEngineSplitBrainMergePolicyProvider for this instance.getSplitBrainMergePolicyProvider in interface NodeEngineSplitBrainMergePolicyProviderpublic <S> Collection<S> getServices(Class<S> serviceClass)
NodeEngineNote: CoreServices will be placed at the beginning of the list.
getServices in interface NodeEnginepublic Collection<ServiceInfo> getServiceInfos(Class serviceClass)
public Node getNode()
public void onMemberLeft(MemberImpl member)
public void onClientDisconnected(String clientUuid)
public void onPartitionMigrate(MigrationInfo migrationInfo)
public Operation[] getPostJoinOperations()
PostJoinAwareServices.
Post join operations should return response, at least a null response.
Note: Post join operations must be lock free, meaning no locks at all:
no partition locks, no key-based locks, no service level locks, no database interaction!
The Operation.getPartitionId() method should return a negative value.
This means that the operations should not implement PartitionAwareOperation.
public Operation[] getPreJoinOperations()
public void reset()
public void shutdown(boolean terminate)
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.