Search in sources :

Example 26 with VoldemortConfig

use of voldemort.server.VoldemortConfig in project voldemort by voldemort.

the class RocksdbStorageEngineAPITest method setup.

@Before
public void setup() {
    Properties props = new Properties();
    // Doesnt matter what node.id and voldemort.home values are for this
    // test
    props.setProperty("node.id", "0");
    props.setProperty("voldemort.home", "tmp/voldemort");
    voldemortConfig = new VoldemortConfig(props);
    if (this.prefixPartitionId) {
        voldemortConfig.setRocksdbPrefixKeysWithPartitionId(true);
    }
    this.rocksDbConfig = new RocksDbStorageConfiguration(voldemortConfig);
    this.rocksDbStore = (RocksDbStorageEngine) rocksDbConfig.getStore(TestUtils.makeStoreDefinition("test"), TestUtils.makeSingleNodeRoutingStrategy());
    random = new Random();
}
Also used : Random(java.util.Random) Properties(java.util.Properties) VoldemortConfig(voldemort.server.VoldemortConfig) Before(org.junit.Before)

Example 27 with VoldemortConfig

use of voldemort.server.VoldemortConfig in project voldemort by voldemort.

the class ZoneCountWriteTest method setup.

@Before
public void setup() throws IOException {
    storeDef = storeDefs.get(0);
    Integer zoneCountWrite = 1;
    // override
    storeDef = new StoreDefinition(storeDef.getName(), storeDef.getType(), storeDef.getDescription(), storeDef.getKeySerializer(), storeDef.getValueSerializer(), storeDef.getTransformsSerializer(), storeDef.getRoutingPolicy(), storeDef.getRoutingStrategyType(), storeDef.getReplicationFactor(), storeDef.getPreferredReads(), storeDef.getRequiredReads(), storeDef.getPreferredWrites(), storeDef.getRequiredWrites(), storeDef.getViewTargetStoreName(), storeDef.getValueTransformation(), storeDef.getZoneReplicationFactor(), storeDef.getZoneCountReads(), zoneCountWrite, storeDef.getRetentionDays(), storeDef.getRetentionScanThrottleRate(), storeDef.getRetentionFrequencyDays(), storeDef.getSerializerFactory(), storeDef.getHintedHandoffStrategyType(), storeDef.getHintPrefListSize(), storeDef.getOwners(), storeDef.getMemoryFootprintMB());
    storeDefs.set(0, storeDef);
    SocketStoreClientFactory socketStoreClientFactory = new SocketStoreClientFactory(clientConfig);
    for (Integer nodeId : cluster.getNodeIds()) {
        SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
        VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true, nodeId, TestUtils.createTempDir().getAbsolutePath(), cluster, storeDefs, new Properties());
        VoldemortServer vs = ServerTestUtils.startVoldemortServer(socketStoreFactory, config, cluster);
        vservers.put(nodeId, vs);
    }
    client = socketStoreClientFactory.getRawStore(storeDef.getName(), null);
}
Also used : ClientRequestExecutorPool(voldemort.store.socket.clientrequest.ClientRequestExecutorPool) SocketStoreClientFactory(voldemort.client.SocketStoreClientFactory) StoreDefinition(voldemort.store.StoreDefinition) SocketStoreFactory(voldemort.store.socket.SocketStoreFactory) Properties(java.util.Properties) VoldemortServer(voldemort.server.VoldemortServer) VoldemortConfig(voldemort.server.VoldemortConfig) Before(org.junit.Before)

Example 28 with VoldemortConfig

use of voldemort.server.VoldemortConfig in project voldemort by voldemort.

the class ZoneShrinkageCLITest method setup.

public void setup() throws IOException {
    // setup cluster
    bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();
    for (Node node : cluster.getNodes()) {
        SocketStoreFactory ssf = new TestSocketStoreFactory();
        VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true, node.getId(), TestUtils.createTempDir().getAbsolutePath(), cluster, oldStores, new Properties());
        VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf, config, cluster);
        vservers.put(node.getId(), vs);
        socketStoreFactories.put(node.getId(), ssf);
    }
}
Also used : TestSocketStoreFactory(voldemort.store.socket.TestSocketStoreFactory) Node(voldemort.cluster.Node) SocketStoreFactory(voldemort.store.socket.SocketStoreFactory) TestSocketStoreFactory(voldemort.store.socket.TestSocketStoreFactory) Properties(java.util.Properties) VoldemortServer(voldemort.server.VoldemortServer) VoldemortConfig(voldemort.server.VoldemortConfig)

