use of voldemort.xml.StoreDefinitionsMapper in project voldemort by voldemort.
the class ZonedRebalanceNonContiguousZonesTest method setupZ1Z3.
public static void setupZ1Z3() throws IOException {
z1z3Current = ClusterTestUtils.getZ1Z3ClusterWithNonContiguousNodeIds();
z1z3Shuffle = ClusterTestUtils.getZ1Z3ClusterWithNonContiguousNodeIdsWithSwappedPartitions();
z1z3ClusterExpansionNN = ClusterTestUtils.getZ1Z3ClusterWithNonContiguousNodeIdsWithNN();
z1z3ClusterExpansionPP = ClusterTestUtils.getZ1Z3ClusterWithNonContiguousNodeIdsWithPP();
z1z3Stores = ClusterTestUtils.getZ1Z3StoreDefsBDB();
File z1z3file = ServerTestUtils.createTempFile("z1z3-stores-", ".xml");
FileUtils.writeStringToFile(z1z3file, new StoreDefinitionsMapper().writeStoreList(z1z3Stores));
z1z3StoresXml = z1z3file.getAbsolutePath();
z1z3z5Current = ClusterTestUtils.getZ1Z3Z5ClusterWithNonContiguousNodeIds();
z1z3z5Shuffle = ClusterTestUtils.getZ1Z3Z5ClusterWithNonContiguousNodeIdsWithSwappedPartitions();
z1z3z5ClusterExpansionNNN = ClusterTestUtils.getZ1Z3Z5ClusterWithNonContiguousNodeIdsWithNNN();
z1z3z5ClusterExpansionPPP = ClusterTestUtils.getZ1Z3Z5ClusterWithNonContiguousNodeIdsWithPPP();
z1z3z5Stores = ClusterTestUtils.getZ1Z3Z5StoreDefsBDB();
File z1z3z5file = ServerTestUtils.createTempFile("z1z3z5-stores-", ".xml");
FileUtils.writeStringToFile(z1z3z5file, new StoreDefinitionsMapper().writeStoreList(z1z3z5Stores));
z1z3z5StoresXml = z1z3z5file.getAbsolutePath();
}
use of voldemort.xml.StoreDefinitionsMapper in project voldemort by voldemort.
the class VerifyOrAddStoreTest method setUp.
@Before
public void setUp() throws IOException {
servers = new VoldemortServer[NUM_SERVERS];
int[][] partitionMap = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 }, { 8, 9, 10, 11 }, { 12, 13, 14, 15 } };
cluster = ServerTestUtils.startVoldemortCluster(servers, partitionMap, serverProps, storesXmlfile);
newStoreDef = new StoreDefinitionsMapper().readStoreList(new File(readOnlyXmlFilePath)).get(0);
newStoreName = newStoreDef.getName();
Node node = cluster.getNodeById(0);
String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
clientConfig.setBootstrapUrls(bootstrapUrl);
adminClient = new AdminClient(new AdminClientConfig(), clientConfig);
}
use of voldemort.xml.StoreDefinitionsMapper in project voldemort by voldemort.
the class AbstractZonedRebalanceTest method setupZZandZZZ.
public static void setupZZandZZZ() throws IOException {
zzCurrent = ClusterTestUtils.getZZCluster();
zzShuffle = ClusterTestUtils.getZZClusterWithSwappedPartitions();
zzClusterExpansionNN = ClusterTestUtils.getZZClusterWithNN();
zzClusterExpansionPP = ClusterTestUtils.getZZClusterWithPP();
zzStores = ClusterTestUtils.getZZStoreDefsBDB();
File zzfile = ServerTestUtils.createTempFile("zz-stores-", ".xml");
FileUtils.writeStringToFile(zzfile, new StoreDefinitionsMapper().writeStoreList(zzStores));
zzStoresXml = zzfile.getAbsolutePath();
zzzCurrent = ClusterTestUtils.getZZZCluster();
zzzShuffle = ClusterTestUtils.getZZZClusterWithSwappedPartitions();
zzzClusterExpansionNNN = ClusterTestUtils.getZZZClusterWithNNN();
zzzClusterExpansionPPP = ClusterTestUtils.getZZZClusterWithPPP();
zzeZoneExpansion = ClusterTestUtils.getZZECluster();
zzzZoneExpansionXXP = ClusterTestUtils.getZZEClusterXXP();
zzzStores = ClusterTestUtils.getZZZStoreDefsBDB();
File zzzfile = ServerTestUtils.createTempFile("zzz-stores-", ".xml");
FileUtils.writeStringToFile(zzzfile, new StoreDefinitionsMapper().writeStoreList(zzzStores));
zzzStoresXml = zzzfile.getAbsolutePath();
}
use of voldemort.xml.StoreDefinitionsMapper in project voldemort by voldemort.
the class AdminRebalanceTest method startThreeNodeRW.
public void startThreeNodeRW() throws IOException {
storeDef1 = ServerTestUtils.getStoreDef("test", 1, 1, 1, 1, 1, RoutingStrategyType.CONSISTENT_STRATEGY);
storeDef2 = ServerTestUtils.getStoreDef("test2", 2, 1, 1, 1, 1, RoutingStrategyType.CONSISTENT_STRATEGY);
File tempStoreXml = new File(TestUtils.createTempDir(), "stores.xml");
FileUtils.writeStringToFile(tempStoreXml, new StoreDefinitionsMapper().writeStoreList(Lists.newArrayList(storeDef1, storeDef2)));
int numServers = 3;
servers = new VoldemortServer[numServers];
int[][] partitionMap = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 }, {} };
currentCluster = ServerTestUtils.startVoldemortCluster(numServers, servers, partitionMap, socketStoreFactory, useNio, null, tempStoreXml.getAbsolutePath(), new Properties());
finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster, 2, Lists.newArrayList(0));
RebalanceBatchPlan plan = new RebalanceBatchPlan(currentCluster, finalCluster, Lists.newArrayList(storeDef1, storeDef2));
plans = Lists.newArrayList(plan.getBatchPlan());
adminClient = ServerTestUtils.getAdminClient(currentCluster);
}
use of voldemort.xml.StoreDefinitionsMapper in project voldemort by voldemort.
the class QuotaResetterTest method setUp.
@Before
public void setUp() throws IOException {
int numServers = 2;
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(false));
cluster = ServerTestUtils.startVoldemortCluster(numServers, servers, partitionMap, socketStoreFactory, true, null, storesXmlfile, serverProperties);
List<StoreDefinition> storeDefs = new StoreDefinitionsMapper().readStoreList(new File(storesXmlfile));
this.storeNames = Sets.newHashSet();
for (StoreDefinition storeDef : storeDefs) {
storeNames.add(storeDef.getName());
}
Properties adminProperties = new Properties();
adminProperties.setProperty("max_connections", "20");
adminClient = new AdminClient(cluster, new AdminClientConfig(adminProperties));
}
Aggregations