Search in sources :

Example 51 with VoldemortServer

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

the class ReadOnlyReplicationHelperTest method tearDown.

@After
public void tearDown() throws IOException {
    adminClient.close();
    for (VoldemortServer server : servers) {
        ServerTestUtils.stopVoldemortServer(server);
    }
    socketStoreFactory.close();
}
Also used : VoldemortServer(voldemort.server.VoldemortServer) After(org.junit.After)

Example 52 with VoldemortServer

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

the class ChainedInconsistencyResolverTest method setUp.

@Before
public void setUp() throws IOException {
    boolean useNio = false;
    int numServers = 2;
    VoldemortServer[] servers = new VoldemortServer[numServers];
    Cluster cluster = ServerTestUtils.startVoldemortCluster(numServers, servers, null, socketStoreFactory, useNio, null, STORES_XML, new Properties());
    // Initialize versioned puts for basic test
    v1 = getVersioned(0, 1, 1, 1, 1, 1);
    v2 = getVersioned(0, 0, 1, 1, 1, 1);
    // Initialize versioned puts for > 1 conflicts
    conflict1 = getVersioned(0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
    conflict2 = getVersioned(0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
    conflict3 = getVersioned(0, 0, 0, 1, 1, 1, 1, 1, 1, 1);
    conflict4 = getVersioned(0, 0, 0, 0, 1, 1, 1, 1, 1, 1);
    conflict5 = getVersioned(0, 0, 0, 0, 0, 1, 1, 1, 1, 1);
    conflict6 = getVersioned(0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
    Node node = cluster.getNodes().iterator().next();
    String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
    StoreClientFactory storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));
    defaultStoreClient = storeClientFactory.getStoreClient("test");
    socketStore = ServerTestUtils.getSocketStore(socketStoreFactory, "test", node.getSocketPort(), RequestFormatType.VOLDEMORT_V1);
}
Also used : SocketStoreClientFactory(voldemort.client.SocketStoreClientFactory) Node(voldemort.cluster.Node) Cluster(voldemort.cluster.Cluster) VoldemortServer(voldemort.server.VoldemortServer) Properties(java.util.Properties) ClientConfig(voldemort.client.ClientConfig) SocketStoreClientFactory(voldemort.client.SocketStoreClientFactory) StoreClientFactory(voldemort.client.StoreClientFactory) Before(org.junit.Before)

Example 53 with VoldemortServer

use of voldemort.server.VoldemortServer 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)

Example 54 with VoldemortServer

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

the class ServerTestUtilsTest method startMultipleVoldemortServers.

// @Test
public void startMultipleVoldemortServers() throws IOException {
    Cluster cluster = ServerTestUtils.getLocalCluster(16, new int[][] { { 0 }, { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { 6 }, { 7 }, { 8 }, { 9 }, { 10 }, { 11 }, { 12 }, { 13 }, { 14 }, { 15 } });
    VoldemortServer[] servers = new VoldemortServer[16];
    for (int i = 0; i < 16; i++) {
        servers[i] = ServerTestUtils.startVoldemortServer(socketStoreFactory, ServerTestUtils.createServerConfig(true, i, TestUtils.createTempDir().getAbsolutePath(), null, storesXmlfile, new Properties()), cluster);
    }
    assertTrue(true);
    for (VoldemortServer server : servers) {
        ServerTestUtils.stopVoldemortServer(server);
    }
}
Also used : Cluster(voldemort.cluster.Cluster) VoldemortServer(voldemort.server.VoldemortServer) Properties(java.util.Properties)

Example 55 with VoldemortServer

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

the class ClusterForkLiftToolTest method tearDownClusters.

@After
public void tearDownClusters() throws IOException {
    srcAdminClient.close();
    srcfactory.close();
    dstfactory.close();
    for (VoldemortServer server : srcServers) ServerTestUtils.stopVoldemortServer(server);
    for (VoldemortServer server : dstServers) server.stop();
}
Also used : VoldemortServer(voldemort.server.VoldemortServer) After(org.junit.After)

Aggregations

VoldemortServer (voldemort.server.VoldemortServer)86 Properties (java.util.Properties)36 VoldemortConfig (voldemort.server.VoldemortConfig)24 Test (org.junit.Test)23 Node (voldemort.cluster.Node)23 Before (org.junit.Before)21 SocketStoreFactory (voldemort.store.socket.SocketStoreFactory)20 ClientRequestExecutorPool (voldemort.store.socket.clientrequest.ClientRequestExecutorPool)18 ClientConfig (voldemort.client.ClientConfig)17 ByteArray (voldemort.utils.ByteArray)17 ArrayList (java.util.ArrayList)16 After (org.junit.After)15 StoreDefinition (voldemort.store.StoreDefinition)15 SocketStoreClientFactory (voldemort.client.SocketStoreClientFactory)14 Cluster (voldemort.cluster.Cluster)14 IOException (java.io.IOException)11 HashMap (java.util.HashMap)11 AdminClient (voldemort.client.protocol.admin.AdminClient)11 VectorClock (voldemort.versioning.VectorClock)10 StoreDefinitionsMapper (voldemort.xml.StoreDefinitionsMapper)9