Enum FDBRecordStoreBase.StoreExistenceCheck
- java.lang.Object
-
- java.lang.Enum<FDBRecordStoreBase.StoreExistenceCheck>
-
- com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase.StoreExistenceCheck
-
- All Implemented Interfaces:
Serializable
,Comparable<FDBRecordStoreBase.StoreExistenceCheck>
- Enclosing interface:
- FDBRecordStoreBase<M extends Message>
public static enum FDBRecordStoreBase.StoreExistenceCheck extends Enum<FDBRecordStoreBase.StoreExistenceCheck>
Action to take if the record store does / does not already exist.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ERROR_IF_EXISTS
Throw if the record store already exists.ERROR_IF_NO_INFO_AND_HAS_RECORDS_OR_INDEXES
Throw if the record store does not have an info header but does have have at least one record.ERROR_IF_NO_INFO_AND_NOT_EMPTY
Throw if the record store does not have an info header but is not empty.ERROR_IF_NOT_EXISTS
Throw if the record store does not already exist.NONE
No special action.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FDBRecordStoreBase.StoreExistenceCheck
valueOf(String name)
Returns the enum constant of this type with the specified name.static FDBRecordStoreBase.StoreExistenceCheck[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final FDBRecordStoreBase.StoreExistenceCheck NONE
No special action. This should be used with care, since if the record store already has records, there is no guarantee that they were written at the current versions (meta-data and format). It is really only appropriate in development when switching fromuncheckedOpen
orbuild
to a checked open.
-
ERROR_IF_NO_INFO_AND_HAS_RECORDS_OR_INDEXES
public static final FDBRecordStoreBase.StoreExistenceCheck ERROR_IF_NO_INFO_AND_HAS_RECORDS_OR_INDEXES
Throw if the record store does not have an info header but does have have at least one record. This differs fromERROR_IF_NO_INFO_AND_NOT_EMPTY
in that there is data stored in the record store other than just the records and the indexes, including meta-data about which indexes have been built. A record store that is missing a header but has this other data is in a corrupt state, but as there are no records, it can be recovered when creating the store in a straightforward way.
-
ERROR_IF_NO_INFO_AND_NOT_EMPTY
public static final FDBRecordStoreBase.StoreExistenceCheck ERROR_IF_NO_INFO_AND_NOT_EMPTY
Throw if the record store does not have an info header but is not empty. Unlike withERROR_IF_NO_INFO_AND_HAS_RECORDS_OR_INDEXES
, this existence check will throw an error even if there are no records in the store, only data stored internally by the Record Layer. This corresponds toFDBRecordStoreBase.BaseBuilder.createOrOpen()
-
ERROR_IF_EXISTS
public static final FDBRecordStoreBase.StoreExistenceCheck ERROR_IF_EXISTS
Throw if the record store already exists. This corresponds toFDBRecordStoreBase.BaseBuilder.create()
- See Also:
RecordStoreAlreadyExistsException
-
ERROR_IF_NOT_EXISTS
public static final FDBRecordStoreBase.StoreExistenceCheck ERROR_IF_NOT_EXISTS
Throw if the record store does not already exist. This corresponds toFDBRecordStoreBase.BaseBuilder.open()
- See Also:
RecordStoreDoesNotExistException
-
-
Method Detail
-
values
public static FDBRecordStoreBase.StoreExistenceCheck[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FDBRecordStoreBase.StoreExistenceCheck c : FDBRecordStoreBase.StoreExistenceCheck.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FDBRecordStoreBase.StoreExistenceCheck valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-