@API(value=MAINTAINED) public class ScopedDirectoryLayer extends LocatableResolver
LocatableResolver
that uses the FDB directory layer to keep track of the allocation of
strings to integers. The KeySpacePath
that it is created with will be the root where the node subspace of the
directory layer is located.LocatableResolver.LocatableResolverLockedException
database, hashCode, location
Constructor and Description |
---|
ScopedDirectoryLayer(FDBDatabase database,
ResolvedKeySpacePath path)
Create a scoped directory layer.
|
ScopedDirectoryLayer(FDBRecordContext context,
KeySpacePath path)
Deprecated.
|
create, disableWriteLock, enableWriteLock, equals, exclusiveLock, getBaseSubspace, getDatabase, getMappingSubspace, getVersion, hashCode, incrementVersion, mustResolve, mustResolveWithMetadata, resolve, resolve, resolve, resolve, resolve, resolve, resolveWithMetadata, resolveWithMetadata, resolveWithMetadata, retired, retiredSkipCache, retireLayer, reverseLookup, setMapping, toString, updateMetadataAndVersion, wrap
@Deprecated @API(value=DEPRECATED) public ScopedDirectoryLayer(@Nonnull FDBRecordContext context, @Nonnull KeySpacePath path)
ScopedDirectoryLayer(FDBDatabase, ResolvedKeySpacePath)
insteadcontext
- a context that is used only during the construction of this scope in order to
resolve the provided path into a subspacepath
- the path at which the directory layer should livepublic ScopedDirectoryLayer(@Nonnull FDBDatabase database, @Nonnull ResolvedKeySpacePath path)
database
- database that will be used when resolving valuespath
- the path at which the directory layer should store its mappings.public static ScopedDirectoryLayer global(@Nonnull FDBDatabase database)
LocatableResolver
that is backed by
the default instance of the FDB directory layer.database
- the FDBDatabase
for this resolverScopedDirectoryLayer
for this databaseprotected CompletableFuture<ResolverResult> create(@Nonnull FDBRecordContext context, @Nonnull String key, @Nullable byte[] metadata)
create
in class LocatableResolver
protected CompletableFuture<Optional<ResolverResult>> read(@Nonnull FDBRecordContext context, String key)
read
in class LocatableResolver
protected CompletableFuture<Optional<String>> readReverse(FDBStoreTimer timer, Long value)
readReverse
in class LocatableResolver
public CompletableFuture<Void> setMapping(FDBRecordContext context, String key, ResolverResult value)
setMapping
in class LocatableResolver
public CompletableFuture<Void> updateMetadata(FDBRecordContext context, String key, byte[] metadata)
updateMetadata
in class LocatableResolver
public CompletableFuture<Void> setWindow(long count)
setWindow
in class LocatableResolver
@Nonnull public CompletableFuture<Subspace> getMappingSubspaceAsync()
LocatableResolver
CompletableFuture
that will contain the Subspace
where this resolver stores
the mappings from key
String
s to value
Long
. Direct access
to this subspace is not needed by general users and extreme care should be taken when interacting with it.getMappingSubspaceAsync
in class LocatableResolver
protected CompletableFuture<Subspace> getStateSubspaceAsync()
getStateSubspaceAsync
in class LocatableResolver
@Nonnull public ResolverResult deserializeValue(byte[] value)
LocatableResolver
deserializeValue
in class LocatableResolver
value
- raw value bytes.ResolverResult
.@Nonnull public CompletableFuture<Subspace> getBaseSubspaceAsync()
LocatableResolver
CompletableFuture
that will contain the Subspace
this resolver is rooted
at (e.g. the global resolver ExtendedDirectoryLayer.global(FDBDatabase)
has a base
subspace at the root of the FDB keyspace. Note that this is not the subspace where the resolver
maintains its allocation keys (see LocatableResolver.getMappingSubspaceAsync()
).getBaseSubspaceAsync
in class LocatableResolver
public CompletableFuture<Subspace> getNodeSubspace(FDBRecordContext context)
public Subspace getContentSubspace()