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