M
- generated Protobuf class for the record message typepublic static class FDBTypedRecordStore.Builder<M extends Message> extends Object implements FDBRecordStoreBase.BaseBuilder<M,FDBTypedRecordStore<M>>
FDBTypedRecordStore
.
This is only used when creating both the untyped and typed record stores at the same time.
To create a new typed record store from an open record store, use FDBRecordStoreBase.getTypedRecordStore(com.apple.foundationdb.record.provider.common.RecordSerializer<N>)
.FDBTypedRecordStore.newBuilder()
Modifier | Constructor and Description |
---|---|
protected |
Builder() |
protected |
Builder(FDBTypedRecordStore.Builder<M> other) |
protected |
Builder(FDBTypedRecordStore<M> store) |
Modifier and Type | Method and Description |
---|---|
FDBTypedRecordStore<M> |
build()
Build the record store.
|
FDBTypedRecordStore.Builder<M> |
copyBuilder()
Make a copy of this builder.
|
CompletableFuture<FDBTypedRecordStore<M>> |
createOrOpenAsync(FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
Opens a
FDBRecordStore instance in the given path with the given meta-data. |
FDBRecordContext |
getContext()
Get the record context (transaction) to use for the record store.
|
int |
getFormatVersion()
Get the storage format version for this store.
|
IndexMaintainerRegistry |
getIndexMaintainerRegistry()
Get the registry of index maintainers to be used by the record store.
|
IndexMaintenanceFilter |
getIndexMaintenanceFilter()
Get the
index filter to be used by the record store. |
RecordMetaDataProvider |
getMetaDataProvider()
Get the provider for the record store's meta-data.
|
FDBMetaDataStore |
getMetaDataStore()
Get the
FDBMetaDataStore to use as the source of meta-data. |
FDBRecordStoreBase.PipelineSizer |
getPipelineSizer()
Get the
object to be used to determine the depth of pipelines run by the record store. |
RecordSerializer<M> |
getSerializer()
Get the serializer used to convert records into byte arrays.
|
FDBRecordStoreStateCache |
getStoreStateCache()
Get the store state cache to be used by the record store.
|
SubspaceProvider |
getSubspaceProvider()
Get the subspace provider.
|
RecordSerializer<Message> |
getUntypedSerializer()
Get the serializer that will be used by the underlying record store for non-typed operations such as building indexes.
|
FDBRecordStoreBase.UserVersionChecker |
getUserVersionChecker()
Get the
function to be used to check the meta-data version of the record store. |
FDBTypedRecordStore.Builder<M> |
setContext(FDBRecordContext context)
Set the record context (transaction) to use for the record store.
|
FDBTypedRecordStore.Builder<M> |
setFormatVersion(int formatVersion)
Set the storage format version for this store.
|
FDBTypedRecordStore.Builder<M> |
setIndexMaintainerRegistry(IndexMaintainerRegistry indexMaintainerRegistry)
Set the registry of index maintainers to be used by the record store.
|
FDBTypedRecordStore.Builder<M> |
setIndexMaintenanceFilter(IndexMaintenanceFilter indexMaintenanceFilter)
Set the
index filter to be used by the record store. |
FDBTypedRecordStore.Builder<M> |
setKeySpacePath(KeySpacePath keySpacePath)
Set the key space path to use for the record store.
|
FDBTypedRecordStore.Builder<M> |
setMetaDataProvider(RecordMetaDataProvider metaDataProvider)
Set the provider for the record store's meta-data.
|
FDBTypedRecordStore.Builder<M> |
setMetaDataStore(FDBMetaDataStore metaDataStore)
Set the
FDBMetaDataStore to use as the source of meta-data. |
FDBTypedRecordStore.Builder<M> |
setPipelineSizer(FDBRecordStoreBase.PipelineSizer pipelineSizer)
Set the
object to be used to determine the depth of pipelines run by the record store. |
FDBTypedRecordStore.Builder<M> |
setSerializer(RecordSerializer<M> typedSerializer)
Set the serializer used to convert records into byte arrays.
|
FDBTypedRecordStore.Builder<M> |
setStoreStateCache(FDBRecordStoreStateCache storeStateCache)
Set the store state cache to be used by the record store.
|
FDBTypedRecordStore.Builder<M> |
setSubspace(Subspace subspace)
Set the subspace to use for the record store.
|
FDBTypedRecordStore.Builder<M> |
setSubspaceProvider(SubspaceProvider subspaceProvider)
Set the subspace provider from a subspace provider.
|
FDBTypedRecordStore.Builder<M> |
setUntypedSerializer(RecordSerializer<Message> serializer)
Get the serializer that will be used by the underlying record store for non-typed operations such as building indexes.
|
FDBTypedRecordStore.Builder<M> |
setUserVersionChecker(FDBRecordStoreBase.UserVersionChecker userVersionChecker)
Set the
function to be used to check the meta-data version of the record store. |
CompletableFuture<FDBTypedRecordStore<M>> |
uncheckedOpenAsync()
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, createAsync, createOrOpen, createOrOpen, createOrOpenAsync, open, openAsync, uncheckedOpen
protected Builder()
protected Builder(FDBTypedRecordStore.Builder<M> other)
protected Builder(FDBTypedRecordStore<M> store)
@Nullable public RecordSerializer<M> getSerializer()
FDBRecordStoreBase.BaseBuilder
getSerializer
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setSerializer(@Nullable RecordSerializer<M> typedSerializer)
FDBRecordStoreBase.BaseBuilder
setSerializer
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
typedSerializer
- the serializer to use@Nonnull public RecordSerializer<Message> getUntypedSerializer()
@Nonnull public FDBTypedRecordStore.Builder<M> setUntypedSerializer(@Nonnull RecordSerializer<Message> serializer)
serializer
- untyped serializerpublic int getFormatVersion()
FDBRecordStoreBase.BaseBuilder
getFormatVersion
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setFormatVersion(int formatVersion)
FDBRecordStoreBase.BaseBuilder
FDBRecordStoreBase.BaseBuilder.open()
will set the store's format version to max(max_supported_version, current_version)
.
This is to support cases where the target cannot be changed everywhere at once and some instances write the new version before others
know that they are licensed to do so. It is still critically important that all instances know how to handle
the new version before any instance allows it.
When installing a new version of the record layer library that includes a format change, first install everywhere having arranged for
FDBRecordStoreBase.BaseBuilder.setFormatVersion(int)
to be called with the old format version. Then, after that install is complete, change to the newer version.setFormatVersion
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
formatVersion
- the format version to use@Nullable public RecordMetaDataProvider getMetaDataProvider()
FDBRecordStoreBase.BaseBuilder
getMetaDataProvider
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setMetaDataProvider(@Nullable RecordMetaDataProvider metaDataProvider)
FDBRecordStoreBase.BaseBuilder
FDBRecordStoreBase.BaseBuilder.setMetaDataStore(com.apple.foundationdb.record.provider.foundationdb.FDBMetaDataStore)
is also called, the provider will only be used to initialize the meta-data store when it is empty. The record store will be built using the store as its provider.setMetaDataProvider
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
metaDataProvider
- the meta-data source to use@Nullable public FDBMetaDataStore getMetaDataStore()
FDBRecordStoreBase.BaseBuilder
FDBMetaDataStore
to use as the source of meta-data.getMetaDataStore
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setMetaDataStore(@Nullable FDBMetaDataStore metaDataStore)
FDBRecordStoreBase.BaseBuilder
FDBMetaDataStore
to use as the source of meta-data.
If FDBRecordStoreBase.BaseBuilder.setMetaDataProvider(com.apple.foundationdb.record.RecordMetaDataProvider)
is also called, it will be used to seed the store.setMetaDataStore
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
metaDataStore
- the meta-data store to use@Nullable public FDBRecordContext getContext()
FDBRecordStoreBase.BaseBuilder
getContext
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setContext(@Nullable FDBRecordContext context)
FDBRecordStoreBase.BaseBuilder
setContext
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
context
- the record context / transaction to use@Nullable public SubspaceProvider getSubspaceProvider()
FDBRecordStoreBase.BaseBuilder
getSubspaceProvider
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setSubspaceProvider(@Nullable SubspaceProvider subspaceProvider)
FDBRecordStoreBase.BaseBuilder
setSubspaceProvider
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
subspaceProvider
- the subspace provider@Nonnull public FDBTypedRecordStore.Builder<M> setSubspace(@Nullable Subspace subspace)
FDBRecordStoreBase.BaseBuilder
FDBRecordStoreBase.BaseBuilder.setKeySpacePath(com.apple.foundationdb.record.provider.foundationdb.keyspace.KeySpacePath)
rather than this because key space path provides more meaningful logs.setSubspace
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
subspace
- the subspace to use@Nonnull public FDBTypedRecordStore.Builder<M> setKeySpacePath(@Nullable KeySpacePath keySpacePath)
FDBRecordStoreBase.BaseBuilder
setKeySpacePath
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
keySpacePath
- the key space path to use@Nullable public FDBRecordStoreBase.UserVersionChecker getUserVersionChecker()
FDBRecordStoreBase.BaseBuilder
function
to be used to check the meta-data version of the record store.getUserVersionChecker
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setUserVersionChecker(@Nullable FDBRecordStoreBase.UserVersionChecker userVersionChecker)
FDBRecordStoreBase.BaseBuilder
function
to be used to check the meta-data version of the record store.setUserVersionChecker
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
userVersionChecker
- the checker function to use@Nonnull public IndexMaintainerRegistry getIndexMaintainerRegistry()
FDBRecordStoreBase.BaseBuilder
getIndexMaintainerRegistry
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setIndexMaintainerRegistry(@Nonnull IndexMaintainerRegistry indexMaintainerRegistry)
FDBRecordStoreBase.BaseBuilder
setIndexMaintainerRegistry
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
indexMaintainerRegistry
- the index registry to useFDBRecordStore.getIndexMaintainer(com.apple.foundationdb.record.metadata.Index)
,
RecordMetaDataBuilder.setIndexMaintainerRegistry(com.apple.foundationdb.record.provider.foundationdb.IndexMaintainerRegistry)
@Nonnull public IndexMaintenanceFilter getIndexMaintenanceFilter()
FDBRecordStoreBase.BaseBuilder
index filter
to be used by the record store.getIndexMaintenanceFilter
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setIndexMaintenanceFilter(@Nonnull IndexMaintenanceFilter indexMaintenanceFilter)
FDBRecordStoreBase.BaseBuilder
index filter
to be used by the record store.setIndexMaintenanceFilter
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
indexMaintenanceFilter
- the index filter to use@Nonnull public FDBRecordStoreBase.PipelineSizer getPipelineSizer()
FDBRecordStoreBase.BaseBuilder
object
to be used to determine the depth of pipelines run by the record store.getPipelineSizer
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> setPipelineSizer(@Nonnull FDBRecordStoreBase.PipelineSizer pipelineSizer)
FDBRecordStoreBase.BaseBuilder
object
to be used to determine the depth of pipelines run by the record store.setPipelineSizer
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
pipelineSizer
- the sizer to useFDBRecordStoreBase.getPipelineSize(com.apple.foundationdb.record.PipelineOperation)
@Nonnull public FDBRecordStoreStateCache getStoreStateCache()
FDBRecordStoreBase.BaseBuilder
null
, the produced
record store will use the default store state cache provided by the FDBDatabase
when initializing
the record store state.getStoreStateCache
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
null
if it uses the database default@Nonnull public FDBTypedRecordStore.Builder<M> setStoreStateCache(@Nonnull FDBRecordStoreStateCache storeStateCache)
FDBRecordStoreBase.BaseBuilder
null
is provided or if this method
is never called, the produced record store will use the default store state cache provided by the
FDBDatabase
.setStoreStateCache
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
storeStateCache
- the store state cache to used by this record store or null
to specify that this should use the database default@Nonnull public CompletableFuture<FDBTypedRecordStore<M>> uncheckedOpenAsync()
FDBRecordStoreBase.BaseBuilder
FDBRecordStore
instance without calling FDBRecordStore.checkVersion(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase.UserVersionChecker, com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase.StoreExistenceCheck)
.uncheckedOpenAsync
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public CompletableFuture<FDBTypedRecordStore<M>> createOrOpenAsync(@Nonnull FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
FDBRecordStoreBase.BaseBuilder
FDBRecordStore
instance in the given path with the given meta-data.createOrOpenAsync
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
existenceCheck
- whether the store must already exist@Nonnull public FDBTypedRecordStore<M> build()
FDBRecordStoreBase.BaseBuilder
build
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>
@Nonnull public FDBTypedRecordStore.Builder<M> copyBuilder()
FDBRecordStoreBase.BaseBuilder
builder = FDBRecordStore.newBuilder().setMetaDataProvider(metadata).setSubspace(subspace) store1 = builder.copyBuilder().setContext(context1).build() store2 = builder.copyBuilder().setContext(context2).build()
copyBuilder
in interface FDBRecordStoreBase.BaseBuilder<M extends Message,FDBTypedRecordStore<M extends Message>>