use of com.yahoo.documentapi.VisitorParameters in project vespa by vespa-engine.
the class VisitorSearcherTestCase method testQueryParameters.
@Test
public void testQueryParameters() throws Exception {
VisitSearcher searcher = create();
VisitorParameters params = searcher.getVisitorParameters(newQuery("visit?visit.selection=id.user=1234&visit.cluster=foobar" + "&visit.dataHandler=othercluster&visit.fieldSet=[header]&visit.fromTimestamp=112&visit.toTimestamp=224" + "&visit.maxBucketsPerVisitor=2&visit.maxPendingMessagesPerVisitor=7&visit.maxPendingVisitors=14" + "&visit.ordering=ASCENDING&priority=NORMAL_1&tracelevel=7&visit.visitInconsistentBuckets&visit.visitRemoves"), null);
assertEquals("id.user=1234", params.getDocumentSelection());
assertEquals(7, params.getMaxPending());
assertEquals(2, params.getMaxBucketsPerVisitor());
assertEquals(14, ((StaticThrottlePolicy) params.getThrottlePolicy()).getMaxPendingCount());
assertEquals("[Storage:cluster=foobar;clusterconfigid=storage/cluster.foobar]", params.getRoute().toString());
assertEquals("othercluster", params.getRemoteDataHandler());
assertEquals("[header]", params.fieldSet());
assertEquals(112, params.getFromTimestamp());
assertEquals(224, params.getToTimestamp());
assertEquals(VisitorOrdering.ASCENDING, params.getVisitorOrdering());
assertEquals(DocumentProtocol.Priority.NORMAL_1, params.getPriority());
assertEquals(7, params.getTraceLevel());
assertEquals(true, params.visitInconsistentBuckets());
assertEquals(true, params.visitRemoves());
}
use of com.yahoo.documentapi.VisitorParameters in project vespa by vespa-engine.
the class OperationHandlerImplTest method visit_concurrency_is_1_by_default.
@Test
public void visit_concurrency_is_1_by_default() throws Exception {
VisitorParameters params = generatedParametersFromVisitOptions(emptyVisitOptions());
assertThat(params.getThrottlePolicy(), instanceOf(StaticThrottlePolicy.class));
assertThat(((StaticThrottlePolicy) params.getThrottlePolicy()).getMaxPendingCount(), is((int) 1));
}
use of com.yahoo.documentapi.VisitorParameters in project vespa by vespa-engine.
the class OperationHandlerImplTest method wanted_document_count_is_1_unless_specified.
@Test
public void wanted_document_count_is_1_unless_specified() throws Exception {
VisitorParameters params = generatedParametersFromVisitOptions(emptyVisitOptions());
assertThat(params.getMaxTotalHits(), is((long) 1));
}
use of com.yahoo.documentapi.VisitorParameters in project vespa by vespa-engine.
the class OperationHandlerImplTest method too_low_wanted_document_count_is_bounded_to_1.
@Test
public void too_low_wanted_document_count_is_bounded_to_1() throws Exception {
VisitorParameters params = generatedParametersFromVisitOptions(visitOptionsWithWantedDocumentCount(-1));
assertThat(params.getMaxTotalHits(), is((long) 1));
params = generatedParametersFromVisitOptions(visitOptionsWithWantedDocumentCount(Integer.MIN_VALUE));
assertThat(params.getMaxTotalHits(), is((long) 1));
params = generatedParametersFromVisitOptions(visitOptionsWithWantedDocumentCount(0));
assertThat(params.getMaxTotalHits(), is((long) 1));
}
use of com.yahoo.documentapi.VisitorParameters in project vespa by vespa-engine.
the class OperationHandlerImplTest method visit_concurrency_is_propagated_to_visitor_parameters.
@Test
public void visit_concurrency_is_propagated_to_visitor_parameters() throws Exception {
VisitorParameters params = generatedParametersFromVisitOptions(optionsBuilder().concurrency(3).build());
assertThat(params.getThrottlePolicy(), instanceOf(StaticThrottlePolicy.class));
assertThat(((StaticThrottlePolicy) params.getThrottlePolicy()).getMaxPendingCount(), is((int) 3));
}
Aggregations