@PrivateApi public class DefaultNodeExtension extends Object implements NodeExtension
Modifier and Type | Field and Description |
---|---|
protected List<ClusterVersionListener> |
clusterVersionListeners |
protected ILogger |
logger |
protected Node |
node |
protected PhoneHome |
phoneHome |
protected ILogger |
systemLogger |
Constructor and Description |
---|
DefaultNodeExtension(Node node) |
Modifier and Type | Method and Description |
---|---|
void |
afterClusterStateChange(ClusterState oldState,
ClusterState newState,
boolean isTransient)
Called after the cluster state change transaction has completed
(successfully or otherwise).
|
void |
afterStart()
Called after node is started
|
void |
beforeClusterStateChange(ClusterState currState,
ClusterState requestedState,
boolean isTransient)
Called before starting a cluster state change transaction.
|
void |
beforeJoin()
Called before node attempts to join to the cluster
|
void |
beforeShutdown()
Called before Node.shutdown()
|
void |
beforeStart()
Called before node is started
|
protected void |
createAndSetPhoneHome() |
ChannelInitializerProvider |
createChannelInitializerProvider(IOService ioService)
Creates the ChannelInitializerProvider.
|
DynamicConfigListener |
createDynamicConfigListener()
Creates a listener for changes in dynamic data structure configurations
|
Map<String,Object> |
createExtensionServices()
Creates additional extension services, which will be registered by
service manager during start-up.
|
InboundHandler[] |
createInboundHandlers(EndpointQualifier qualifier,
TcpIpConnection connection,
IOService ioService)
Creates a InboundHandler for given Connection instance.
|
ManagementService |
createJMXManagementService(HazelcastInstanceImpl instance) |
String |
createMemberUuid(Address address)
Creates a UUID for local member
|
ByteArrayProcessor |
createMulticastInputProcessor(IOService ioService)
Returns a byte array processor for incoming data on the Multicast joiner
|
ByteArrayProcessor |
createMulticastOutputProcessor(IOService ioService)
Returns a byte array processor for outgoing data on the Multicast joiner
|
OutboundHandler[] |
createOutboundHandlers(EndpointQualifier qualifier,
TcpIpConnection connection,
IOService ioService)
Creates a OutboundHandler for given Connection instance.
|
InternalSerializationService |
createSerializationService()
Creates a SerializationService instance to be used by this Node.
|
<T> T |
createService(Class<T> clazz)
Creates a service which is an implementation of given type parameter.
|
TextCommandService |
createTextCommandService() |
TimedMemberStateFactory |
createTimedMemberStateFactory(HazelcastInstanceImpl instance)
Creates a TimedMemberStateFactory for a given Hazelcast instance
|
HotRestartService |
getHotRestartService()
Returns the public hot restart service
|
InternalHotRestartService |
getInternalHotRestartService()
Returns the internal hot restart service
|
ManagementCenterConnectionFactory |
getManagementCenterConnectionFactory() |
MemoryStats |
getMemoryStats()
Returns MemoryStats of for the JVM and current HazelcastInstance.
|
protected PartitioningStrategy |
getPartitioningStrategy(ClassLoader configClassLoader) |
SecurityContext |
getSecurityContext()
Returns SecurityContext for this Node if available, otherwise returns null.
|
SecurityService |
getSecurityService() |
MemberSocketInterceptor |
getSocketInterceptor(EndpointQualifier endpointQualifier)
Returns MemberSocketInterceptor for this Node if available,
otherwise returns null.
|
boolean |
isClientFailoverSupported() |
boolean |
isNodeVersionCompatibleWith(Version clusterVersion)
Check if this node's codebase version is compatible with given cluster version.
|
boolean |
isStartCompleted()
Returns true if the instance has started
|
void |
onClusterStateChange(ClusterState newState,
boolean isTransient)
Called during the commit phase of the cluster state change transaction,
just after updating the value of the cluster state on the local member,
while still holding the cluster lock.
|
void |
onClusterVersionChange(Version newVersion)
Called after cluster version is changed.
|
void |
onInitialClusterState(ClusterState initialState)
Called when initial cluster state is received while joining the cluster.
|
void |
onMemberListChange()
Called synchronously when member list changes
|
void |
onPartitionStateChange()
Called synchronously when partition state (partition assignments, version etc) changes
|
void |
onThreadStart(Thread thread)
Called on thread start to inject/intercept extension specific logic,
like; registering thread in some service,
executing a special method before thread starts to do its own task.
|
void |
onThreadStop(Thread thread)
Called before a thread stops to clean/release injected by
NodeExtension.onThreadStart(Thread) . |
void |
printNodeInfo()
Called to print node information during startup
|
boolean |
registerListener(Object listener)
Registers given listener if it's a known type.
|
void |
registerPlugins(Diagnostics diagnostics)
Register the node extension specific diagnostics plugins on the provided
diagnostics . |
void |
scheduleClusterVersionAutoUpgrade()
Cluster version auto upgrade is done asynchronously.
|
void |
sendPhoneHome()
Send PhoneHome ping from OS or EE instance to PhoneHome application
|
void |
shutdown()
Shutdowns NodeExtension.
|
void |
validateJoinRequest(JoinMessage joinMessage)
Executed on the master node before allowing a new member to join from
ClusterJoinManager.handleJoinRequest(JoinRequest, Connection) . |
protected final Node node
protected final ILogger logger
protected final ILogger systemLogger
protected final List<ClusterVersionListener> clusterVersionListeners
protected PhoneHome phoneHome
public DefaultNodeExtension(Node node)
public void beforeStart()
NodeExtension
beforeStart
in interface NodeExtension
public void printNodeInfo()
NodeExtension
printNodeInfo
in interface NodeExtension
public void beforeJoin()
NodeExtension
beforeJoin
in interface NodeExtension
public void afterStart()
NodeExtension
afterStart
in interface NodeExtension
public boolean isStartCompleted()
NodeExtension
isStartCompleted
in interface NodeExtension
public SecurityContext getSecurityContext()
NodeExtension
getSecurityContext
in interface NodeExtension
public InternalSerializationService createSerializationService()
NodeExtension
createSerializationService
in interface NodeExtension
public SecurityService getSecurityService()
getSecurityService
in interface NodeExtension
protected PartitioningStrategy getPartitioningStrategy(ClassLoader configClassLoader) throws Exception
Exception
public <T> T createService(Class<T> clazz)
NodeExtension
createService
in interface NodeExtension
clazz
- type of servicepublic Map<String,Object> createExtensionServices()
NodeExtension
createExtensionServices
in interface NodeExtension
public MemberSocketInterceptor getSocketInterceptor(EndpointQualifier endpointQualifier)
NodeExtension
getSocketInterceptor
in interface NodeExtension
public InboundHandler[] createInboundHandlers(EndpointQualifier qualifier, TcpIpConnection connection, IOService ioService)
NodeExtension
createInboundHandlers
in interface NodeExtension
connection
- tcp-ip connectionioService
- IOServicepublic OutboundHandler[] createOutboundHandlers(EndpointQualifier qualifier, TcpIpConnection connection, IOService ioService)
NodeExtension
createOutboundHandlers
in interface NodeExtension
connection
- tcp-ip connectionioService
- IOServicepublic ChannelInitializerProvider createChannelInitializerProvider(IOService ioService)
NodeExtension
createChannelInitializerProvider
in interface NodeExtension
public void onThreadStart(Thread thread)
NodeExtension
onThreadStart
in interface NodeExtension
thread
- thread startingpublic void onThreadStop(Thread thread)
NodeExtension
NodeExtension.onThreadStart(Thread)
.onThreadStop
in interface NodeExtension
thread
- thread stoppingpublic MemoryStats getMemoryStats()
NodeExtension
getMemoryStats
in interface NodeExtension
public void beforeShutdown()
NodeExtension
beforeShutdown
in interface NodeExtension
public void shutdown()
NodeExtension
shutdown
in interface NodeExtension
public void validateJoinRequest(JoinMessage joinMessage)
NodeExtension
ClusterJoinManager.handleJoinRequest(JoinRequest, Connection)
.
Implementation should check if the JoinMessage
should be allowed to proceed, otherwise throw an exception
with a message explaining rejection reason.validateJoinRequest
in interface NodeExtension
public void beforeClusterStateChange(ClusterState currState, ClusterState requestedState, boolean isTransient)
NodeExtension
beforeClusterStateChange
in interface NodeExtension
currState
- the state before the changerequestedState
- the requested cluster stateisTransient
- whether the change will be recorded in persistent storage, affecting the
initial state after cluster restart. Transient changes happen during
system operations such as an orderly all-cluster shutdown.public void onClusterStateChange(ClusterState newState, boolean isTransient)
NodeExtension
onClusterStateChange
in interface NodeExtension
newState
- the new cluster stateisTransient
- whether the change will be recorded in persistent storage, affecting the
initial state after cluster restart. Transient changes happen during
system operations such as an orderly all-cluster shutdown.public void afterClusterStateChange(ClusterState oldState, ClusterState newState, boolean isTransient)
NodeExtension
afterClusterStateChange
in interface NodeExtension
oldState
- the state before the changenewState
- the new cluster state, can be equal to oldState
if the
state change transaction failedisTransient
- whether the change will be recorded in persistent storage, affecting the
initial state after cluster restart. Transient changes happen during
system operations such as an orderly all-cluster shutdown.public void onPartitionStateChange()
NodeExtension
onPartitionStateChange
in interface NodeExtension
public void onMemberListChange()
NodeExtension
onMemberListChange
in interface NodeExtension
public void onInitialClusterState(ClusterState initialState)
NodeExtension
onInitialClusterState
in interface NodeExtension
initialState
- initial cluster statepublic void onClusterVersionChange(Version newVersion)
NodeExtension
onClusterVersionChange
in interface NodeExtension
newVersion
- the new version at which the cluster operates.public boolean isNodeVersionCompatibleWith(Version clusterVersion)
NodeExtension
isNodeVersionCompatibleWith
in interface NodeExtension
clusterVersion
- the cluster version to check againsttrue
if compatible, otherwise false.public boolean registerListener(Object listener)
NodeExtension
registerListener
in interface NodeExtension
listener
- listener instancepublic HotRestartService getHotRestartService()
NodeExtension
getHotRestartService
in interface NodeExtension
public InternalHotRestartService getInternalHotRestartService()
NodeExtension
getInternalHotRestartService
in interface NodeExtension
public String createMemberUuid(Address address)
NodeExtension
createMemberUuid
in interface NodeExtension
address
- address of local memberpublic ByteArrayProcessor createMulticastInputProcessor(IOService ioService)
NodeExtension
createMulticastInputProcessor
in interface NodeExtension
public ByteArrayProcessor createMulticastOutputProcessor(IOService ioService)
NodeExtension
createMulticastOutputProcessor
in interface NodeExtension
public TimedMemberStateFactory createTimedMemberStateFactory(HazelcastInstanceImpl instance)
NodeExtension
createTimedMemberStateFactory
in interface NodeExtension
instance
- The instance to associate with the timed member state factoryTimedMemberStateFactory
public DynamicConfigListener createDynamicConfigListener()
NodeExtension
createDynamicConfigListener
in interface NodeExtension
public void registerPlugins(Diagnostics diagnostics)
NodeExtension
diagnostics
.registerPlugins
in interface NodeExtension
diagnostics
- the diagnostics on which plugins should be registeredpublic ManagementCenterConnectionFactory getManagementCenterConnectionFactory()
getManagementCenterConnectionFactory
in interface NodeExtension
public ManagementService createJMXManagementService(HazelcastInstanceImpl instance)
createJMXManagementService
in interface NodeExtension
public TextCommandService createTextCommandService()
createTextCommandService
in interface NodeExtension
public void sendPhoneHome()
NodeExtension
sendPhoneHome
in interface NodeExtension
public void scheduleClusterVersionAutoUpgrade()
NodeExtension
scheduleClusterVersionAutoUpgrade
in interface NodeExtension
public boolean isClientFailoverSupported()
isClientFailoverSupported
in interface NodeExtension
protected void createAndSetPhoneHome()
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.