use of voldemort.xml.StoreDefinitionsMapper in project voldemort by voldemort.
the class StreamingClientTest method testSetup.
@Before
public void testSetup() throws IOException {
if (null == servers) {
servers = new VoldemortServer[numServers];
serverPorts = new int[numServers];
File tempStoreXml = new File(TestUtils.createTempDir(), "stores.xml");
try {
FileUtils.writeStringToFile(tempStoreXml, new StoreDefinitionsMapper().writeStoreList(Lists.newArrayList(storeDef)));
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
throw e1;
}
int count = 0;
for (int nodeId : cluster.getNodeIds()) {
try {
servers[count] = ServerTestUtils.startVoldemortServer(socketStoreFactory, ServerTestUtils.createServerConfig(true, nodeId, TestUtils.createTempDir().getAbsolutePath(), null, tempStoreXml.getAbsolutePath(), new Properties()), cluster);
} catch (IOException e) {
e.printStackTrace();
throw e;
}
serverPorts[count] = servers[count].getIdentityNode().getSocketPort();
count++;
}
adminClient = ServerTestUtils.getAdminClient(cluster);
}
startTime = System.currentTimeMillis();
}
use of voldemort.xml.StoreDefinitionsMapper in project voldemort by voldemort.
the class OfflineStateTest method setUp.
@Before
public void setUp() throws IOException {
int numServers = 1;
servers = new VoldemortServer[numServers];
int[][] partitionMap = { { 0, 1, 2, 3 } };
// , { 4, 5, 6, 7 } };
Properties serverProperties = new Properties();
serverProperties.setProperty("client.max.connections.per.node", "20");
serverProperties.setProperty("enforce.retention.policy.on.read", Boolean.toString(onlineRetention));
cluster = ServerTestUtils.startVoldemortCluster(numServers, servers, partitionMap, socketStoreFactory, useNio, null, storesXmlfile, serverProperties);
storeDefs = new StoreDefinitionsMapper().readStoreList(new File(storesXmlfile));
Properties adminProperties = new Properties();
adminProperties.setProperty("max_connections", "20");
adminClient = new AdminClient(cluster, new AdminClientConfig(adminProperties));
Node node = cluster.getNodeById(0);
String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
StoreClientFactory storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));
storeClient = storeClientFactory.getStoreClient(STORE_NAME);
}
Aggregations