use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class ZoneCountWriteTest method testFastPath.
@Test
public void testFastPath() {
try {
client.put("AB", new Versioned<String>("CD"), null);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
for (Integer nodeId : vservers.keySet()) {
VoldemortServer vs = vservers.get(nodeId);
Store<ByteArray, byte[], byte[]> store = vs.getStoreRepository().getLocalStore(storeDef.getName());
byte[] real = store.get(new ByteArray("AB".getBytes()), null).get(0).getValue();
assertTrue(Arrays.equals(real, "CD".getBytes()));
}
} catch (InsufficientOperationalNodesException e) {
fail("Failed with exception: " + e);
}
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class ZoneCountWriteTest method testRemoteZoneNodeFail.
@Test
public void testRemoteZoneNodeFail() {
try {
for (Integer nodeId : stoppedServersForRemoteZoneNodeFail) {
vservers.get(nodeId).stop();
}
client.put("AB", new Versioned<String>("CD"), null);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
}
for (Integer nodeId : vservers.keySet()) {
// skip stopped ones
if (stoppedServersForRemoteZoneNodeFail.contains(nodeId)) {
continue;
}
VoldemortServer vs = vservers.get(nodeId);
Store<ByteArray, byte[], byte[]> store = vs.getStoreRepository().getLocalStore(storeDef.getName());
byte[] real = store.get(new ByteArray("AB".getBytes()), null).get(0).getValue();
assertTrue(Arrays.equals(real, "CD".getBytes()));
}
} catch (InsufficientOperationalNodesException e) {
fail("Failed with exception: " + e);
e.printStackTrace();
}
}
use of voldemort.server.VoldemortServer 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);
}
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class AvroAddStoreTest method testUpdateAvroSchema.
@Test
public void testUpdateAvroSchema() throws Exception {
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)));
try {
logger.info("Now updating store with non backward compatible schema. Should see exception");
List<StoreDefinition> stores = new ArrayList<StoreDefinition>();
stores.add(new StoreDefinitionsMapper().readStore(new StringReader(storeXmlWithBackwardIncompatibleSchema)));
adminClient.metadataMgmtOps.updateRemoteStoreDefList(stores);
Assert.fail("Did not throw exception");
} catch (VoldemortException e) {
}
for (VoldemortServer vs : vservers.values()) {
assertNotNull(vs.getStoreRepository().getLocalStore("test"));
}
}
use of voldemort.server.VoldemortServer 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);
}
Aggregations