use of com.yahoo.vespa.model.content.TuningDispatch in project vespa by vespa-engine.
the class DomTuningDispatchBuilderTest method requireThatTuningDispatchPolicyRoundRobin.
@Test
public void requireThatTuningDispatchPolicyRoundRobin() throws Exception {
TuningDispatch dispatch = newTuningDispatch("<content>" + " <tuning>" + " <dispatch>" + " <dispatch-policy>round-robin</dispatch-policy>" + " </dispatch>" + " </tuning>" + "</content>");
assertTrue(TuningDispatch.DispatchPolicy.ROUNDROBIN == dispatch.getDispatchPolicy());
}
use of com.yahoo.vespa.model.content.TuningDispatch in project vespa by vespa-engine.
the class DomTuningDispatchBuilderTest method requireThatTuningDispatchPolicyRandom.
@Test
public void requireThatTuningDispatchPolicyRandom() throws Exception {
TuningDispatch dispatch = newTuningDispatch("<content>" + " <tuning>" + " <dispatch>" + " <dispatch-policy>random</dispatch-policy>" + " </dispatch>" + " </tuning>" + "</content>");
assertTrue(TuningDispatch.DispatchPolicy.RANDOM == dispatch.getDispatchPolicy());
}
use of com.yahoo.vespa.model.content.TuningDispatch in project vespa by vespa-engine.
the class DomTuningDispatchBuilder method build.
public static TuningDispatch build(ModelElement contentXml) {
TuningDispatch.Builder builder = new TuningDispatch.Builder();
ModelElement tuningElement = contentXml.getChild("tuning");
if (tuningElement == null) {
return builder.build();
}
ModelElement dispatchElement = tuningElement.getChild("dispatch");
if (dispatchElement == null) {
return builder.build();
}
builder.setMaxHitsPerPartition(dispatchElement.childAsInteger("max-hits-per-partition"));
builder.setDispatchPolicy(dispatchElement.childAsString("dispatch-policy"));
builder.setUseLocalNode(dispatchElement.childAsBoolean("use-local-node"));
builder.setMinGroupCoverage(dispatchElement.childAsDouble("min-group-coverage"));
builder.setMinActiveDocsCoverage(dispatchElement.childAsDouble("min-active-docs-coverage"));
return builder.build();
}
use of com.yahoo.vespa.model.content.TuningDispatch in project vespa by vespa-engine.
the class DomTuningDispatchBuilderTest method requireThatEmptydispatchIsSafe.
@Test
public void requireThatEmptydispatchIsSafe() throws Exception {
TuningDispatch dispatch = newTuningDispatch("<content>" + " <tuning>" + " <dispatch/>" + " </tuning>" + "</content>");
assertNull(dispatch.getMaxHitsPerPartition());
assertNull(dispatch.getMinGroupCoverage());
assertNull(dispatch.getMinActiveDocsCoverage());
assertTrue(TuningDispatch.DispatchPolicy.ROUNDROBIN == dispatch.getDispatchPolicy());
}
use of com.yahoo.vespa.model.content.TuningDispatch in project vespa by vespa-engine.
the class DomTuningDispatchBuilderTest method requireThatDefaultsAreNull.
@Test
public void requireThatDefaultsAreNull() throws Exception {
TuningDispatch dispatch = newTuningDispatch("<content/>");
assertNull(dispatch.getMaxHitsPerPartition());
}
Aggregations