Search in sources :

Example 1 with StorServerConfig

use of com.yahoo.vespa.config.content.core.StorServerConfig in project vespa by vespa-engine.

the class DistributorTest method testBasics.

@Test
public void testBasics() {
    StorServerConfig.Builder builder = new StorServerConfig.Builder();
    parse("<content id=\"foofighters\"><documents/>\n" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</content>\n").getConfig(builder);
    StorServerConfig config = new StorServerConfig(builder);
    assertEquals(true, config.is_distributor());
    assertEquals("foofighters", config.cluster_name());
}
Also used : StorServerConfig(com.yahoo.vespa.config.content.core.StorServerConfig) Test(org.junit.Test)

Example 2 with StorServerConfig

use of com.yahoo.vespa.config.content.core.StorServerConfig in project vespa by vespa-engine.

the class StorageClusterTest method testBasics.

@Test
public void testBasics() throws Exception {
    StorServerConfig.Builder builder = new StorServerConfig.Builder();
    parse("<content id=\"foofighters\"><documents/>\n" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</content>\n").getConfig(builder);
    StorServerConfig config = new StorServerConfig(builder);
    assertEquals(false, config.is_distributor());
    assertEquals("foofighters", config.cluster_name());
}
Also used : StorServerConfig(com.yahoo.vespa.config.content.core.StorServerConfig) Test(org.junit.Test)

Example 3 with StorServerConfig

use of com.yahoo.vespa.config.content.core.StorServerConfig in project vespa by vespa-engine.

the class StorageClusterTest method testRootFolder.

@Test
public void testRootFolder() throws Exception {
    String xml = "<cluster id=\"storage\">\n" + "  <documents/>" + "  <group>\n" + "    <node distribution-key=\"0\" hostalias=\"mockhost\"/>\n" + "  </group>\n" + "</cluster>";
    ContentCluster cluster = ContentClusterUtils.createCluster(xml, new MockRoot());
    StorageNode node = cluster.getStorageNodes().getChildren().get("0");
    {
        StorDevicesConfig.Builder builder = new StorDevicesConfig.Builder();
        node.getConfig(builder);
        StorDevicesConfig config = new StorDevicesConfig(builder);
        assertEquals(getDefaults().underVespaHome("var/db/vespa/vds/storage/storage/0"), config.root_folder());
    }
    {
        StorServerConfig.Builder builder = new StorServerConfig.Builder();
        cluster.getStorageNodes().getConfig(builder);
        node.getConfig(builder);
        StorServerConfig config = new StorServerConfig(builder);
        assertEquals(getDefaults().underVespaHome("var/db/vespa/vds/storage/storage/0"), config.root_folder());
    }
    {
        StorServerConfig.Builder builder = new StorServerConfig.Builder();
        cluster.getDistributorNodes().getConfig(builder);
        cluster.getDistributorNodes().getChildren().get("0").getConfig(builder);
        StorServerConfig config = new StorServerConfig(builder);
        assertEquals(getDefaults().underVespaHome("var/db/vespa/vds/storage/distributor/0"), config.root_folder());
    }
}
Also used : MockRoot(com.yahoo.config.model.test.MockRoot) StorDevicesConfig(com.yahoo.vespa.config.storage.StorDevicesConfig) StorServerConfig(com.yahoo.vespa.config.content.core.StorServerConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 4 with StorServerConfig

use of com.yahoo.vespa.config.content.core.StorServerConfig in project vespa by vespa-engine.

the class StorageClusterTest method testCapacity.

@Test
public void testCapacity() throws Exception {
    String xml = "<cluster id=\"storage\">\n" + "  <documents/>" + "  <group>\n" + "    <node distribution-key=\"0\" hostalias=\"mockhost\"/>\n" + "    <node distribution-key=\"1\" hostalias=\"mockhost\" capacity=\"1.5\"/>\n" + "    <node distribution-key=\"2\" hostalias=\"mockhost\" capacity=\"2.0\"/>\n" + "  </group>\n" + "</cluster>";
    ContentCluster cluster = ContentClusterUtils.createCluster(xml, new MockRoot());
    for (int i = 0; i < 3; ++i) {
        StorageNode node = cluster.getStorageNodes().getChildren().get("" + i);
        StorServerConfig.Builder builder = new StorServerConfig.Builder();
        cluster.getStorageNodes().getConfig(builder);
        node.getConfig(builder);
        StorServerConfig config = new StorServerConfig(builder);
        assertEquals(1.0 + (double) i * 0.5, config.node_capacity(), 0.001);
    }
}
Also used : MockRoot(com.yahoo.config.model.test.MockRoot) StorServerConfig(com.yahoo.vespa.config.content.core.StorServerConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 5 with StorServerConfig

use of com.yahoo.vespa.config.content.core.StorServerConfig in project vespa by vespa-engine.

the class StorageClusterTest method testMerges.

@Test
public void testMerges() throws Exception {
    StorServerConfig.Builder builder = new StorServerConfig.Builder();
    parse("" + "<content id=\"foofighters\">\n" + "  <documents/>" + "  <tuning>" + "    <merges max-per-node=\"1K\" max-queue-size=\"10K\"/>\n" + "  </tuning>" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</content>").getConfig(builder);
    StorServerConfig config = new StorServerConfig(builder);
    assertEquals(1024, config.max_merges_per_node());
    assertEquals(1024 * 10, config.max_merge_queue_size());
}
Also used : StorServerConfig(com.yahoo.vespa.config.content.core.StorServerConfig) Test(org.junit.Test)

Aggregations

StorServerConfig (com.yahoo.vespa.config.content.core.StorServerConfig)5 Test (org.junit.Test)5 MockRoot (com.yahoo.config.model.test.MockRoot)2 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)2 StorDevicesConfig (com.yahoo.vespa.config.storage.StorDevicesConfig)1