Package com.apple.foundationdb.record
Enum Class IndexState
- All Implemented Interfaces:
Serializable,Comparable<IndexState>,Constable
Different states an index might be in within a given store.
These states might differ between record stores that have
otherwise identical meta-data.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates that this store does not use this index.This is the default state for an index.Indicates that this unique index is fully "indexed", but some uniqueness violations still exist.Indicates the index should not be read from but is written to.Similar toWRITE_ONLY, but user updates are written to a write pending queue rather than directly into the index. -
Method Summary
Modifier and TypeMethodDescriptioncode()Value corresponding to the state.static IndexStatebooleanDetermine if an index in this state is disabled.booleanDetermine if an index in this state is readable.booleanDetermine if an index in this state is readable-unique-pending.booleanDetermine if an index in this state is scannable - i.e.booleanDetermine if an index in this state is write-only in any form (WRITE_ONLYorWRITE_ONLY_WITH_QUEUE).booleanDetermine if an index in this state is write-only (but not write-only-with-queue).booleanDetermine if an index in this state is write-only with a pending queue.static IndexStateReturns the enum constant of this class with the specified name.static IndexState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
READABLE
This is the default state for an index. It is safe to read this index and safe to use it for queries as the record store will maintain the index as new writes come in and the index has already been built. -
WRITE_ONLY
Indicates the index should not be read from but is written to. This is the state that an index should be in while it is being built but the build has not completed. Queries cannot use the index, but as records are added and removed, the index is updated. -
DISABLED
Indicates that this store does not use this index. The index cannot service reads or queries and it is not maintained by the record store. -
READABLE_UNIQUE_PENDING
Indicates that this unique index is fully "indexed", but some uniqueness violations still exist. This may happen when the online indexer finds some duplicating records. In this mode, it is safe to consider an index asREADABLEfor queries as long as uniqueness is not assumed. -
WRITE_ONLY_WITH_QUEUE
Similar toWRITE_ONLY, but user updates are written to a write pending queue rather than directly into the index. Queries cannot use the index in this state. This index state is designed to prevent conflicts between the online indexer and user io.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
code
Value corresponding to the state. When this state needs to be stored within a record store, this can be used as the code.- Returns:
- the code to serialize to serialize this state
-
getLogName
-
isReadable
public boolean isReadable()Determine if an index in this state is readable.- Returns:
trueif this state isREADABLEandfalseotherwise
-
isReadableUniquePending
public boolean isReadableUniquePending()Determine if an index in this state is readable-unique-pending. The readable-unique-pending index state may happen after a unique index is built, but duplications are found. The index will be maintained in this mode until the last duplication is resolved, then its state can be changed toREADABLE.- Returns:
trueif this state isREADABLE_UNIQUE_PENDINGandfalseotherwise
-
isScannable
public boolean isScannable()Determine if an index in this state is scannable - i.e. eitherisReadable()orisReadableUniquePending().- Returns:
trueif this state is scannable andfalseotherwise
-
isWriteOnlyNoQueue
public boolean isWriteOnlyNoQueue()Determine if an index in this state is write-only (but not write-only-with-queue).- Returns:
trueif this state isWRITE_ONLYandfalseotherwise
-
isWriteOnlyWithQueue
public boolean isWriteOnlyWithQueue()Determine if an index in this state is write-only with a pending queue.- Returns:
trueif this state isWRITE_ONLY_WITH_QUEUEandfalseotherwise
-
isWriteOnly
public boolean isWriteOnly()Determine if an index in this state is write-only in any form (WRITE_ONLYorWRITE_ONLY_WITH_QUEUE).- Returns:
trueif this state is write-only in any form andfalseotherwise
-
isDisabled
public boolean isDisabled()Determine if an index in this state is disabled.- Returns:
trueif this state isDISABLEDandfalseotherwise
-
fromCode
-