use of com.yahoo.container.search.Fs4Config in project vespa by vespa-engine.
the class FastSearcherTestCase method testPing.
@Test
public void testPing() throws IOException, InterruptedException {
Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL);
BackendTestCase.MockServer server = new BackendTestCase.MockServer();
FS4ResourcePool listeners = new FS4ResourcePool(new Fs4Config(new Fs4Config.Builder()));
Backend backend = listeners.getBackend(server.host.getHostString(), server.host.getPort());
FastSearcher fastSearcher = new FastSearcher(backend, new FS4ResourcePool(1), new MockDispatcher(Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), new CacheParams(0, 0.0d), documentdbInfoConfig);
server.dispatch.packetData = BackendTestCase.PONG;
server.dispatch.setNoChannel();
Chain<Searcher> chain = new Chain<>(fastSearcher);
Execution e = new Execution(chain, Execution.Context.createContextStub());
Pong pong = e.ping(new Ping());
assertTrue(pong.getPongPacket().isPresent());
assertEquals(127, pong.getPongPacket().get().getDocstamp());
backend.shutdown();
server.dispatch.socket.close();
server.dispatch.connection.close();
server.worker.join();
pong.setPingInfo("blbl");
assertEquals("Result of pinging using blbl", pong.toString());
}
use of com.yahoo.container.search.Fs4Config 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.Fs4Config in project vespa by vespa-engine.
the class BackendTestCase method setUp.
@Before
public void setUp() throws Exception {
logger = Logger.getLogger(Backend.class.getName());
initUseParent = logger.getUseParentHandlers();
logger.setUseParentHandlers(false);
listeners = new FS4ResourcePool(new Fs4Config(new Fs4Config.Builder()));
server = new MockServer();
backend = listeners.getBackend(server.host.getHostString(), server.host.getPort());
}
Aggregations