use of com.yahoo.container.search.LegacyEmulationConfig in project vespa by vespa-engine.
the class ClusterSearcherTestCase method createSearcher.
private static ClusterSearcher createSearcher(Double maxQueryTimeout, Double maxQueryCacheTimeout) {
ComponentId id = new ComponentId("test-id");
QrSearchersConfig qrsCfg = new QrSearchersConfig(new QrSearchersConfig.Builder().searchcluster(new QrSearchersConfig.Searchcluster.Builder().name("test-cluster")));
ClusterConfig.Builder clusterCfgBld = new ClusterConfig.Builder().clusterName("test-cluster");
if (maxQueryTimeout != null) {
clusterCfgBld.maxQueryTimeout(maxQueryTimeout);
}
if (maxQueryCacheTimeout != null) {
clusterCfgBld.maxQueryCacheTimeout(maxQueryCacheTimeout);
}
ClusterConfig clusterCfg = new ClusterConfig(clusterCfgBld);
DocumentdbInfoConfig documentDbCfg = new DocumentdbInfoConfig(new DocumentdbInfoConfig.Builder().documentdb(new DocumentdbInfoConfig.Documentdb.Builder().name("type1")));
LegacyEmulationConfig emulationCfg = new LegacyEmulationConfig(new LegacyEmulationConfig.Builder());
QrMonitorConfig monitorCfg = new QrMonitorConfig(new QrMonitorConfig.Builder());
Statistics statistics = Statistics.nullImplementation;
Fs4Config fs4Cfg = new Fs4Config(new Fs4Config.Builder());
FS4ResourcePool fs4ResourcePool = new FS4ResourcePool(fs4Cfg);
ClusterSearcher searcher = new ClusterSearcher(id, qrsCfg, clusterCfg, documentDbCfg, emulationCfg, monitorCfg, new DispatchConfig(new DispatchConfig.Builder()), createClusterInfoConfig(), statistics, fs4ResourcePool, new VipStatus());
return searcher;
}
use of com.yahoo.container.search.LegacyEmulationConfig in project vespa by vespa-engine.
the class SlimeSummaryTestCase method testDecodingEmptyWithoutForcedFill.
@Test
public void testDecodingEmptyWithoutForcedFill() {
String summary_cf = "file:src/test/java/com/yahoo/prelude/fastsearch/summary.cfg";
DocsumDefinitionSet set = createDocsumDefinitionSet(summary_cf, new LegacyEmulationConfig(new LegacyEmulationConfig.Builder().forceFillEmptyFields(false)));
byte[] docsum = makeEmptyDocsum();
FastHit hit = new FastHit();
assertNull(set.lazyDecode("default", docsum, hit));
assertThat(hit.getField("integer_field"), equalTo(null));
assertThat(hit.getField("short_field"), equalTo(null));
assertThat(hit.getField("byte_field"), equalTo(null));
assertThat(hit.getField("float_field"), equalTo(null));
assertThat(hit.getField("double_field"), equalTo(null));
assertThat(hit.getField("int64_field"), equalTo(null));
assertThat(hit.getField("string_field"), equalTo(null));
assertThat(hit.getField("data_field"), equalTo(null));
assertThat(hit.getField("data_field"), equalTo(null));
assertThat(hit.getField("longstring_field"), equalTo(null));
assertThat(hit.getField("longdata_field"), equalTo(null));
assertThat(hit.getField("longdata_field"), equalTo(null));
assertThat(hit.getField("xmlstring_field"), equalTo(null));
assertThat(hit.getField("xmlstring_field"), equalTo(null));
assertThat(hit.getField("jsonstring_field"), equalTo(null));
assertNull(hit.getField("tensor_field1"));
assertNull(hit.getField("tensor_field2"));
}
use of com.yahoo.container.search.LegacyEmulationConfig in project vespa by vespa-engine.
the class SlimeSummaryTestCase method testDecodingEmpty.
@Test
public void testDecodingEmpty() {
String summary_cf = "file:src/test/java/com/yahoo/prelude/fastsearch/summary.cfg";
LegacyEmulationConfig emul = new LegacyEmulationConfig(new LegacyEmulationConfig.Builder().forceFillEmptyFields(true));
DocsumDefinitionSet set = createDocsumDefinitionSet(summary_cf, emul);
byte[] docsum = makeEmptyDocsum();
FastHit hit = new FastHit();
assertNull(set.lazyDecode("default", docsum, hit));
assertThat(hit.getField("integer_field"), equalTo(NanNumber.NaN));
assertThat(hit.getField("short_field"), equalTo(NanNumber.NaN));
assertThat(hit.getField("byte_field"), equalTo(NanNumber.NaN));
assertThat(hit.getField("float_field"), equalTo(NanNumber.NaN));
assertThat(hit.getField("double_field"), equalTo(NanNumber.NaN));
assertThat(hit.getField("int64_field"), equalTo(NanNumber.NaN));
assertThat(hit.getField("string_field"), equalTo(""));
assertThat(hit.getField("data_field"), instanceOf(RawData.class));
assertThat(hit.getField("data_field").toString(), equalTo(""));
assertThat(hit.getField("longstring_field"), equalTo((Object) ""));
assertThat(hit.getField("longdata_field"), instanceOf(RawData.class));
assertThat(hit.getField("longdata_field").toString(), equalTo(""));
assertThat(hit.getField("xmlstring_field"), instanceOf(XMLString.class));
assertThat(hit.getField("xmlstring_field").toString(), equalTo(""));
// assertThat(hit.getField("jsonstring_field"), instanceOf(JSONString.class));
assertThat(hit.getField("jsonstring_field").toString(), equalTo(""));
// Empty tensors are represented by null because we don't have type information here to create the right empty tensor
assertNull(hit.getField("tensor_field1"));
assertNull(hit.getField("tensor_field2"));
}
Aggregations