Package io.vertx.spi.cluster.ignite
Class IgniteClusterManager
- java.lang.Object
-
- io.vertx.spi.cluster.ignite.IgniteClusterManager
-
- All Implemented Interfaces:
ClusteredNode,ClusterManager,VertxServiceProvider
public class IgniteClusterManager extends Object implements ClusterManager
Apache Ignite based cluster manager.- Author:
- Andrey Gura, Lukas Prettenthaler
-
-
Constructor Summary
Constructors Constructor Description IgniteClusterManager()Default constructor.IgniteClusterManager(JsonObject jsonConfig)Creates cluster manager instance with given JSON configuration.IgniteClusterManager(IgniteOptions extOptions)Creates cluster manager instance with given IgniteOptions.IgniteClusterManager(URL configFile)Creates cluster manager instance with given Spring XML configuration file.IgniteClusterManager(org.apache.ignite.configuration.IgniteConfiguration extCfg)Creates cluster manager instance with given Ignite configuration.IgniteClusterManager(org.apache.ignite.Ignite ignite)Creates cluster manager instance with givenIgniteinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise)Share a new messaging handler registration with other nodes in the cluster.<K,V>
voidgetAsyncMap(String name, Completable<AsyncMap<K,V>> promise)Return anAsyncMapfor the givenname.voidgetCounter(String name, Completable<Counter> promise)Return aCounterfor the givenname.org.apache.ignite.IgnitegetIgniteInstance()Returns instance ofIgnite.voidgetLockWithTimeout(String name, long timeout, Completable<Lock> promise)StringgetNodeId()Return the unique node identifier for this node.NodeInfogetNodeInfo()Get details about this clustered node.voidgetNodeInfo(String id, Completable<NodeInfo> promise)Get details about a specific node in the cluster.List<String>getNodes()Return a list of node identifiers corresponding to the nodes in the cluster.voidgetRegistrations(String address, Completable<List<RegistrationInfo>> promise)Get the messaging handler currently registered in the cluster.<K,V>
Map<K,V>getSyncMap(String name)Return a synchronous map for the givenname.voidinit(Vertx vertx)Invoked before this cluster node tries to join the cluster.booleanisActive()Is the cluster manager active?voidjoin(Completable<Void> promise)Join the cluster.voidleave(Completable<Void> promise)Leave the cluster.voidnodeListener(NodeListener nodeListener)Set a listener that will be called when a node joins or leaves the cluster.voidregistrationListener(RegistrationListener registrationListener)Implementations must signal the providedregistrationListenerwhen messaging handler registrations are added or removed by sending aRegistrationUpdateEventwithRegistrationListener.registrationsUpdated(RegistrationUpdateEvent).voidremoveRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise)Signal removal of a messaging handler registration to other nodes in the cluster.voidsetNodeInfo(NodeInfo nodeInfo, Completable<Void> promise)Store the details about this clustered node.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertx.core.spi.cluster.ClusterManager
clusterHost, clusterPublicHost, init
-
-
-
-
Constructor Detail
-
IgniteClusterManager
public IgniteClusterManager()
Default constructor. Cluster manager will get configuration from classpath.
-
IgniteClusterManager
public IgniteClusterManager(org.apache.ignite.configuration.IgniteConfiguration extCfg)
Creates cluster manager instance with given Ignite configuration. Use this constructor in order to configure cluster manager programmatically.- Parameters:
extCfg-IgniteConfigurationinstance.
-
IgniteClusterManager
public IgniteClusterManager(URL configFile)
Creates cluster manager instance with given Spring XML configuration file. Use this constructor in order to configure cluster manager programmatically.- Parameters:
configFile-URLpath to Spring XML configuration file.
-
IgniteClusterManager
public IgniteClusterManager(JsonObject jsonConfig)
Creates cluster manager instance with given JSON configuration. Use this constructor in order to configure cluster manager programmatically.- Parameters:
jsonConfig-JsonObjectJSON configuration.
-
IgniteClusterManager
public IgniteClusterManager(IgniteOptions extOptions)
Creates cluster manager instance with given IgniteOptions. Use this constructor in order to configure cluster manager programmatically.- Parameters:
extOptions-IgniteOptionsoptions object.
-
IgniteClusterManager
public IgniteClusterManager(org.apache.ignite.Ignite ignite)
Creates cluster manager instance with givenIgniteinstance.- Parameters:
ignite-Igniteinstance.
-
-
Method Detail
-
getIgniteInstance
public org.apache.ignite.Ignite getIgniteInstance()
Returns instance ofIgnite.- Returns:
Igniteinstance.
-
init
public void init(Vertx vertx)
Description copied from interface:ClusterManagerInvoked before this cluster node tries to join the cluster.- Specified by:
initin interfaceClusterManager- Parameters:
vertx- the Vert.x instance
-
registrationListener
public void registrationListener(RegistrationListener registrationListener)
Description copied from interface:ClusterManagerImplementations must signal the providedregistrationListenerwhen messaging handler registrations are added or removed by sending aRegistrationUpdateEventwithRegistrationListener.registrationsUpdated(RegistrationUpdateEvent).- Specified by:
registrationListenerin interfaceClusterManager- Parameters:
registrationListener- the registration listener
-
nodeListener
public void nodeListener(NodeListener nodeListener)
Description copied from interface:ClusterManagerSet a listener that will be called when a node joins or leaves the cluster.- Specified by:
nodeListenerin interfaceClusterManager
-
getAsyncMap
public <K,V> void getAsyncMap(String name, Completable<AsyncMap<K,V>> promise)
Description copied from interface:ClusterManagerReturn anAsyncMapfor the givenname.- Specified by:
getAsyncMapin interfaceClusterManager
-
getSyncMap
public <K,V> Map<K,V> getSyncMap(String name)
Description copied from interface:ClusterManagerReturn a synchronous map for the givenname.- Specified by:
getSyncMapin interfaceClusterManager
-
getLockWithTimeout
public void getLockWithTimeout(String name, long timeout, Completable<Lock> promise)
Description copied from interface:ClusterManager- Specified by:
getLockWithTimeoutin interfaceClusterManager
-
getCounter
public void getCounter(String name, Completable<Counter> promise)
Description copied from interface:ClusterManagerReturn aCounterfor the givenname.- Specified by:
getCounterin interfaceClusterManager
-
getNodeId
public String getNodeId()
Description copied from interface:ClusteredNodeReturn the unique node identifier for this node.- Specified by:
getNodeIdin interfaceClusteredNode
-
setNodeInfo
public void setNodeInfo(NodeInfo nodeInfo, Completable<Void> promise)
Description copied from interface:ClusterManagerStore the details about this clustered node.- Specified by:
setNodeInfoin interfaceClusterManager
-
getNodeInfo
public NodeInfo getNodeInfo()
Description copied from interface:ClusteredNodeGet details about this clustered node.- Specified by:
getNodeInfoin interfaceClusteredNode
-
getNodeInfo
public void getNodeInfo(String id, Completable<NodeInfo> promise)
Description copied from interface:ClusteredNodeGet details about a specific node in the cluster.- Specified by:
getNodeInfoin interfaceClusteredNode- Parameters:
id- the clustered node id
-
getNodes
public List<String> getNodes()
Description copied from interface:ClusteredNodeReturn a list of node identifiers corresponding to the nodes in the cluster.- Specified by:
getNodesin interfaceClusteredNode
-
join
public void join(Completable<Void> promise)
Description copied from interface:ClusterManagerJoin the cluster.- Specified by:
joinin interfaceClusterManager
-
leave
public void leave(Completable<Void> promise)
Description copied from interface:ClusterManagerLeave the cluster.- Specified by:
leavein interfaceClusterManager
-
isActive
public boolean isActive()
Description copied from interface:ClusterManagerIs the cluster manager active?- Specified by:
isActivein interfaceClusterManager- Returns:
- true if active, false otherwise
-
addRegistration
public void addRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise)
Description copied from interface:ClusterManagerShare a new messaging handler registration with other nodes in the cluster.- Specified by:
addRegistrationin interfaceClusterManager
-
removeRegistration
public void removeRegistration(String address, RegistrationInfo registrationInfo, Completable<Void> promise)
Description copied from interface:ClusterManagerSignal removal of a messaging handler registration to other nodes in the cluster.- Specified by:
removeRegistrationin interfaceClusterManager
-
getRegistrations
public void getRegistrations(String address, Completable<List<RegistrationInfo>> promise)
Description copied from interface:ClusteredNodeGet the messaging handler currently registered in the cluster.- Specified by:
getRegistrationsin interfaceClusteredNode
-
-