public class JVMDistinctFilter extends Object implements IDistinctFilter
IBindingSet
. This
class is thread-safe. It is based on a ConcurrentHashMap
.Constructor and Description |
---|
JVMDistinctFilter(IVariable<?>[] vars,
int initialCapacity,
float loadFactor,
int concurrencyLevel) |
Modifier and Type | Method and Description |
---|---|
IBindingSet |
accept(IBindingSet bset)
If the bindings are distinct for the configured variables then return a
new
IBindingSet consisting of only the selected variables. |
long |
filterSolutions(ICloseableIterator<IBindingSet[]> itr,
BOpStats stats,
IBuffer<IBindingSet> sink)
Vectored DISTINCT.
|
IVariable<?>[] |
getProjectedVars()
The variables that are being projected out of the DISTINCT filter.
|
void |
release()
Discard the map backing this filter.
|
public JVMDistinctFilter(IVariable<?>[] vars, int initialCapacity, float loadFactor, int concurrencyLevel)
vars
- The set of variables on which the DISTINCT filter will be
imposed. Only these variables will be present in the
"accepted" solutions. Any variable bindings not specified in
this array will be dropped.initialCapacity
- loadFactor
- concurrencyLevel
- public void release()
IDistinctFilter
release
in interface IDistinctFilter
public IVariable<?>[] getProjectedVars()
IDistinctFilter
getProjectedVars
in interface IDistinctFilter
public IBindingSet accept(IBindingSet bset)
IDistinctFilter
IBindingSet
consisting of only the selected variables.accept
in interface IDistinctFilter
bset
- The binding set to be filtered.IBindingSet
containing only the distinct as bound
values -or- null
if the binding set duplicates a
solution which was already accepted.public long filterSolutions(ICloseableIterator<IBindingSet[]> itr, BOpStats stats, IBuffer<IBindingSet> sink)
IDistinctFilter
filterSolutions
in interface IDistinctFilter
itr
- The source solutions.stats
- Statistics object to be updated.sink
- The sink onto which the DISTINCT solutions will be written.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.