public abstract class StreamingCacheIterator<T extends ReasonerTerm> extends Object implements StreamingIterator<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
protected int |
currentPage |
protected int |
nextCachedTermIndex |
protected T |
nextTerm |
protected int |
numPages |
protected List<Integer> |
pageAccessOrder |
protected StreamingTermStore<T> |
parentStore |
protected boolean |
readonly |
protected int[] |
shuffleMap |
protected boolean |
shufflePage |
protected ByteBuffer |
termBuffer |
protected List<T> |
termCache |
protected List<T> |
termPool |
protected ByteBuffer |
volatileBuffer |
Constructor and Description |
---|
StreamingCacheIterator(StreamingTermStore<T> parentStore,
boolean readonly,
List<T> termCache,
List<T> termPool,
ByteBuffer termBuffer,
ByteBuffer volatileBuffer,
boolean shufflePage,
int[] shuffleMap,
boolean randomizePageAccess,
int numPages) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
hasNext()
Get the next term.
|
T |
next() |
protected abstract void |
readPage(String termPagePath,
String volatilePagePath)
Read a page and fill the termCache using freed terms from the termPool.
|
void |
remove() |
protected abstract void |
writeVolatilePage(String volatilePagePath)
Write a cache page to disk.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected StreamingTermStore<T extends ReasonerTerm> parentStore
protected int[] shuffleMap
protected boolean readonly
protected List<T extends ReasonerTerm> termCache
protected List<T extends ReasonerTerm> termPool
protected ByteBuffer termBuffer
protected ByteBuffer volatileBuffer
protected int currentPage
protected int nextCachedTermIndex
protected T extends ReasonerTerm nextTerm
protected boolean shufflePage
protected boolean closed
protected int numPages
public StreamingCacheIterator(StreamingTermStore<T> parentStore, boolean readonly, List<T> termCache, List<T> termPool, ByteBuffer termBuffer, ByteBuffer volatileBuffer, boolean shufflePage, int[] shuffleMap, boolean randomizePageAccess, int numPages)
public boolean hasNext()
hasNext
in interface Iterator<T extends ReasonerTerm>
public T next()
next
in interface Iterator<T extends ReasonerTerm>
public void remove()
remove
in interface Iterator<T extends ReasonerTerm>
public void close()
close
in interface StreamingIterator<T extends ReasonerTerm>
protected abstract void readPage(String termPagePath, String volatilePagePath)
protected abstract void writeVolatilePage(String volatilePagePath)
Copyright © 2020 University of California, Santa Cruz. All rights reserved.