Search in sources :

Example 16 with CheckTuple

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));
    }
}
Also used : CheckTuple(org.apache.hyracks.storage.am.common.CheckTuple) ITupleReference(org.apache.hyracks.dataflow.common.data.accessors.ITupleReference)

Example 17 with CheckTuple

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);
    }
}
Also used : CheckTuple(org.apache.hyracks.storage.am.common.CheckTuple) ITupleReference(org.apache.hyracks.dataflow.common.data.accessors.ITupleReference)

Example 18 with CheckTuple

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;
}
Also used : DataInput(java.io.DataInput) CheckTuple(org.apache.hyracks.storage.am.common.CheckTuple) ByteArrayInputStream(java.io.ByteArrayInputStream) DataInputStream(java.io.DataInputStream)

Aggregations

CheckTuple (org.apache.hyracks.storage.am.common.CheckTuple)18 ITupleReference (org.apache.hyracks.dataflow.common.data.accessors.ITupleReference)8 TreeSet (java.util.TreeSet)6 ArrayTupleBuilder (org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder)6 ArrayTupleReference (org.apache.hyracks.dataflow.common.comm.io.ArrayTupleReference)6 MultiComparator (org.apache.hyracks.storage.common.MultiComparator)4 ISerializerDeserializer (org.apache.hyracks.api.dataflow.value.ISerializerDeserializer)3 RangePredicate (org.apache.hyracks.storage.am.btree.impls.RangePredicate)3 IIndexCursor (org.apache.hyracks.storage.common.IIndexCursor)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 DataInput (java.io.DataInput)2 DataInputStream (java.io.DataInputStream)2 IInvertedIndex (org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex)2 IInvertedIndexAccessor (org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexAccessor)2 IBinaryComparatorFactory (org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory)1 GrowableArray (org.apache.hyracks.data.std.util.GrowableArray)1 PermutingTupleReference (org.apache.hyracks.storage.am.common.tuples.PermutingTupleReference)1 IInvertedListCursor (org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor)1 IToken (org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.IToken)1 IIndexBulkLoader (org.apache.hyracks.storage.common.IIndexBulkLoader)1