use of org.apache.hyracks.storage.common.ISearchOperationCallback in project asterixdb by apache.
the class ExternalBTreeSearchOperatorNodePushable method open.
// We override the open function to search a specific version of the index
@Override
public void open() throws HyracksDataException {
writer.open();
accessor = new FrameTupleAccessor(inputRecDesc);
indexHelper.open();
index = indexHelper.getIndexInstance();
if (retainMissing) {
int fieldCount = getFieldCount();
nonMatchTupleBuild = new ArrayTupleBuilder(fieldCount);
DataOutput out = nonMatchTupleBuild.getDataOutput();
for (int i = 0; i < fieldCount; i++) {
try {
nonMatchWriter.writeMissing(out);
} catch (IOException e) {
e.printStackTrace();
}
nonMatchTupleBuild.addFieldEndOffset();
}
} else {
nonMatchTupleBuild = null;
}
ExternalBTreeWithBuddy externalIndex = (ExternalBTreeWithBuddy) index;
try {
searchPred = createSearchPredicate();
tb = new ArrayTupleBuilder(recordDesc.getFieldCount());
dos = tb.getDataOutput();
appender = new FrameTupleAppender(new VSizeFrame(ctx));
ISearchOperationCallback searchCallback = searchCallbackFactory.createSearchOperationCallback(indexHelper.getResource().getId(), ctx, null);
// The next line is the reason we override this method
indexAccessor = externalIndex.createAccessor(searchCallback, version);
cursor = createCursor();
if (retainInput) {
frameTuple = new FrameTupleReference();
}
} catch (Throwable th) {
throw new HyracksDataException(th);
}
}
Aggregations