Search in sources :

Example 11 with ClientRequestExecutorPool

use of voldemort.store.socket.clientrequest.ClientRequestExecutorPool 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 12 with ClientRequestExecutorPool

use of voldemort.store.socket.clientrequest.ClientRequestExecutorPool 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 13 with ClientRequestExecutorPool

use of voldemort.store.socket.clientrequest.ClientRequestExecutorPool 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)

Example 14 with ClientRequestExecutorPool

use of voldemort.store.socket.clientrequest.ClientRequestExecutorPool in project voldemort by voldemort.

the class StoreOperationsTest method setup.

@Before
public void setup() throws IOException {
    // setup cluster
    cluster = ServerTestUtils.getLocalCluster(2);
    stores = ServerTestUtils.getStoreDefs(2);
    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, stores, 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 15 with ClientRequestExecutorPool

use of voldemort.store.socket.clientrequest.ClientRequestExecutorPool in project voldemort by voldemort.

the class ConsistencyFixTest method setUpCluster.

/**
     * 
     * @return bootstrap url
     */
public static String setUpCluster() {
    // setup four nodes with one store and one partition
    final SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2, 10000, 100000, 32 * 1024);
    VoldemortServer[] servers = new VoldemortServer[4];
    int[][] partitionMap = { { 0 }, { 1 }, { 2 }, { 3 } };
    try {
        Cluster cluster = ServerTestUtils.startVoldemortCluster(4, servers, partitionMap, socketStoreFactory, true, null, STORES_XML, new Properties());
        Node node = cluster.getNodeById(0);
        return "tcp://" + node.getHost() + ":" + node.getSocketPort();
    } catch (IOException e) {
        e.printStackTrace();
        fail("Unexpected exception");
    }
    return null;
}
Also used : ClientRequestExecutorPool(voldemort.store.socket.clientrequest.ClientRequestExecutorPool) Node(voldemort.cluster.Node) Cluster(voldemort.cluster.Cluster) SocketStoreFactory(voldemort.store.socket.SocketStoreFactory) IOException(java.io.IOException) VoldemortServer(voldemort.server.VoldemortServer) Properties(java.util.Properties)

Aggregations

ClientRequestExecutorPool (voldemort.store.socket.clientrequest.ClientRequestExecutorPool)30 Properties (java.util.Properties)18 VoldemortServer (voldemort.server.VoldemortServer)18 SocketStoreFactory (voldemort.store.socket.SocketStoreFactory)18 Before (org.junit.Before)17 Node (voldemort.cluster.Node)15 VoldemortConfig (voldemort.server.VoldemortConfig)11 StoreDefinition (voldemort.store.StoreDefinition)9 ClientConfig (voldemort.client.ClientConfig)8 Test (org.junit.Test)7 ByteArray (voldemort.utils.ByteArray)7 SocketStoreClientFactory (voldemort.client.SocketStoreClientFactory)6 AdminClient (voldemort.client.protocol.admin.AdminClient)6 StoreDefinitionsMapper (voldemort.xml.StoreDefinitionsMapper)6 File (java.io.File)5 ArrayList (java.util.ArrayList)5 Cluster (voldemort.cluster.Cluster)4 StoreRepository (voldemort.server.StoreRepository)4 IOException (java.io.IOException)3 RoutingStrategyFactory (voldemort.routing.RoutingStrategyFactory)3