Class ScopedInterningLayer
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.keyspace.LocatableResolver
-
- com.apple.foundationdb.record.provider.foundationdb.layers.interning.ScopedInterningLayer
-
@API(MAINTAINED) public class ScopedInterningLayer extends LocatableResolver
An implementation ofLocatableResolver
that is backed by theStringInterningLayer
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.apple.foundationdb.record.provider.foundationdb.keyspace.LocatableResolver
LocatableResolver.LocatableResolverLockedException
-
-
Field Summary
-
Fields inherited from class com.apple.foundationdb.record.provider.foundationdb.keyspace.LocatableResolver
database, hashCode, location
-
-
Constructor Summary
Constructors Constructor Description ScopedInterningLayer(FDBDatabase database, ResolvedKeySpacePath path)
Creates a resolver rooted at the providedKeySpacePath
.ScopedInterningLayer(FDBRecordContext context, KeySpacePath path)
Deprecated.
-
Method Summary
-
Methods inherited from class com.apple.foundationdb.record.provider.foundationdb.keyspace.LocatableResolver
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
-
-
-
-
Constructor Detail
-
ScopedInterningLayer
@Deprecated @API(DEPRECATED) public ScopedInterningLayer(@Nonnull FDBRecordContext context, @Nonnull KeySpacePath path)
Deprecated.Creates a resolver rooted at the providedKeySpacePath
.- Parameters:
context
- context used to resolve the providedpath
. This context is only used during the construction of this class and at no other pointpath
- theKeySpacePath
where this resolver is rooted
-
ScopedInterningLayer
public ScopedInterningLayer(@Nonnull FDBDatabase database, @Nonnull ResolvedKeySpacePath path)
Creates a resolver rooted at the providedKeySpacePath
.- Parameters:
database
- database that will be used when resolving valuespath
- theResolvedKeySpacePath
where this resolver is rooted
-
-
Method Detail
-
global
public static ScopedInterningLayer global(@Nonnull FDBDatabase database)
Creates a default instance of the scoped interning layer.- Parameters:
database
- theFDBDatabase
for this resolver- Returns:
- the global
ScopedInterningLayer
for this database
-
read
protected CompletableFuture<Optional<ResolverResult>> read(@Nonnull FDBRecordContext context, String key)
- Specified by:
read
in classLocatableResolver
-
create
protected CompletableFuture<ResolverResult> create(@Nonnull FDBRecordContext context, @Nonnull String key, @Nullable byte[] metadata)
- Specified by:
create
in classLocatableResolver
-
readReverse
protected CompletableFuture<Optional<String>> readReverse(FDBStoreTimer timer, Long value)
- Specified by:
readReverse
in classLocatableResolver
-
setMapping
public CompletableFuture<Void> setMapping(FDBRecordContext context, String key, ResolverResult value)
- Specified by:
setMapping
in classLocatableResolver
-
updateMetadata
public CompletableFuture<Void> updateMetadata(@Nonnull FDBRecordContext context, @Nonnull String key, @Nullable byte[] metadata)
- Specified by:
updateMetadata
in classLocatableResolver
-
setWindow
public CompletableFuture<Void> setWindow(long count)
- Specified by:
setWindow
in classLocatableResolver
-
getStateSubspaceAsync
protected CompletableFuture<Subspace> getStateSubspaceAsync()
- Specified by:
getStateSubspaceAsync
in classLocatableResolver
-
getMappingSubspaceAsync
@Nonnull public CompletableFuture<Subspace> getMappingSubspaceAsync()
Description copied from class:LocatableResolver
Get aCompletableFuture
that will contain theSubspace
where this resolver stores the mappings fromkey
String
s tovalue
Long
. Direct access to this subspace is not needed by general users and extreme care should be taken when interacting with it.- Specified by:
getMappingSubspaceAsync
in classLocatableResolver
- Returns:
- a future that, when ready, will hold the mapping subspace
-
getBaseSubspaceAsync
@Nonnull public CompletableFuture<Subspace> getBaseSubspaceAsync()
Description copied from class:LocatableResolver
Get aCompletableFuture
that will contain theSubspace
this resolver is rooted at (e.g. the global resolverExtendedDirectoryLayer.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 (seeLocatableResolver.getMappingSubspaceAsync()
).- Specified by:
getBaseSubspaceAsync
in classLocatableResolver
- Returns:
- a future that, when ready, will hold the base subspace
-
deserializeValue
@Nonnull public ResolverResult deserializeValue(byte[] value)
Description copied from class:LocatableResolver
Deserialize the raw bytes value stored in the mapping subspace.- Specified by:
deserializeValue
in classLocatableResolver
- Parameters:
value
- raw value bytes.- Returns:
- the deserialized
ResolverResult
.
-
-