Example 29 with VoldemortConfig

use of voldemort.server.VoldemortConfig in project voldemort by voldemort.

the class AvroAddStoreTest method setup.

/**
     * This test is to partially test the functionality of SetMetadata feature
     * of the VoldemortAdminTool
     */
@Before
public void setup() throws IOException {
    // setup cluster
    cluster = ClusterTestUtils.getZZZCluster();
    oldStores = ClusterTestUtils.getZZZStoreDefsInMemory();
    bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();
    for (Node node : cluster.getNodes()) {
        SocketStoreFactory ssf = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
        VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true, node.getId(), TestUtils.createTempDir().getAbsolutePath(), cluster, oldStores, new Properties());
        VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf, config, cluster);
        vservers.put(node.getId(), vs);
        socketStoreFactories.put(node.getId(), ssf);
    }
    adminClient = new AdminClient(cluster);
}
Also used : ClientRequestExecutorPool(voldemort.store.socket.clientrequest.ClientRequestExecutorPool) Node(voldemort.cluster.Node) SocketStoreFactory(voldemort.store.socket.SocketStoreFactory) Properties(java.util.Properties) VoldemortServer(voldemort.server.VoldemortServer) VoldemortConfig(voldemort.server.VoldemortConfig) AdminClient(voldemort.client.protocol.admin.AdminClient) Before(org.junit.Before)

Example 30 with VoldemortConfig

use of voldemort.server.VoldemortConfig in project voldemort by voldemort.

the class SetMetadataTest method setup.

/**
     * This test is to partially test the functionality of SetMetadata feature
     * of the VoldemortAdminTool
     */
@Before
public void setup() throws IOException {
    // setup cluster
    cluster = ClusterTestUtils.getZZZCluster();
    oldStores = ClusterTestUtils.getZZZStoreDefsInMemory();
    bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();
    for (Node node : cluster.getNodes()) {
        SocketStoreFactory ssf = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
        VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true, node.getId(), TestUtils.createTempDir().getAbsolutePath(), cluster, oldStores, new Properties());
        VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf, config, cluster);
        vservers.put(node.getId(), vs);
        socketStoreFactories.put(node.getId(), ssf);
    }
}
Also used : ClientRequestExecutorPool(voldemort.store.socket.clientrequest.ClientRequestExecutorPool) Node(voldemort.cluster.Node) SocketStoreFactory(voldemort.store.socket.SocketStoreFactory) Properties(java.util.Properties) VoldemortServer(voldemort.server.VoldemortServer) VoldemortConfig(voldemort.server.VoldemortConfig) Before(org.junit.Before)

Aggregations

VoldemortConfig (voldemort.server.VoldemortConfig)53 Properties (java.util.Properties)29 VoldemortServer (voldemort.server.VoldemortServer)24 Before (org.junit.Before)18 Node (voldemort.cluster.Node)16 StoreDefinition (voldemort.store.StoreDefinition)16 File (java.io.File)15 Props (voldemort.utils.Props)14 SocketStoreFactory (voldemort.store.socket.SocketStoreFactory)13 ByteArray (voldemort.utils.ByteArray)12 ClientRequestExecutorPool (voldemort.store.socket.clientrequest.ClientRequestExecutorPool)11 Cluster (voldemort.cluster.Cluster)7 Test (org.junit.Test)6 ClientConfig (voldemort.client.ClientConfig)6 SocketStoreClientFactory (voldemort.client.SocketStoreClientFactory)6 BdbStorageConfiguration (voldemort.store.bdb.BdbStorageConfiguration)6 AdminClient (voldemort.client.protocol.admin.AdminClient)5 OptionParser (joptsimple.OptionParser)4 OptionSet (joptsimple.OptionSet)4 ObsoleteVersionException (voldemort.versioning.ObsoleteVersionException)4