@API(value=INTERNAL) public class MutableRecordStoreState extends RecordStoreState
beginWrite()
and endWrite()
and will conflict with
beginRead()
... endRead()
.EMPTY, indexStateMap, storeHeader
Constructor and Description |
---|
MutableRecordStoreState(Map<String,IndexState> indexStateMap)
Deprecated.
|
MutableRecordStoreState(RecordMetaDataProto.DataStoreInfo storeHeader,
Map<String,IndexState> indexStateMap) |
Modifier and Type | Method and Description |
---|---|
void |
beginRead()
Begin using this record store state.
|
void |
beginWrite()
Begin modifying this record store state.
|
void |
endRead()
End using this record store state.
|
void |
endWrite()
End modifying this record store state.
|
boolean |
equals(Object o)
Checks if this
RecordStoreState specifies identical state
as the given object. |
int |
hashCode()
Creates a valid hash code of this state based on the hashes of its members.
|
IndexState |
setState(String indexName,
IndexState state)
Modify the state of an index in this map.
|
RecordMetaDataProto.DataStoreInfo |
setStoreHeader(RecordMetaDataProto.DataStoreInfo storeHeader)
Update the store header in this record store state.
|
RecordStoreState |
toImmutable()
Create an immutable version of this
RecordStoreState . |
MutableRecordStoreState |
withWriteOnlyIndexes(List<String> writeOnlyIndexNames)
Create a new version of this
RecordStoreState , but with additional IndexState.WRITE_ONLY indexes. |
allIndexesReadable, compatibleWith, getDisabledIndexNames, getIndexStates, getState, getState, getStoreHeader, getWriteOnlyIndexNames, isDisabled, isDisabled, isReadable, isReadable, isWriteOnly, isWriteOnly, toMutable, toString, withIndexesInState, writeOnlyMap
public MutableRecordStoreState(@Nullable RecordMetaDataProto.DataStoreInfo storeHeader, @Nullable Map<String,IndexState> indexStateMap)
@Deprecated public MutableRecordStoreState(@Nullable Map<String,IndexState> indexStateMap)
public void beginRead()
endRead()
is called, the state will not change.beginRead
in class RecordStoreState
public void endRead()
endRead
in class RecordStoreState
beginRead()
public void beginWrite()
endWrite()
is called, the state will not change.public void endWrite()
beginWrite()
@Nonnull public IndexState setState(@Nonnull String indexName, @Nonnull IndexState state)
indexName
- the index namestate
- the new state for the given index@Nonnull public MutableRecordStoreState withWriteOnlyIndexes(@Nonnull List<String> writeOnlyIndexNames)
RecordStoreState
RecordStoreState
, but with additional IndexState.WRITE_ONLY
indexes.withWriteOnlyIndexes
in class RecordStoreState
writeOnlyIndexNames
- the indexes to be marked as WRITE_ONLY. If the index is already DISABLED, it will
stay disabled, but will otherwise be set to WRITE_ONLY.@Nonnull public RecordMetaDataProto.DataStoreInfo setStoreHeader(@Nonnull RecordMetaDataProto.DataStoreInfo storeHeader)
storeHeader
- the updated store headerpublic boolean equals(Object o)
RecordStoreState
RecordStoreState
specifies identical state
as the given object.equals
in class RecordStoreState
o
- the object to check for equalitytrue
if the passed object is a RecordStoreState
instance and if the other state matches this RecordStoreState
and false
otherwisepublic int hashCode()
RecordStoreState
hashCode
in class RecordStoreState
@Nonnull public RecordStoreState toImmutable()
RecordStoreState
RecordStoreState
. If the state object is already immutable,
this will return this
. This version of the record store state is safe to cache as none of
its members can be mutated.toImmutable
in class RecordStoreState
RecordStoreState