Revisions.Option| Modifier and Type | Field and Description |
|---|---|
static String |
JOURNAL_FILE_NAME |
| Constructor and Description |
|---|
ReadOnlyRevisions(File directory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying journal file.
|
RecordId |
getHead()
Returns the record id of the head state.
|
boolean |
setHead(com.google.common.base.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(RecordId expected,
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 static final String JOURNAL_FILE_NAME
public ReadOnlyRevisions(@Nonnull File directory) throws IOException
IOException@Nonnull public RecordId getHead()
RevisionsSegmentNodeState.public boolean setHead(@Nonnull RecordId expected, @Nonnull RecordId head, @Nonnull Revisions.Option... options)
Revisionshead state if the current head state matches
the expected value.
All record ids must be valid ids for SegmentNodeStates.
The locking behaviour of this method regarding implementation specific.
public boolean setHead(@Nonnull com.google.common.base.Function<RecordId,RecordId> newHead, @Nonnull Revisions.Option... options) throws InterruptedException
RevisionsnewHead function when called with the record
id of the current head.
All record ids must be valid ids for SegmentNodeStates.
The behaviour of this method regarding locking and handling
null values returned by newHead is implementation specific.
setHead in interface RevisionsnewHead - function mapping an record id to the record id to which
the current head id should be set.options - implementation specific optionstrue if the current head was successfully
updated, false otherwise.InterruptedException - Blocking implementations may throw this exception whe
interrupted.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.