use of com.yahoo.vespa.config.content.LoadTypeConfig in project vespa by vespa-engine.
the class VisitorSearcherTestCase method testNoClusterParamWhenSeveralClusters.
@Test(expected = IllegalArgumentException.class)
public void testNoClusterParamWhenSeveralClusters() throws Exception {
DocumentSessionFactory factory = new DocumentSessionFactory(docType);
ClusterListConfig.Storage.Builder storageCluster1 = new ClusterListConfig.Storage.Builder().configid("storage/cluster.foo").name("foo");
ClusterListConfig.Storage.Builder storageCluster2 = new ClusterListConfig.Storage.Builder().configid("storage/cluster.bar").name("bar");
ClusterListConfig clusterListCfg = new ClusterListConfig(new ClusterListConfig.Builder().storage(Arrays.asList(storageCluster1, storageCluster2)));
ClusterList clusterList = new ClusterList(clusterListCfg);
VisitSearcher searcher = new VisitSearcher(new FeedContext(new MessagePropertyProcessor(new FeederConfig(new FeederConfig.Builder().timeout(100).route("whatever").retryenabled(true)), new LoadTypeConfig(new LoadTypeConfig.Builder())), factory, docMan, clusterList, new NullFeedMetric()));
searcher.getVisitorParameters(newQuery("visit?visit.selection=id.user=1234"), null);
}
use of com.yahoo.vespa.config.content.LoadTypeConfig in project vespa by vespa-engine.
the class VespaFeedHandlerTestCase method testLoadTypes.
@Test
public void testLoadTypes() throws Exception {
List<LoadTypeConfig.Type.Builder> typeBuilder = new ArrayList<>();
typeBuilder.add(new LoadTypeConfig.Type.Builder().id(1234).name("foo").priority("VERY_LOW"));
typeBuilder.add(new LoadTypeConfig.Type.Builder().id(4567).name("bar").priority("NORMAL_3"));
setup(null, new LoadTypeConfig(new LoadTypeConfig.Builder().type(typeBuilder)), true, null);
{
Result res = testRequest(HttpRequest.createTestRequest("remove?id=doc:test:removeme&loadtype=foo", com.yahoo.jdisc.http.HttpRequest.Method.PUT));
assertEquals(1, res.messages.size());
Message m = res.messages.get(0);
assertEquals(DocumentProtocol.MESSAGE_REMOVEDOCUMENT, m.getType());
DocumentId d = ((RemoveDocumentMessage) m).getDocumentId();
assertEquals("doc:test:removeme", d.toString());
assertEquals(new LoadType(1234, "foo", DocumentProtocol.Priority.VERY_LOW), ((DocumentMessage) m).getLoadType());
assertEquals(DocumentProtocol.Priority.VERY_LOW, ((DocumentMessage) m).getPriority());
}
}
use of com.yahoo.vespa.config.content.LoadTypeConfig in project vespa by vespa-engine.
the class VisitorSearcherTestCase method create.
public VisitSearcher create() throws Exception {
ClusterListConfig.Storage.Builder storageCluster = new ClusterListConfig.Storage.Builder().configid("storage/cluster.foobar").name("foobar");
ClusterListConfig clusterListCfg = new ClusterListConfig(new ClusterListConfig.Builder().storage(storageCluster));
ClusterList clusterList = new ClusterList(clusterListCfg);
return new VisitSearcher(new FeedContext(new MessagePropertyProcessor(new FeederConfig(new FeederConfig.Builder().timeout(458).route("riksveg18").retryenabled(true)), new LoadTypeConfig(new LoadTypeConfig.Builder())), factory, docMan, clusterList, new NullFeedMetric()));
}
use of com.yahoo.vespa.config.content.LoadTypeConfig in project vespa by vespa-engine.
the class Arguments method parse.
void parse(String[] argList) throws HelpShownException {
List<String> args = new LinkedList<String>();
args.addAll(Arrays.asList(argList));
while (!args.isEmpty()) {
String arg = args.remove(0);
if (arg.equals("-h") || arg.equals("--help")) {
help();
throw new HelpShownException();
} else if ("--abortondataerror".equals(arg)) {
feederConfigBuilder.abortondocumenterror(getBoolean(getParam(args, arg)));
} else if ("--abortonsenderror".equals(arg)) {
feederConfigBuilder.abortonsenderror(getBoolean(getParam(args, arg)));
} else if ("--file".equals(arg)) {
files.add(getParam(args, arg));
} else if ("--maxpending".equals(arg)) {
feederConfigBuilder.maxpendingdocs(Integer.parseInt(getParam(args, arg)));
} else if ("--maxpendingsize".equals(arg)) {
feederConfigBuilder.maxpendingbytes(Integer.parseInt(getParam(args, arg)));
} else if ("--mode".equals(arg)) {
mode = getParam(args, arg);
} else if ("--noretry".equals(arg)) {
feederConfigBuilder.retryenabled(false);
} else if ("--retrydelay".equals(arg)) {
feederConfigBuilder.retrydelay(Integer.parseInt(getParam(args, arg)));
} else if ("--route".equals(arg)) {
feederConfigBuilder.route(getParam(args, arg));
} else if ("--timeout".equals(arg)) {
feederConfigBuilder.timeout(Double.parseDouble(getParam(args, arg)));
} else if ("--trace".equals(arg)) {
feederConfigBuilder.tracelevel(Integer.parseInt(getParam(args, arg)));
} else if ("--validate".equals(arg)) {
validateOnly = true;
} else if ("--dumpDocuments".equals(arg)) {
dumpDocumentsFile = getParam(args, arg);
} else if ("--maxfeedrate".equals(arg)) {
feederConfigBuilder.maxfeedrate(Double.parseDouble(getParam(args, arg)));
} else if ("--create-if-non-existent".equals(arg)) {
feederConfigBuilder.createifnonexistent(true);
} else if ("-v".equals(arg) || "--verbose".equals(arg)) {
verbose = true;
} else if ("--priority".equals(arg)) {
priority = getParam(args, arg);
} else {
files.add(arg);
}
}
propertyProcessor = new MessagePropertyProcessor(getFeederConfig(), new LoadTypeConfig(new LoadTypeConfig.Builder()));
}
Aggregations