public interface ClusterManager extends VertxServiceProvider
Vertx.executeBlocking(io.vertx.core.Handler<io.vertx.core.Promise<T>>, boolean, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
should be used to run the operation on a worker.Modifier and Type | Method and Description |
---|---|
void |
addRegistration(String address,
RegistrationInfo registrationInfo,
Promise<Void> promise)
Share a new messaging handler registration with other nodes in the cluster.
|
default String |
clusterHost()
If the cluster manager has its own server for data/membership, this returns the host it is listening to.
|
default String |
clusterPublicHost()
If the cluster manager has its own server for data/membership, this returns the host it advertises to other nodes.
|
<K,V> void |
getAsyncMap(String name,
Promise<AsyncMap<K,V>> promise)
Return an
AsyncMap for the given name . |
void |
getCounter(String name,
Promise<Counter> promise)
Return a
Counter for the given name . |
void |
getLockWithTimeout(String name,
long timeout,
Promise<Lock> promise)
|
String |
getNodeId()
Return the unique node identifier for this node.
|
NodeInfo |
getNodeInfo()
Get details about this clustered node.
|
void |
getNodeInfo(String nodeId,
Promise<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.
|
void |
getRegistrations(String address,
Promise<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 given
name . |
default void |
init(io.vertx.core.impl.VertxBuilder builder)
Let the provider initialize the Vert.x builder.
|
void |
init(Vertx vertx,
NodeSelector nodeSelector)
Invoked before this cluster node tries to join the cluster.
|
boolean |
isActive()
Is the cluster manager active?
|
void |
join(Promise<Void> promise)
Join the cluster.
|
void |
leave(Promise<Void> promise)
Leave the cluster.
|
void |
nodeListener(NodeListener listener)
Set a listener that will be called when a node joins or leaves the cluster.
|
void |
removeRegistration(String address,
RegistrationInfo registrationInfo,
Promise<Void> promise)
Signal removal of a messaging handler registration to other nodes in the cluster.
|
void |
setNodeInfo(NodeInfo nodeInfo,
Promise<Void> promise)
Store the details about this clustered node.
|
default void init(io.vertx.core.impl.VertxBuilder builder)
VertxServiceProvider
init
in interface VertxServiceProvider
builder
- the buildervoid init(Vertx vertx, NodeSelector nodeSelector)
Implementations must signal the provided nodeSelector
when messaging handler registrations are added or removed
by sending a RegistrationUpdateEvent
with NodeSelector.registrationsUpdated(RegistrationUpdateEvent)
.
vertx
- the Vert.x instancenodeSelector
- the NodeSelector
that must receive RegistrationUpdateEvent
.<K,V> void getAsyncMap(String name, Promise<AsyncMap<K,V>> promise)
AsyncMap
for the given name
.void getCounter(String name, Promise<Counter> promise)
Counter
for the given name
.String getNodeId()
List<String> getNodes()
void nodeListener(NodeListener listener)
void setNodeInfo(NodeInfo nodeInfo, Promise<Void> promise)
NodeInfo getNodeInfo()
void getNodeInfo(String nodeId, Promise<NodeInfo> promise)
nodeId
- the clustered node idboolean isActive()
void addRegistration(String address, RegistrationInfo registrationInfo, Promise<Void> promise)
void removeRegistration(String address, RegistrationInfo registrationInfo, Promise<Void> promise)
void getRegistrations(String address, Promise<List<RegistrationInfo>> promise)
default String clusterHost()
default String clusterPublicHost()
Copyright © 2021 Eclipse. All rights reserved.