public final class SolutionSetStream extends Stream implements ISolutionSet
Stream.CompressionEnum, Stream.StreamIndexMetadata
entryCount, error, ERROR_CLOSED, ERROR_ERROR_STATE, ERROR_READ_ONLY, metadata, open, rootAddr
Constructor and Description |
---|
SolutionSetStream(IRawStore store,
Checkpoint checkpoint,
IndexMetadata metadata,
boolean readOnly)
Required constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
static SolutionSetStream |
create(IRawStore store,
Stream.StreamIndexMetadata metadata)
Create a stream for an ordered solution set.
|
BaseIndexStats |
dumpPages(boolean recursive,
boolean visitLeaves)
Reports statistics for the index.
|
protected void |
flush()
Hook to flush anything which is dirty to the backing store.
|
ICloseableIterator<IBindingSet[]> |
get()
Return an
ICloseableIterator reading the solutions from the
stream. |
ISolutionSetStats |
getStats()
Return the
ISolutionSetStats for the saved solution set. |
long |
getStatsAddr()
Return the address of the
ISolutionSetStats to be written into the
next Checkpoint record. |
protected boolean |
needsCheckpoint()
Return true iff changes would be lost unless the
Stream is
flushed to the backing store using Stream.writeCheckpoint() . |
void |
put(ICloseableIterator<IBindingSet[]> src2)
Replace the contents of the stream with the solutions read from the
source.
|
ICloseableIterator<IBindingSet> |
scan()
Visit all entries in the index in the natural order of the index
(dereferencing visited tuples to the application objects stored within
those tuples).
|
protected void |
setCheckpoint(Checkpoint checkpoint)
Sets the
Stream.checkpoint and initializes the mutable fields from the
checkpoint record. |
void |
write(ICloseableIterator<?> src)
Write entries onto the stream.
|
assertNotReadOnly, assertNotTransient, close, fireDirtyEvent, getCheckpoint, getCounters, getDirtyListener, getIndexMetadata, getLastCommitTime, getMetadataAddr, getReadLockCount, getRecordVersion, getRootAddr, getStore, handleCommit, invalidate, isOpen, isReadOnly, load, rangeCount, readLock, recycle, removeAll, reopen, setDirtyListener, setLastCommitTime, wrapInputStream, wrapOutputStream, writeCheckpoint, writeCheckpoint2, writeLock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getCheckpoint, getDirtyListener, getIndexMetadata, getLastCommitTime, getMetadataAddr, getRecordVersion, getRootAddr, isOpen, reopen, setDirtyListener, setLastCommitTime, writeCheckpoint, writeCheckpoint2
handleCommit, invalidate
getCounters
getStore, rangeCount, removeAll
getReadLockCount, isReadOnly, readLock, writeLock
public SolutionSetStream(IRawStore store, Checkpoint checkpoint, IndexMetadata metadata, boolean readOnly)
Checkpoint
record.store
- The store.checkpoint
- The Checkpoint
record.metadata
- The metadata record.readOnly
- When true
the view will be immutable.Stream.create(IRawStore, StreamIndexMetadata)
,
Stream.load(IRawStore, long, boolean)
public static SolutionSetStream create(IRawStore store, Stream.StreamIndexMetadata metadata)
FIXME GIST : This is not setting the SolutionSetStream class when invoked
by Checkpoint.create(IRawStore, IndexMetadata)
since
Stream.create() is being invoked rather than SolutionSetStream.create().
public ISolutionSetStats getStats()
ISolutionSetStats
for the saved solution set.getStats
in interface ISolutionSet
ISolutionSetStats
.public long getStatsAddr()
ISolutionSetStats
to be written into the
next Checkpoint
record. The caller must have flush()
the
SolutionSetStream
as a pre-condition (to ensure that the stats
have been written out). If the ISolutionSetStats
are not loaded,
then the address from the last Checkpoint
record is returned.public ICloseableIterator<IBindingSet[]> get()
ISolutionSet
ICloseableIterator
reading the solutions from the
stream.get
in interface ISolutionSet
public void put(ICloseableIterator<IBindingSet[]> src2)
ISolutionSet
put
in interface ISolutionSet
src2
- The source.public ICloseableIterator<IBindingSet> scan()
ISimpleIndexAccess
scan
in interface ISolutionSet
scan
in interface ISimpleIndexAccess
scan
in class Stream
protected boolean needsCheckpoint()
Stream
Stream
is
flushed to the backing store using Stream.writeCheckpoint()
.needsCheckpoint
in class Stream
true
true iff changes would be lost unless the
Stream
was flushed to the backing store using
Stream.writeCheckpoint()
.protected void flush()
Stream
Stream._writeCheckpoint2()
.protected void setCheckpoint(Checkpoint checkpoint)
Stream.checkpoint
and initializes the mutable fields from the
checkpoint record. In order for this operation to be atomic, the caller
must be synchronized on the BTree
or otherwise guaranteed to have
exclusive access, e.g., during the ctor or when the BTree
is
mutable and access is therefore required to be single-threaded.
Extended to persist the ISolutionSetStats
.
setCheckpoint
in class Stream
public void write(ICloseableIterator<?> src)
Stream
public BaseIndexStats dumpPages(boolean recursive, boolean visitLeaves)
ICheckpointProtocol
dumpPages
in interface ICheckpointProtocol
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.