public interface SharedData
Shared data provides:
WARNING: In clustered mode, asynchronous maps/locks/counters rely on distributed data structures provided by the cluster manager. Beware that the latency relative to asynchronous maps/locks/counters operations can be much higher in clustered than in local mode.
Please see the documentation for more information.Modifier and Type | Method and Description |
---|---|
<K,V> Future<AsyncMap<K,V>> |
getAsyncMap(String name)
Same as
getAsyncMap(String, Handler) but returns a Future of the asynchronous result |
<K,V> void |
getAsyncMap(String name,
Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
Get the
AsyncMap with the specified name. |
<K,V> Future<AsyncMap<K,V>> |
getClusterWideMap(String name)
Same as
getClusterWideMap(String, Handler) but returns a Future of the asynchronous result |
<K,V> void |
getClusterWideMap(String name,
Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
Get the cluster wide map with the specified name.
|
Future<Counter> |
getCounter(String name)
Same as
getCounter(String, Handler) but returns a Future of the asynchronous result |
void |
getCounter(String name,
Handler<AsyncResult<Counter>> resultHandler)
Get an asynchronous counter.
|
<K,V> Future<AsyncMap<K,V>> |
getLocalAsyncMap(String name)
Same as
getLocalAsyncMap(String, Handler) but returns a Future of the asynchronous result |
<K,V> void |
getLocalAsyncMap(String name,
Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
Get the
AsyncMap with the specified name. |
Future<Counter> |
getLocalCounter(String name)
Same as
getLocalCounter(String, Handler) but returns a Future of the asynchronous result |
void |
getLocalCounter(String name,
Handler<AsyncResult<Counter>> resultHandler)
Get an asynchronous local counter.
|
Future<Lock> |
getLocalLock(String name)
Same as
getLocalLock(String, Handler) but returns a Future of the asynchronous result |
void |
getLocalLock(String name,
Handler<AsyncResult<Lock>> resultHandler)
Get an asynchronous local lock with the specified name.
|
Future<Lock> |
getLocalLockWithTimeout(String name,
long timeout)
Same as
getLocalLockWithTimeout(String, long, Handler) but returns a Future of the asynchronous result |
void |
getLocalLockWithTimeout(String name,
long timeout,
Handler<AsyncResult<Lock>> resultHandler)
Like
getLocalLock(String, Handler) but specifying a timeout. |
<K,V> LocalMap<K,V> |
getLocalMap(String name)
Return a
LocalMap with the specific name . |
Future<Lock> |
getLock(String name)
Same as
getLock(String, Handler) but returns a Future of the asynchronous result |
void |
getLock(String name,
Handler<AsyncResult<Lock>> resultHandler)
Get an asynchronous lock with the specified name.
|
Future<Lock> |
getLockWithTimeout(String name,
long timeout)
Same as
getLockWithTimeout(String, long, Handler) but returns a Future of the asynchronous result |
void |
getLockWithTimeout(String name,
long timeout,
Handler<AsyncResult<Lock>> resultHandler)
Like
getLock(String, Handler) but specifying a timeout. |
<K,V> void getClusterWideMap(String name, Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
name
- the name of the mapresultHandler
- the map will be returned asynchronously in this handlerIllegalStateException
- if the parent Vertx
instance is not clustered<K,V> Future<AsyncMap<K,V>> getClusterWideMap(String name)
getClusterWideMap(String, Handler)
but returns a Future
of the asynchronous result<K,V> void getAsyncMap(String name, Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
AsyncMap
with the specified name. When clustered, the map is accessible to all nodes in the cluster
and data put into the map from any node is visible to to any other node.
WARNING: In clustered mode, asynchronous shared maps rely on distributed data structures provided by the cluster manager. Beware that the latency relative to asynchronous shared maps operations can be much higher in clustered than in local mode.
name
- the name of the mapresultHandler
- the map will be returned asynchronously in this handler<K,V> Future<AsyncMap<K,V>> getAsyncMap(String name)
getAsyncMap(String, Handler)
but returns a Future
of the asynchronous result<K,V> void getLocalAsyncMap(String name, Handler<AsyncResult<AsyncMap<K,V>>> resultHandler)
AsyncMap
with the specified name.
When clustered, the map is NOT accessible to all nodes in the cluster. Only the instance which created the map can put and retrieve data from this map.
name
- the name of the mapresultHandler
- the map will be returned asynchronously in this handler<K,V> Future<AsyncMap<K,V>> getLocalAsyncMap(String name)
getLocalAsyncMap(String, Handler)
but returns a Future
of the asynchronous resultvoid getLock(String name, Handler<AsyncResult<Lock>> resultHandler)
In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
name
- the name of the lockresultHandler
- the handlerFuture<Lock> getLock(String name)
getLock(String, Handler)
but returns a Future
of the asynchronous resultvoid getLockWithTimeout(String name, long timeout, Handler<AsyncResult<Lock>> resultHandler)
getLock(String, Handler)
but specifying a timeout. If the lock is not obtained within the timeout
a failure will be sent to the handler.
In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
name
- the name of the locktimeout
- the timeout in msresultHandler
- the handlerFuture<Lock> getLockWithTimeout(String name, long timeout)
getLockWithTimeout(String, long, Handler)
but returns a Future
of the asynchronous resultvoid getLocalLock(String name, Handler<AsyncResult<Lock>> resultHandler)
In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
name
- the name of the lockresultHandler
- the handlerFuture<Lock> getLocalLock(String name)
getLocalLock(String, Handler)
but returns a Future
of the asynchronous resultvoid getLocalLockWithTimeout(String name, long timeout, Handler<AsyncResult<Lock>> resultHandler)
getLocalLock(String, Handler)
but specifying a timeout. If the lock is not obtained within the timeout
a failure will be sent to the handler.
In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
name
- the name of the locktimeout
- the timeout in msresultHandler
- the handlerFuture<Lock> getLocalLockWithTimeout(String name, long timeout)
getLocalLockWithTimeout(String, long, Handler)
but returns a Future
of the asynchronous resultvoid getCounter(String name, Handler<AsyncResult<Counter>> resultHandler)
name
- the name of the counter.resultHandler
- the handlerFuture<Counter> getCounter(String name)
getCounter(String, Handler)
but returns a Future
of the asynchronous resultvoid getLocalCounter(String name, Handler<AsyncResult<Counter>> resultHandler)
name
- the name of the counter.resultHandler
- the handlerFuture<Counter> getLocalCounter(String name)
getLocalCounter(String, Handler)
but returns a Future
of the asynchronous resultCopyright © 2021 Eclipse. All rights reserved.