use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class ServerTestUtilsTest method testStartVoldemortCluster.
@Test
public void testStartVoldemortCluster() throws IOException {
int numServers = 8;
VoldemortServer[] servers = new VoldemortServer[numServers];
int[][] partitionMap = { { 0 }, { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { 6 }, { 7 } };
Cluster cluster = ServerTestUtils.startVoldemortCluster(numServers, servers, partitionMap, socketStoreFactory, true, null, storesXmlfile, new Properties());
assertTrue(cluster != null);
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class AvroAddStoreTest method testAddAvroSchema.
@Test
public void testAddAvroSchema() throws Exception {
// backwards incompatible schema should fail
try {
logger.info("Now inserting stores with non backward compatible schema. Should see exception");
adminClient.storeMgmtOps.addStore(new StoreDefinitionsMapper().readStore(new StringReader(storeXmlWithBackwardIncompatibleSchema)));
Assert.fail("Did not throw exception");
} catch (VoldemortException e) {
}
// invalid key schema should fail
try {
logger.info("Now inserting stores with int32 avro key. Should see exception");
adminClient.storeMgmtOps.addStore(new StoreDefinitionsMapper().readStore(new StringReader(storeXmlWithInvalidAvroKeySchema)));
Assert.fail("Did not throw exception for invalid key schema");
} catch (VoldemortException e) {
logger.error("As expected", e);
}
// invalid value schema should fail
try {
logger.info("Now inserting stores with html characters in avro value schema");
adminClient.storeMgmtOps.addStore(new StoreDefinitionsMapper().readStore(new StringReader(storeXmlWithInvalidAvroValueSchema)));
Assert.fail("Did not throw exception for invalid value schema");
} catch (VoldemortException e) {
logger.error("As expected", e);
}
for (VoldemortServer vs : vservers.values()) {
assertNull(vs.getStoreRepository().getLocalStore("test"));
}
logger.info("Now inserting stores with backward compatible schema. Should not see exception");
adminClient.storeMgmtOps.addStore(new StoreDefinitionsMapper().readStore(new StringReader(storeXmlWithBackwardCompatibleSchema)));
for (VoldemortServer vs : vservers.values()) {
assertNotNull(vs.getStoreRepository().getLocalStore("test"));
}
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class MetaOperationsTest 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);
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class QuotaOperationsTest 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);
storeName = stores.iterator().next().getName();
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class CoordinatorAdminToolTest method tearDown.
@After
public void tearDown() throws Exception {
for (VoldemortServer server : servers) {
ServerTestUtils.stopVoldemortServer(server);
}
coordinator.stop();
// clean up the temporary file created in set up
COPY_OF_FAT_CLIENT_CONFIG_FILE.delete();
}
Aggregations