Revisions.Option
Constructor and Description |
---|
ReadOnlyRevisions(@NotNull SegmentNodeStorePersistence persistence) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
@NotNull RecordId |
getHead()
Returns the record id of the head state.
|
@NotNull RecordId |
getPersistedHead()
Returns the persisted to disk record id of the head state.
|
RecordId |
setHead(@NotNull Function<RecordId,RecordId> newHead,
Revisions.Option... options)
Atomically set the record id of the current head state to the value
returned from the
newHead function when called with the record
id of the current head. |
boolean |
setHead(@NotNull RecordId expected,
@NotNull RecordId head,
Revisions.Option... options)
Atomically set the record id of the current head state to the
given
head state if the current head state matches
the expected value. |
public ReadOnlyRevisions(@NotNull @NotNull SegmentNodeStorePersistence persistence)
@NotNull public @NotNull RecordId getHead()
Revisions
SegmentNodeState
.@NotNull public @NotNull RecordId getPersistedHead()
Revisions
SegmentNodeState
.getPersistedHead
in interface Revisions
public boolean setHead(@NotNull @NotNull RecordId expected, @NotNull @NotNull RecordId head, @NotNull Revisions.Option... options)
Revisions
head
state if the current head state matches
the expected
value.
All record ids must be valid ids for SegmentNodeState
s.
The locking behaviour of this method regarding implementation specific.
public RecordId setHead(@NotNull @NotNull Function<RecordId,RecordId> newHead, @NotNull Revisions.Option... options) throws InterruptedException
Revisions
newHead
function when called with the record
id of the current head.
All record ids must be valid ids for SegmentNodeState
s.
The behaviour of this method regarding locking and handling
null
values returned by newHead
is implementation specific.
setHead
in interface Revisions
newHead
- function mapping an record id to the record id to which
the current head id should be set.options
- implementation specific optionsnull
otherwise.InterruptedException
- Blocking implementations may throw this exception whe
interrupted.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.