Class MemoryStoreRevisions
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.memory.MemoryStoreRevisions
-
- All Implemented Interfaces:
Revisions
public class MemoryStoreRevisions extends Object implements Revisions
This is a simple in memoryRevisionsimplementation. It is non blocking and does not support anyRevisions.Options.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.segment.Revisions
Revisions.Option
-
-
Constructor Summary
Constructors Constructor Description MemoryStoreRevisions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(MemoryStore store)Bind this instance to astore.@NotNull RecordIdgetHead()Returns the record id of the head state.@NotNull RecordIdgetPersistedHead()Returns the persisted to disk record id of the head state.RecordIdsetHead(@NotNull Function<RecordId,RecordId> newHead, @NotNull Revisions.Option... options)Not supported: throwsUnsupportedOperationExceptionbooleansetHead(@NotNull RecordId expected, @NotNull RecordId head, @NotNull Revisions.Option... options)Atomically set the record id of the current head state to the givenheadstate if the current head state matches theexpectedvalue.
-
-
-
Method Detail
-
bind
public void bind(MemoryStore store) throws IOException
Bind this instance to astore.- Throws:
IOException
-
getHead
@NotNull public @NotNull RecordId getHead()
Description copied from interface:RevisionsReturns the record id of the head state. The returned id is a valid id for aSegmentNodeState.
-
getPersistedHead
@NotNull public @NotNull RecordId getPersistedHead()
Description copied from interface:RevisionsReturns the persisted to disk record id of the head state. The returned id is a valid id for aSegmentNodeState.- Specified by:
getPersistedHeadin interfaceRevisions- Returns:
- id of the head state
-
setHead
public boolean setHead(@NotNull @NotNull RecordId expected, @NotNull @NotNull RecordId head, @NotNull @NotNull Revisions.Option... options)Description copied from interface:RevisionsAtomically set the record id of the current head state to the givenheadstate if the current head state matches theexpectedvalue.All record ids must be valid ids for
SegmentNodeStates.The locking behaviour of this method regarding implementation specific.
-
setHead
public RecordId setHead(@NotNull @NotNull Function<RecordId,RecordId> newHead, @NotNull @NotNull Revisions.Option... options) throws InterruptedException
Not supported: throwsUnsupportedOperationException- Specified by:
setHeadin interfaceRevisions- Parameters:
newHead- function mapping an record id to the record id to which the current head id should be set.options- implementation specific options- Returns:
- the record id of the root node if the current head was successfully
updated,
nullotherwise. - Throws:
UnsupportedOperationException- alwaysInterruptedException- Blocking implementations may throw this exception whe interrupted.
-
-