public abstract class DistinctFilter<E> extends Object implements IChunkConverter<E,E>
ISolution
s
generated by an IRule
. The filter is optimized if only a single
chunk is visited by the source iterator. Otherwise, the filter is implemented
using a BTree
backed by a TemporaryStore
.
When more than one chunk is processed, ISolution
s are transformed
into unsigned byte[] keys. The BTree
is tested for each such key. If
the key is NOT found, then it is inserted into the BTree
and the
solution is passed by the filter. Otherwise the solution is rejected by the
filter. The backing BTree
is closed when the filter is finalized, but
it will hold a hard reference to the TemporaryStore
until then.
Solutions are processed in chunks for efficient ordered reads and writes on
the BTree
.
Constructor and Description |
---|
DistinctFilter(IIndexManager indexManager)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
E[] |
convert(IChunkedOrderedIterator<E> src)
Deprecated.
Convert the next chunk of element(s) from the source iterator into target
element(s).
|
protected abstract byte[] |
getSortKey(E e)
Deprecated.
Return an unsigned byte[] key that is a representation of the visited
element.
|
public DistinctFilter(IIndexManager indexManager)
indexManager
- Used to lazily obtain a TemporaryStore
.public E[] convert(IChunkedOrderedIterator<E> src)
IChunkConverter
Note: This method will only be invoked if
ChunkedConvertingIterator.hasNext()
reports true
for the source iterator.
Note: Iterators are single-threaded so the implementation of this method does not need to be thread-safe.
convert
in interface IChunkConverter<E,E>
src
- The source iterator.protected abstract byte[] getSortKey(E e)
e
- The visited element.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.