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());
}
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());
}
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());
}
}
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);
}
}
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());
}
Aggregations