Search in sources :

Example 1 with FS4ResourcePool

use of com.yahoo.prelude.fastsearch.FS4ResourcePool 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;
}
Also used : DispatchConfig(com.yahoo.vespa.config.search.DispatchConfig) QrSearchersConfig(com.yahoo.container.QrSearchersConfig) VipStatus(com.yahoo.container.handler.VipStatus) Fs4Config(com.yahoo.container.search.Fs4Config) Statistics(com.yahoo.statistics.Statistics) FS4ResourcePool(com.yahoo.prelude.fastsearch.FS4ResourcePool) DocumentdbInfoConfig(com.yahoo.prelude.fastsearch.DocumentdbInfoConfig) LegacyEmulationConfig(com.yahoo.container.search.LegacyEmulationConfig) ComponentId(com.yahoo.component.ComponentId) ClusterConfig(com.yahoo.search.config.ClusterConfig)

Example 2 with FS4ResourcePool

use of com.yahoo.prelude.fastsearch.FS4ResourcePool 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());
}
Also used : FS4ResourcePool(com.yahoo.prelude.fastsearch.FS4ResourcePool) Fs4Config(com.yahoo.container.search.Fs4Config) Before(org.junit.Before)

Aggregations

Fs4Config (com.yahoo.container.search.Fs4Config)2 FS4ResourcePool (com.yahoo.prelude.fastsearch.FS4ResourcePool)2 ComponentId (com.yahoo.component.ComponentId)1 QrSearchersConfig (com.yahoo.container.QrSearchersConfig)1 VipStatus (com.yahoo.container.handler.VipStatus)1 LegacyEmulationConfig (com.yahoo.container.search.LegacyEmulationConfig)1 DocumentdbInfoConfig (com.yahoo.prelude.fastsearch.DocumentdbInfoConfig)1 ClusterConfig (com.yahoo.search.config.ClusterConfig)1 Statistics (com.yahoo.statistics.Statistics)1 DispatchConfig (com.yahoo.vespa.config.search.DispatchConfig)1 Before (org.junit.Before)1