keyTriple[i] = null;
}
}
if (useKey) {
// do distancepreserving jump over the gap!
final TripleKey key = tp.getKey(keyTriple,
order);
t = itt.next(key);
} else {
t = (considerLastTriple) ? this.lastTriple : itt
.next();
}
this.lastTriple = t;
if (t == null) {
return null;
}
} while ((tp.getBloomFilters()[0] != null && !tp
.getBloomFilters()[0]
.get((Math.abs(this.lastTriple.getPos(0)
.hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER)))
|| (tp.getBloomFilters()[1] != null && !tp
.getBloomFilters()[1]
.get((Math.abs(this.lastTriple.getPos(1)
.hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER)))
|| (tp.getBloomFilters()[2] != null && !tp
.getBloomFilters()[2]
.get((Math.abs(this.lastTriple.getPos(2)
.hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER))));
} else {
t = itt.next();
}
if (t != null) {
this.lastTriple = t;
final Bindings znext = tp.process(t, false);
if (znext != null) {
return znext;
}
}
}
return null;
}
private Bindings computeNext(final Bindings k) {
if (!(itt instanceof SIPParallelIterator)) {
return this.computeNext();
}
final TripleKey key = tp.getKey(k, order);
while (itt.hasNext()) {
// also consider inner joins in triple patterns like
// ?a ?a ?b.
// Furthermore, do distancepreserving jump over the gap
// using bloom filters!
if (tp.getBloomFilters() != null) {
for (int i = 0; i < 3; i++) {
if (tp.getBloomFilters()[i] != null
&& key.getTriple().getPos(i) != null) {
int index = (Math.abs(key.getTriple()
.getPos(i).hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER);
if (!tp.getBloomFilters()[i].get(index)) {
final int startIndex = index;
index++;
while ((index % tp.getBloomFilters()[i]
.size()) != startIndex
&& !tp.getBloomFilters()[i]
.get(index
% tp
.getBloomFilters()[i]
.size())) {
index++;
}
// all bits in the bloom filter are
// set
// to 0?
if (index
% tp.getBloomFilters()[i]
.size() == startIndex) {
return null;
}
// distancepreserving jump over the
// gap!
final int code = ((LazyLiteral) key
.getTriple().getPos(i))
.getCode()
+ (index - startIndex);
// if (code < LazyLiteral.maxID())
key.getTriple().setPos(i,
new LazyLiteral(code));
}
}
}
}