use of com.yahoo.documentapi.VisitorParameters in project vespa by vespa-engine.
the class OperationHandlerImplTest method provided_wanted_document_count_is_propagated_to_visitor_parameters.
@Test
public void provided_wanted_document_count_is_propagated_to_visitor_parameters() throws Exception {
VisitorParameters params = generatedParametersFromVisitOptions(visitOptionsWithWantedDocumentCount(123));
assertThat(params.getMaxTotalHits(), is((long) 123));
}
use of com.yahoo.documentapi.VisitorParameters in project vespa by vespa-engine.
the class VdsVisit method verbosePrintParameters.
protected static void verbosePrintParameters(VdsVisitParameters vdsParams, PrintStream out) {
VisitorParameters params = vdsParams.getVisitorParameters();
if (params.getTimeoutMs() != -1) {
out.println("Time out visitor after " + params.getTimeoutMs() + " ms.");
}
if (params.getDocumentSelection() == null || params.getDocumentSelection().equals("")) {
out.println("Visiting all documents");
} else {
out.println("Visiting documents matching: " + params.getDocumentSelection());
}
out.println(String.format("Visiting bucket space: %s", params.getBucketSpace()));
if (params.getFromTimestamp() != 0 && params.getToTimestamp() != 0) {
out.println("Visiting in the inclusive timestamp range " + params.getFromTimestamp() + " - " + params.getToTimestamp() + ".");
} else if (params.getFromTimestamp() != 0) {
out.println("Visiting from and including timestamp " + params.getFromTimestamp() + ".");
} else if (params.getToTimestamp() != 0) {
out.println("Visiting to and including timestamp " + params.getToTimestamp() + ".");
}
out.println("Visiting field set " + params.fieldSet() + ".");
if (params.visitInconsistentBuckets()) {
out.println("Visiting inconsistent buckets.");
}
if (params.visitRemoves()) {
out.println("Including remove entries.");
}
if (params.getResumeFileName() != null && !"".equals(params.getResumeFileName())) {
out.println("Tracking progress in file: " + params.getResumeFileName());
}
if (vdsParams.isPrintIdsOnly()) {
out.println("Only showing document identifiers.");
}
out.println("Let visitor have maximum " + params.getMaxPending() + " replies pending on data handlers per storage node visitor.");
out.println("Visit maximum " + params.getMaxBucketsPerVisitor() + " buckets per visitor.");
if (params.getRemoteDataHandler() != null) {
out.println("Sending data to data handler at: " + params.getRemoteDataHandler());
}
if (params.getRoute() != null) {
out.println("Visiting cluster '" + params.getRoute() + "'.");
}
if (params.getVisitorLibrary() != null) {
out.println("Using visitor library '" + params.getVisitorLibrary() + "'.");
}
if (params.getLibraryParameters().size() > 0) {
out.println("Adding the following library specific parameters:");
for (Map.Entry<String, byte[]> entry : params.getLibraryParameters().entrySet()) {
out.println(" " + entry.getKey() + " = " + new String(entry.getValue(), Charset.forName("utf-8")));
}
}
if (params.getPriority() != DocumentProtocol.Priority.NORMAL_3) {
out.println("Visitor priority " + params.getPriority().name());
}
if (params.skipBucketsOnFatalErrors()) {
out.println("Skip visiting super buckets with fatal errors.");
}
}
Aggregations