M
- type used to represent stored recordsR
- type of built record storepublic static interface FDBRecordStoreBase.BaseBuilder<M extends Message,R extends FDBRecordStoreBase<M>>
FDBRecordStoreBase
.Modifier and Type | Method and Description |
---|---|
R |
build()
Build the record store.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
copyBuilder()
Make a copy of this builder.
|
default R |
create()
Synchronous version of
createAsync() . |
default CompletableFuture<R> |
createAsync()
Opens a new
FDBRecordStore instance in the given path with the given meta-data. |
default R |
createOrOpen()
Synchronous version of
createOrOpenAsync() . |
default R |
createOrOpen(FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
Synchronous version of
createOrOpenAsync(FDBRecordStoreBase.StoreExistenceCheck) . |
default CompletableFuture<R> |
createOrOpenAsync()
Opens a
FDBRecordStore instance in the given path with the given meta-data. |
CompletableFuture<R> |
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.
|
FDBRecordStoreBase.UserVersionChecker |
getUserVersionChecker()
Get the
function to be used to check the meta-data version of the record store. |
default R |
open()
Synchronous version of
openAsync() . |
default CompletableFuture<R> |
openAsync()
Opens an existing
FDBRecordStore instance in the given path with the given meta-data. |
FDBRecordStoreBase.BaseBuilder<M,R> |
setContext(FDBRecordContext context)
Set the record context (transaction) to use for the record store.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setFormatVersion(int formatVersion)
Set the storage format version for this store.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setIndexMaintainerRegistry(IndexMaintainerRegistry indexMaintainerRegistry)
Set the registry of index maintainers to be used by the record store.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setIndexMaintenanceFilter(IndexMaintenanceFilter indexMaintenanceFilter)
Set the
index filter to be used by the record store. |
FDBRecordStoreBase.BaseBuilder<M,R> |
setKeySpacePath(KeySpacePath keySpacePath)
Set the key space path to use for the record store.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setMetaDataProvider(RecordMetaDataProvider metaDataProvider)
Set the provider for the record store's meta-data.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setMetaDataStore(FDBMetaDataStore metaDataStore)
Set the
FDBMetaDataStore to use as the source of meta-data. |
FDBRecordStoreBase.BaseBuilder<M,R> |
setPipelineSizer(FDBRecordStoreBase.PipelineSizer pipelineSizer)
Set the
object to be used to determine the depth of pipelines run by the record store. |
FDBRecordStoreBase.BaseBuilder<M,R> |
setSerializer(RecordSerializer<M> serializer)
Set the serializer used to convert records into byte arrays.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setStoreStateCache(FDBRecordStoreStateCache storeStateCache)
Set the store state cache to be used by the record store.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setSubspace(Subspace subspace)
Set the subspace to use for the record store.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setSubspaceProvider(SubspaceProvider subspaceProvider)
Set the subspace provider from a subspace provider.
|
FDBRecordStoreBase.BaseBuilder<M,R> |
setUserVersionChecker(FDBRecordStoreBase.UserVersionChecker userVersionChecker)
Set the
function to be used to check the meta-data version of the record store. |
default R |
uncheckedOpen()
Synchronous version of
uncheckedOpenAsync() . |
CompletableFuture<R> |
uncheckedOpenAsync()
|
@Nullable RecordSerializer<M> getSerializer()
@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setSerializer(@Nonnull RecordSerializer<M> serializer)
serializer
- the serializer to useint getFormatVersion()
@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setFormatVersion(int formatVersion)
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
setFormatVersion(int)
to be called with the old format version. Then, after that install is complete, change to the newer version.formatVersion
- the format version to use@Nullable RecordMetaDataProvider getMetaDataProvider()
@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setMetaDataProvider(@Nullable RecordMetaDataProvider metaDataProvider)
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.metaDataProvider
- the meta-data source to use@Nullable FDBMetaDataStore getMetaDataStore()
FDBMetaDataStore
to use as the source of meta-data.@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setMetaDataStore(@Nullable FDBMetaDataStore metaDataStore)
FDBMetaDataStore
to use as the source of meta-data.
If setMetaDataProvider(com.apple.foundationdb.record.RecordMetaDataProvider)
is also called, it will be used to seed the store.metaDataStore
- the meta-data store to use@Nullable FDBRecordContext getContext()
@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setContext(@Nullable FDBRecordContext context)
context
- the record context / transaction to use@Nullable SubspaceProvider getSubspaceProvider()
@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setSubspaceProvider(@Nullable SubspaceProvider subspaceProvider)
subspaceProvider
- the subspace provider@Nonnull @API(value=UNSTABLE) FDBRecordStoreBase.BaseBuilder<M,R> setSubspace(@Nullable Subspace subspace)
setKeySpacePath(com.apple.foundationdb.record.provider.foundationdb.keyspace.KeySpacePath)
rather than this because key space path provides more meaningful logs.subspace
- the subspace to use@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setKeySpacePath(@Nullable KeySpacePath keySpacePath)
keySpacePath
- the key space path to use@Nullable FDBRecordStoreBase.UserVersionChecker getUserVersionChecker()
function
to be used to check the meta-data version of the record store.@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setUserVersionChecker(@Nullable FDBRecordStoreBase.UserVersionChecker userVersionChecker)
function
to be used to check the meta-data version of the record store.userVersionChecker
- the checker function to use@Nonnull IndexMaintainerRegistry getIndexMaintainerRegistry()
@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setIndexMaintainerRegistry(@Nonnull IndexMaintainerRegistry indexMaintainerRegistry)
indexMaintainerRegistry
- the index registry to useFDBRecordStore.getIndexMaintainer(com.apple.foundationdb.record.metadata.Index)
,
RecordMetaDataBuilder.setIndexMaintainerRegistry(com.apple.foundationdb.record.provider.foundationdb.IndexMaintainerRegistry)
@Nonnull IndexMaintenanceFilter getIndexMaintenanceFilter()
index filter
to be used by the record store.@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setIndexMaintenanceFilter(@Nonnull IndexMaintenanceFilter indexMaintenanceFilter)
index filter
to be used by the record store.indexMaintenanceFilter
- the index filter to use@Nonnull FDBRecordStoreBase.PipelineSizer getPipelineSizer()
object
to be used to determine the depth of pipelines run by the record store.@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setPipelineSizer(@Nonnull FDBRecordStoreBase.PipelineSizer pipelineSizer)
object
to be used to determine the depth of pipelines run by the record store.pipelineSizer
- the sizer to useFDBRecordStoreBase.getPipelineSize(com.apple.foundationdb.record.PipelineOperation)
@API(value=EXPERIMENTAL) @Nullable FDBRecordStoreStateCache getStoreStateCache()
null
, the produced
record store will use the default store state cache provided by the FDBDatabase
when initializing
the record store state.null
if it uses the database default@API(value=EXPERIMENTAL) @Nonnull FDBRecordStoreBase.BaseBuilder<M,R> setStoreStateCache(@Nonnull FDBRecordStoreStateCache storeStateCache)
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
.storeStateCache
- the store state cache to used by this record store or null
to specify that this should use the database default@Nonnull FDBRecordStoreBase.BaseBuilder<M,R> copyBuilder()
builder = FDBRecordStore.newBuilder().setMetaDataProvider(metadata).setSubspace(subspace) store1 = builder.copyBuilder().setContext(context1).build() store2 = builder.copyBuilder().setContext(context2).build()
@Nonnull R build()
@Nonnull default R uncheckedOpen()
uncheckedOpenAsync()
.@Nonnull default R create()
createAsync()
.@Nonnull default R open()
openAsync()
.@Nonnull default R createOrOpen()
createOrOpenAsync()
.@Nonnull default R createOrOpen(@Nonnull FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
createOrOpenAsync(FDBRecordStoreBase.StoreExistenceCheck)
.existenceCheck
- whether the store must already exist@Nonnull CompletableFuture<R> uncheckedOpenAsync()
FDBRecordStore
instance without calling FDBRecordStore.checkVersion(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase.UserVersionChecker, com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase.StoreExistenceCheck)
.@Nonnull default CompletableFuture<R> createAsync()
FDBRecordStore
instance in the given path with the given meta-data.
The store must not have already been written to the specified subspace.@Nonnull default CompletableFuture<R> openAsync()
FDBRecordStore
instance in the given path with the given meta-data.
The store must have already been written to the specified subspace.@Nonnull default CompletableFuture<R> createOrOpenAsync()
FDBRecordStore
instance in the given path with the given meta-data.@Nonnull CompletableFuture<R> createOrOpenAsync(@Nonnull FDBRecordStoreBase.StoreExistenceCheck existenceCheck)
FDBRecordStore
instance in the given path with the given meta-data.existenceCheck
- whether the store must already exist