public interface ICheckpointProtocol extends ICommitter, ICounterSetAccess, ISimpleIndexAccess, IReadWriteLockManager
Checkpoint
record protocol.ILocalBTreeView
implementations
that do not implement ICheckpointProtocol
(FusedView
,
ReadCommittedView
).Modifier and Type | Method and Description |
---|---|
void |
close()
The contract for
close() is to reduce the resource burden of the
index while not rendering the index inoperative. |
BaseIndexStats |
dumpPages(boolean recursive,
boolean visitLeaves)
Reports statistics for the index.
|
ICheckpoint |
getCheckpoint()
Returns the most recent
ICheckpoint record. |
IDirtyListener |
getDirtyListener()
Return the
IDirtyListener . |
IndexMetadata |
getIndexMetadata()
The metadata for the index.
|
long |
getLastCommitTime()
The timestamp associated with the last
IAtomicStore.commit() in
which writes buffered by this index were made restart-safe on the backing
store. |
long |
getMetadataAddr()
The address at which the most recent
IndexMetadata record was
written. |
long |
getRecordVersion()
The value of the record version number that will be assigned to the next
node or leaf written onto the backing store.
|
long |
getRootAddr()
The address of the last written root of the persistent data structure
-or-
0L if there is no root. |
boolean |
isOpen()
An "open" index has may have some buffered data.
|
void |
reopen()
(Re-) open the index.
|
void |
setDirtyListener(IDirtyListener listener)
Set or clear the listener (there can be only one).
|
void |
setLastCommitTime(long lastCommitTime)
Sets the lastCommitTime.
|
long |
writeCheckpoint()
Checkpoint operation must
#flush() dirty nodes, dirty persistent
data structures, etc, write a new Checkpoint record on the
backing store, save a reference to the current Checkpoint , and
return the address of that Checkpoint record. |
Checkpoint |
writeCheckpoint2()
Checkpoint operation must
#flush() dirty nodes, dirty persistent
data structures, etc, write a new Checkpoint record on the
backing store, save a reference to the current Checkpoint , and
return the address of that Checkpoint record. |
handleCommit, invalidate
getCounters
getStore, rangeCount, removeAll, scan
getReadLockCount, isReadOnly, readLock, writeLock
long getRecordVersion()
ICheckpoint getCheckpoint()
ICheckpoint
record.ICheckpoint
record and never
null
.long getMetadataAddr()
IndexMetadata
record was
written.long getRootAddr()
0L
if there is no root. A 0L
return may be
an indication that an empty data structure will be created on demand.void setLastCommitTime(long lastCommitTime)
Note: The lastCommitTime is set by a combination of the
AbstractJournal
and Name2Addr
based on the actual
commitTime of the commit during which an Name2Addr.Entry
for that index was
last committed. It is set for both historical index reads and unisolated
index reads using Name2Addr.Entry.commitTime
. The lastCommitTime for an
unisolated index will advance as commits are performed with that index.
lastCommitTime
- The timestamp of the last committed state of this index.IllegalArgumentException
- if lastCommitTime is ZERO (0).IllegalStateException
- if the timestamp is less than the previous value (it is
permitted to advance but not to go backwards).long getLastCommitTime()
IAtomicStore.commit()
in
which writes buffered by this index were made restart-safe on the backing
store. The lastCommitTime is set when the index is loaded from the
backing store and updated after each commit. It is ZERO (0L) when an
index is first created and will remain ZERO (0L) until the index is
committed. If the backing store does not support atomic commits, then
this value will always be ZERO (0L).long writeCheckpoint()
#flush()
dirty nodes, dirty persistent
data structures, etc, write a new Checkpoint
record on the
backing store, save a reference to the current Checkpoint
, and
return the address of that Checkpoint
record.
Note: A checkpoint by itself is NOT an atomic commit. The commit protocol
is at the store level and uses Checkpoint
s to ensure that the
state of the persistence capable data structure is current on the backing
store.
Checkpoint
record for the
persistence capable was written onto the store. The data
structure can be reloaded from this Checkpoint
record.Checkpoint writeCheckpoint2()
#flush()
dirty nodes, dirty persistent
data structures, etc, write a new Checkpoint
record on the
backing store, save a reference to the current Checkpoint
, and
return the address of that Checkpoint
record.
Note: A checkpoint by itself is NOT an atomic commit. The commit protocol
is at the store level and uses Checkpoint
s to ensure that the
state of the persistence capable data structure is current on the backing
store.
Checkpoint
record for the persistent data structure
which was written onto the store. The persistent data structure
can be reloaded from this Checkpoint
record.IDirtyListener getDirtyListener()
IDirtyListener
.void setDirtyListener(IDirtyListener listener)
listener
- The listener.IndexMetadata getIndexMetadata()
Note: The same method is also declared by IIndex
in order to
provide access to the IndexMetadata
for remote clients in
scale-out.
IIndex.getIndexMetadata()
void reopen()
void close()
close()
is to reduce the resource burden of the
index while not rendering the index inoperative. An index that has been
closed
MAY be reopened
at any time
(conditional on the continued availability of the backing store). Such an
index reference remains valid after a close()
. A closed index is
transparently reopened
by any access to the index data
(scanning the index, probing the index, etc).
Note: A close()
on a dirty index MUST discard writes rather than
flushing them to the store and MUST NOT update its Checkpoint
record - (close()
is used to discard indices with partial writes
when an AbstractTask
fails). If you are seeking to
close()
a mutable index view that state can be recovered by
reopen()
then you MUST write a new Checkpoint
record
before closing the index.
boolean isOpen()
BaseIndexStats dumpPages(boolean recursive, boolean visitLeaves)
recursive
- When true
, also collects statistics on the pages
(nodes and leaves) using a low-level approach.visitLeaves
- When true
and recursive:=true
then the
leaves of the index are also visited.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.