public interface IDAuthority
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the IDAuthority and any underlying storage backend.
|
IDBlock |
getIDBlock(int partition,
int idNamespace,
Duration timeout)
Returns a block of new ids in the form of
IDBlock . |
List<KeyRange> |
getLocalIDPartition()
Returns the lower and upper limits of the key range assigned to this local machine as an array with two entries.
|
String |
getUniqueID()
Return the globally unique string used by this
IDAuthority
instance to recognize its ID allocations and distinguish its allocations
from those belonging to other IDAuthority instances. |
void |
setIDBlockSizer(IDBlockSizer sizer)
Sets the
IDBlockSizer to be used by this IDAuthority. |
boolean |
supportsInterruption()
Whether
getIDBlock(int, int, Duration) may be safely interrupted. |
IDBlock getIDBlock(int partition, int idNamespace, Duration timeout) throws BackendException
IDBlock
. It is guaranteed that
the block of ids for the particular partition id is uniquely assigned,
that is, the block of ids has not been previously and will not
subsequently be assigned again when invoking this method on the local or
any remote machine that is connected to the underlying storage backend.
In other words, this method has to ensure that ids are uniquely assigned per partition.
It is furthermore guaranteed that any id of the returned IDBlock is smaller than the upper bound
for the given partition as read from the IDBlockSizer
set on this IDAuthority and that the
number of ids returned is equal to the block size of the IDBlockSizer.
partition
- Partition for which to request an id blockidNamespace
- namespace for ids within a partitiontimeout
- When a call to this method is unable to return a id block
before this timeout elapses, the implementation must give up
and throw a StorageException
ASAPpartition
parameterBackendException
List<KeyRange> getLocalIDPartition() throws BackendException
BackendException
void setIDBlockSizer(IDBlockSizer sizer)
IDBlockSizer
to be used by this IDAuthority. The IDBlockSizer specifies the block size for
each partition guaranteeing that the same partition will always be assigned the same block size.
The IDBlockSizer cannot be changed for an IDAuthority that has already been used (i.e. after invoking getIDBlock(int, int, Duration)
.
sizer
- The IDBlockSizer to be used by this IDAuthorityvoid close() throws BackendException
BackendException
String getUniqueID()
IDAuthority
instance to recognize its ID allocations and distinguish its allocations
from those belonging to other IDAuthority
instances.
This should normally be the value of
GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID
, though that's not
strictly technically necessary.boolean supportsInterruption()
getIDBlock(int, int, Duration)
may be safely interrupted.Copyright © 2012–2024. All rights reserved.