use of com.apple.foundationdb.record.provider.foundationdb.query.DualPlannerTest in project fdb-record-layer by FoundationDB.
the class FDBComparatorPlanTest method testTwoSameInnerPlansWithScannedRowLimit.
@DualPlannerTest
void testTwoSameInnerPlansWithScannedRowLimit() throws Throwable {
complexQuerySetup(NO_HOOK);
RecordQuery query1 = RecordQuery.newBuilder().setRecordType("MySimpleRecord").setFilter(Query.field("num_value_2").equalsValue(1)).build();
RecordQuery query2 = RecordQuery.newBuilder().setRecordType("MySimpleRecord").setFilter(Query.field("num_value_2").equalsValue(1)).build();
// This will select plan 1 for the first execution and later some illegal value. The idea is that after the
// first iteration, the continuation should determine the selected plan and not the relative priorities
RecordQueryPlan planUnderTest = RecordQueryComparatorPlan.from(plan(query1, query2), primaryKey(), 0, abortOnComparisonFailure);
// Iteration 1, start with empty continuation
RecordCursorResult<FDBQueriedRecord<Message>> result = assertSamePlansWithContinuation(planUnderTest, null, 0, 200, 17, 1, 68, false, RecordCursor.NoNextReason.SCAN_LIMIT_REACHED);
// Iteration 2, start with previous continuation, reach end (before limit)
byte[] continuation = result.getContinuation().toBytes();
assertSamePlansWithContinuation(planUnderTest, continuation, 0, 200, 16, 1, 66, false, RecordCursor.NoNextReason.SOURCE_EXHAUSTED);
}
Aggregations