use of com.yahoo.vdslib.VisitorStatistics in project vespa by vespa-engine.
the class MessageBusVisitorSessionTestCase method testVisitingCompletedFromSufficientFirstPassHits.
@Test
public void testVisitingCompletedFromSufficientFirstPassHits() {
VisitorParameters visitorParameters = createVisitorParameters("id.user==1234");
visitorParameters.setMaxFirstPassHits(10);
ReplyModifier replyModifier1 = (reply) -> {
VisitorStatistics stats = new VisitorStatistics();
stats.setBucketsVisited(1);
stats.setDocumentsReturned(9);
reply.setVisitorStatistics(stats);
reply.setLastBucket(new BucketId(33, 1234 | (1L << 32)));
};
ReplyModifier replyModifier2 = (reply) -> {
VisitorStatistics stats = new VisitorStatistics();
stats.setBucketsVisited(1);
stats.setDocumentsReturned(1);
reply.setVisitorStatistics(stats);
reply.setLastBucket(new BucketId(34, 1234 | (1L << 33)));
};
doTestEarlyCompletion(visitorParameters, replyModifier1, replyModifier2);
}
use of com.yahoo.vdslib.VisitorStatistics in project vespa by vespa-engine.
the class MessageBusVisitorSessionTestCase method testVisitingCompletedFromSecondPassHits.
@Test
public void testVisitingCompletedFromSecondPassHits() {
VisitorParameters visitorParameters = createVisitorParameters("id.user==1234");
visitorParameters.setMaxTotalHits(10);
ReplyModifier replyModifier1 = (reply) -> {
VisitorStatistics stats = new VisitorStatistics();
stats.setBucketsVisited(1);
stats.setDocumentsReturned(5);
stats.setSecondPassDocumentsReturned(4);
reply.setVisitorStatistics(stats);
reply.setLastBucket(new BucketId(33, 1234 | (1L << 32)));
};
ReplyModifier replyModifier2 = (reply) -> {
VisitorStatistics stats = new VisitorStatistics();
stats.setBucketsVisited(1);
stats.setSecondPassDocumentsReturned(1);
reply.setVisitorStatistics(stats);
reply.setLastBucket(new BucketId(34, 1234 | (1L << 33)));
};
doTestEarlyCompletion(visitorParameters, replyModifier1, replyModifier2);
}
Aggregations