use of org.apache.hyracks.storage.am.common.CheckTuple in project asterixdb by apache.
the class LSMInvertedIndexTestContext method insertCheckTuples.
public void insertCheckTuples(ITupleReference tuple, Collection<CheckTuple> checkTuples) throws HyracksDataException {
documentCorpus.add(TupleUtils.copyTuple(tuple));
indexTupleIter.reset(tuple);
while (indexTupleIter.hasNext()) {
indexTupleIter.next();
ITupleReference insertTuple = indexTupleIter.getTuple();
CheckTuple checkTuple = createCheckTuple(insertTuple);
insertCheckTuple(checkTuple, checkTuples);
allTokens.add(checkTuple.getField(0));
}
}
use of org.apache.hyracks.storage.am.common.CheckTuple in project asterixdb by apache.
the class LSMInvertedIndexTestContext method deleteCheckTuples.
public void deleteCheckTuples(ITupleReference tuple, Collection<CheckTuple> checkTuples) throws HyracksDataException {
indexTupleIter.reset(tuple);
while (indexTupleIter.hasNext()) {
indexTupleIter.next();
ITupleReference insertTuple = indexTupleIter.getTuple();
CheckTuple checkTuple = createCheckTuple(insertTuple);
deleteCheckTuple(checkTuple, checkTuples);
}
}
use of org.apache.hyracks.storage.am.common.CheckTuple in project asterixdb by apache.
the class LSMInvertedIndexTestContext method createCheckTuple.
@SuppressWarnings("unchecked")
public CheckTuple createCheckTuple(ITupleReference tuple) throws HyracksDataException {
CheckTuple checkTuple = new CheckTuple(fieldSerdes.length, fieldSerdes.length);
for (int i = 0; i < fieldSerdes.length; i++) {
ByteArrayInputStream bains = new ByteArrayInputStream(tuple.getFieldData(i), tuple.getFieldStart(i), tuple.getFieldLength(i));
DataInput in = new DataInputStream(bains);
Comparable field = (Comparable) fieldSerdes[i].deserialize(in);
checkTuple.appendField(field);
}
return checkTuple;
}
Aggregations