public class Atomix extends AtomixCluster implements PrimitivesService
| Constructor and Description |
|---|
Atomix(File configFile) |
Atomix(File configFile,
ClassLoader classLoader) |
Atomix(String configFile) |
Atomix(String configFile,
ClassLoader classLoader) |
| Modifier and Type | Method and Description |
|---|---|
static AtomixBuilder |
builder()
Returns a new Atomix builder.
|
static AtomixBuilder |
builder(AtomixConfig config)
Returns a new Atomix builder.
|
static AtomixBuilder |
builder(AtomixConfig config,
ClassLoader classLoader)
Returns a new Atomix builder.
|
static AtomixBuilder |
builder(ClassLoader classLoader)
Returns a new Atomix builder.
|
static AtomixBuilder |
builder(String config)
Returns a new Atomix builder.
|
static AtomixBuilder |
builder(String configFile,
ClassLoader classLoader)
Returns a new Atomix builder.
|
static AtomixConfig |
config()
Returns a new Atomix configuration.
|
static AtomixConfig |
config(ClassLoader classLoader)
Returns a new Atomix configuration.
|
static AtomixConfig |
config(File configFile)
Returns a new Atomix configuration.
|
static AtomixConfig |
config(String file)
Returns a new Atomix configuration from the given file.
|
static AtomixConfig |
config(String file,
ClassLoader classLoader)
Returns a new Atomix configuration from the given file.
|
AtomicCounter |
getAtomicCounter(String name)
Creates a new AtomicCounterBuilder.
|
<K> AtomicCounterMap<K> |
getAtomicCounterMap(String name)
Creates a new
AtomicCounterMap. |
<V> AtomicDocumentTree<V> |
getAtomicDocumentTree(String name)
Creates a new AtomicMap.
|
AtomicIdGenerator |
getAtomicIdGenerator(String name)
Creates a new AtomicIdGeneratorBuilder.
|
AtomicLock |
getAtomicLock(String name)
Creates a new AtomicLockBuilder.
|
<K,V> AtomicMap<K,V> |
getAtomicMap(String name)
Creates a new AtomicMap.
|
<K,V> AtomicMultimap<K,V> |
getAtomicMultimap(String name)
Creates a new
AtomicTreeMap. |
<K extends Comparable<K>,V> |
getAtomicNavigableMap(String name)
Creates a new
AtomicNavigableMap. |
AtomicSemaphore |
getAtomicSemaphore(String name)
Creates a new DistributedSemaphore.
|
<K extends Comparable<K>,V> |
getAtomicSortedMap(String name)
Creates a new
AtomicSortedMap. |
<V> AtomicValue<V> |
getAtomicValue(String name)
Creates a new AtomicValueBuilder.
|
ConfigService |
getConfigService()
Returns the primitive configuration service.
|
DistributedCounter |
getCounter(String name)
Creates a new DistributedCounter.
|
DistributedCyclicBarrier |
getCyclicBarrier(String name)
Returns a multiton cyclic barrier.
|
ScheduledExecutorService |
getExecutorService()
Returns the core Atomix executor service.
|
<T> LeaderElection<T> |
getLeaderElection(String name)
Creates a new LeaderElectionBuilder.
|
<T> LeaderElector<T> |
getLeaderElector(String name)
Creates a new LeaderElectorBuilder.
|
<E> DistributedList<E> |
getList(String name)
Creates a new DistributedList.
|
DistributedLock |
getLock(String name)
Creates a new DistributedLockBuilder.
|
<K,V> DistributedMap<K,V> |
getMap(String name)
Creates a new DistributedMap.
|
<K,V> DistributedMultimap<K,V> |
getMultimap(String name)
Creates a new DistributedMultimap.
|
<E> DistributedMultiset<E> |
getMultiset(String name)
Creates a new DistributedMultiset.
|
<K extends Comparable<K>,V> |
getNavigableMap(String name)
Creates a new DistributedNavigableMap.
|
<E extends Comparable<E>> |
getNavigableSet(String name)
Creates a new DistributedNavigableSet.
|
PartitionService |
getPartitionService()
Returns the partition service.
|
<P extends SyncPrimitive> |
getPrimitiveAsync(String name)
Returns a registered primitive asynchronously.
|
<P extends SyncPrimitive> |
getPrimitiveAsync(String name,
PrimitiveType<?,?,P> primitiveType)
Returns a cached primitive asynchronously.
|
<C extends PrimitiveConfig<C>,P extends SyncPrimitive> |
getPrimitiveAsync(String name,
PrimitiveType<?,C,P> primitiveType,
C primitiveConfig)
Returns a cached primitive asynchronously.
|
Collection<PrimitiveInfo> |
getPrimitives()
Returns a collection of open primitives.
|
Collection<PrimitiveInfo> |
getPrimitives(PrimitiveType primitiveType)
Returns a collection of open primitives of the given type.
|
PrimitivesService |
getPrimitivesService()
Returns the primitives service.
|
<E> DistributedQueue<E> |
getQueue(String name)
Creates a new DistributedQueue.
|
AtomixRegistry |
getRegistry()
Returns the type registry service.
|
DistributedSemaphore |
getSemaphore(String name)
Creates a new DistributedSemaphore.
|
<E> DistributedSet<E> |
getSet(String name)
Creates a new DistributedSet.
|
<K extends Comparable<K>,V> |
getSortedMap(String name)
Creates a new DistributedSortedMap.
|
<E extends Comparable<E>> |
getSortedSet(String name)
Creates a new DistributedSortedSet.
|
TransactionService |
getTransactionService()
Returns the transaction service.
|
<V> DistributedValue<V> |
getValue(String name)
Creates a new DistributedValue.
|
<E> WorkQueue<E> |
getWorkQueue(String name)
Creates a new WorkQueueBuilder.
|
<B extends PrimitiveBuilder<B,C,P>,C extends PrimitiveConfig<C>,P extends SyncPrimitive> |
primitiveBuilder(String name,
PrimitiveType<B,C,P> primitiveType)
Returns a primitive builder of the given type.
|
CompletableFuture<Void> |
start()
Starts the Atomix instance.
|
CompletableFuture<Void> |
stop()
Stops the managed object.
|
String |
toString() |
TransactionBuilder |
transactionBuilder(String name)
Creates a new transaction builder.
|
builder, getBroadcastService, getCommunicationService, getEventService, getMembershipService, getMessagingService, isRunningequals, getClass, hashCode, notify, notifyAll, wait, wait, waitatomicCounterBuilder, atomicCounterMapBuilder, atomicDocumentTreeBuilder, atomicIdGeneratorBuilder, atomicLockBuilder, atomicMapBuilder, atomicMultimapBuilder, atomicNavigableMapBuilder, atomicSemaphoreBuilder, atomicSortedMapBuilder, atomicValueBuilder, counterBuilder, cyclicBarrierBuilder, getPrimitive, getPrimitive, getPrimitive, leaderElectionBuilder, leaderElectorBuilder, listBuilder, lockBuilder, mapBuilder, multimapBuilder, multisetBuilder, navigableMapBuilder, navigableSetBuilder, queueBuilder, semaphoreBuilder, setBuilder, sortedMapBuilder, sortedSetBuilder, transactionBuilder, valueBuilder, workQueueBuilderpublic Atomix(String configFile)
public Atomix(String configFile, ClassLoader classLoader)
public Atomix(File configFile)
public Atomix(File configFile, ClassLoader classLoader)
public static AtomixConfig config()
public static AtomixConfig config(File configFile)
configFile - the Atomix configuration filepublic static AtomixConfig config(ClassLoader classLoader)
classLoader - the class loaderpublic static AtomixConfig config(String file)
file - the file from which to return a new Atomix configurationpublic static AtomixConfig config(String file, ClassLoader classLoader)
file - the file from which to return a new Atomix configurationclassLoader - the class loaderpublic static AtomixBuilder builder()
public static AtomixBuilder builder(ClassLoader classLoader)
classLoader - the class loaderpublic static AtomixBuilder builder(String config)
config - the Atomix configurationpublic static AtomixBuilder builder(String configFile, ClassLoader classLoader)
configFile - the Atomix configuration fileclassLoader - the class loaderpublic static AtomixBuilder builder(AtomixConfig config)
config - the Atomix configurationpublic static AtomixBuilder builder(AtomixConfig config, ClassLoader classLoader)
config - the Atomix configurationclassLoader - the class loader with which to load the Atomix registrypublic AtomixRegistry getRegistry()
public ScheduledExecutorService getExecutorService()
public ConfigService getConfigService()
public PartitionService getPartitionService()
public PrimitivesService getPrimitivesService()
public TransactionService getTransactionService()
public TransactionBuilder transactionBuilder(String name)
PrimitivesServicetransactionBuilder in interface PrimitivesServicename - the transaction namepublic <B extends PrimitiveBuilder<B,C,P>,C extends PrimitiveConfig<C>,P extends SyncPrimitive> B primitiveBuilder(String name, PrimitiveType<B,C,P> primitiveType)
PrimitivesServiceprimitiveBuilder in interface PrimitivesServiceB - the primitive builder typeP - the primitive typename - the primitive nameprimitiveType - the primitive typepublic <K,V> DistributedMap<K,V> getMap(String name)
PrimitivesServicegetMap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <K extends Comparable<K>,V> DistributedSortedMap<K,V> getSortedMap(String name)
PrimitivesServicegetSortedMap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <K extends Comparable<K>,V> DistributedNavigableMap<K,V> getNavigableMap(String name)
PrimitivesServicegetNavigableMap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <K,V> DistributedMultimap<K,V> getMultimap(String name)
PrimitivesServicegetMultimap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <K,V> AtomicMap<K,V> getAtomicMap(String name)
PrimitivesServicegetAtomicMap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <V> AtomicDocumentTree<V> getAtomicDocumentTree(String name)
PrimitivesServicegetAtomicDocumentTree in interface PrimitivesServiceV - value typename - the primitive namepublic <K extends Comparable<K>,V> AtomicSortedMap<K,V> getAtomicSortedMap(String name)
PrimitivesServiceAtomicSortedMap.getAtomicSortedMap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <K extends Comparable<K>,V> AtomicNavigableMap<K,V> getAtomicNavigableMap(String name)
PrimitivesServiceAtomicNavigableMap.getAtomicNavigableMap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <K,V> AtomicMultimap<K,V> getAtomicMultimap(String name)
PrimitivesServiceAtomicTreeMap.getAtomicMultimap in interface PrimitivesServiceK - key typeV - value typename - the primitive namepublic <K> AtomicCounterMap<K> getAtomicCounterMap(String name)
PrimitivesServiceAtomicCounterMap.getAtomicCounterMap in interface PrimitivesServiceK - key typename - the primitive namepublic <E> DistributedSet<E> getSet(String name)
PrimitivesServicegetSet in interface PrimitivesServiceE - set element typename - the primitive namepublic <E extends Comparable<E>> DistributedSortedSet<E> getSortedSet(String name)
PrimitivesServicegetSortedSet in interface PrimitivesServiceE - set element typename - the primitive namepublic <E extends Comparable<E>> DistributedNavigableSet<E> getNavigableSet(String name)
PrimitivesServicegetNavigableSet in interface PrimitivesServiceE - set element typename - the primitive namepublic <E> DistributedQueue<E> getQueue(String name)
PrimitivesServicegetQueue in interface PrimitivesServiceE - queue element typename - the primitive namepublic <E> DistributedList<E> getList(String name)
PrimitivesServicegetList in interface PrimitivesServiceE - list element typename - the primitive namepublic <E> DistributedMultiset<E> getMultiset(String name)
PrimitivesServicegetMultiset in interface PrimitivesServiceE - multiset element typename - the primitive namepublic DistributedCounter getCounter(String name)
PrimitivesServicegetCounter in interface PrimitivesServicename - the primitive namepublic AtomicCounter getAtomicCounter(String name)
PrimitivesServicegetAtomicCounter in interface PrimitivesServicename - the primitive namepublic AtomicIdGenerator getAtomicIdGenerator(String name)
PrimitivesServicegetAtomicIdGenerator in interface PrimitivesServicename - the primitive namepublic <V> DistributedValue<V> getValue(String name)
PrimitivesServicegetValue in interface PrimitivesServiceV - value typename - the primitive namepublic <V> AtomicValue<V> getAtomicValue(String name)
PrimitivesServicegetAtomicValue in interface PrimitivesServiceV - atomic value typename - the primitive namepublic <T> LeaderElection<T> getLeaderElection(String name)
PrimitivesServicegetLeaderElection in interface PrimitivesServicename - the primitive namepublic <T> LeaderElector<T> getLeaderElector(String name)
PrimitivesServicegetLeaderElector in interface PrimitivesServicename - the primitive namepublic DistributedLock getLock(String name)
PrimitivesServicegetLock in interface PrimitivesServicename - the primitive namepublic AtomicLock getAtomicLock(String name)
PrimitivesServicegetAtomicLock in interface PrimitivesServicename - the primitive namepublic DistributedCyclicBarrier getCyclicBarrier(String name)
PrimitivesServicegetCyclicBarrier in interface PrimitivesServicename - the primitive namepublic DistributedSemaphore getSemaphore(String name)
PrimitivesServicegetSemaphore in interface PrimitivesServicename - the primitive namepublic AtomicSemaphore getAtomicSemaphore(String name)
PrimitivesServicegetAtomicSemaphore in interface PrimitivesServicename - the primitive namepublic <E> WorkQueue<E> getWorkQueue(String name)
PrimitivesServicegetWorkQueue in interface PrimitivesServiceE - work queue element typename - the primitive namepublic <P extends SyncPrimitive> CompletableFuture<P> getPrimitiveAsync(String name)
PrimitivesServicegetPrimitiveAsync in interface PrimitivesServiceP - the primitive typename - the primitive namepublic <P extends SyncPrimitive> CompletableFuture<P> getPrimitiveAsync(String name, PrimitiveType<?,?,P> primitiveType)
PrimitivesServicegetPrimitiveAsync in interface PrimitivesServiceP - the primitive typename - the primitive nameprimitiveType - the primitive typepublic <C extends PrimitiveConfig<C>,P extends SyncPrimitive> CompletableFuture<P> getPrimitiveAsync(String name, PrimitiveType<?,C,P> primitiveType, C primitiveConfig)
PrimitivesServicegetPrimitiveAsync in interface PrimitivesServiceC - the primitive configuration typeP - the primitive typename - the primitive nameprimitiveType - the primitive typeprimitiveConfig - the primitive configurationpublic Collection<PrimitiveInfo> getPrimitives()
PrimitivesServicegetPrimitives in interface PrimitivesServicepublic Collection<PrimitiveInfo> getPrimitives(PrimitiveType primitiveType)
PrimitivesServicegetPrimitives in interface PrimitivesServiceprimitiveType - the primitive typepublic CompletableFuture<Void> start()
The returned future will be completed once this instance completes startup. Note that in order to complete startup, all partitions must be able to form. For Raft partitions, that requires that a majority of the nodes in each partition be started concurrently.
start in interface Managed<Void>start in class AtomixClusterpublic CompletableFuture<Void> stop()
Managedstop in interface Managed<Void>stop in class AtomixClusterpublic String toString()
toString in class AtomixClusterCopyright © 2013–2018. All rights reserved.