use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class E2EClientRequestExecutorPoolAndFailureDetectorTest method tearDown.
public void tearDown() throws IOException {
// Servers
for (VoldemortServer server : servers) {
ServerTestUtils.stopVoldemortServer(server);
}
servers = null;
cluster = null;
// Clients
storeClientFactory.close();
storeClientFactory = null;
socketStoreFactory.close();
socketStoreFactory = null;
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class E2EClientRequestExecutorPoolAndFailureDetectorTest method setUp.
public void setUp(int opSlowMs, int numSelectors, int connectionsPerNode) throws Exception {
socketStoreFactory = new ClientRequestExecutorPool(numSelectors, connectionsPerNode, CONNECTION_TIMEOUT_MS, SOCKET_TIMEOUT_MS, SOCKET_BUFFER_SIZE, SOCKET_KEEP_ALIVE);
cluster = ServerTestUtils.getLocalCluster(numServers, new int[][] { { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 } });
servers = new ArrayList<VoldemortServer>();
Properties p = new Properties();
String storageConfigs = BdbStorageConfiguration.class.getName() + "," + InMemoryStorageConfiguration.class.getName() + "," + SlowStorageConfiguration.class.getName();
p.setProperty("storage.configs", storageConfigs);
p.setProperty("testing.slow.queueing.put.ms", Long.toString(opSlowMs));
p.setProperty("testing.slow.queueing.get.ms", Long.toString(opSlowMs));
// Susceptible to BindException...
for (int i = 0; i < numServers; i++) {
VoldemortConfig voldemortConfig = ServerTestUtils.createServerConfigWithDefs(this.useNio, i, TestUtils.createTempDir().getAbsolutePath(), cluster, getStoreDef(), p);
VoldemortServer voldemortServer = ServerTestUtils.startVoldemortServer(socketStoreFactory, voldemortConfig);
servers.add(voldemortServer);
}
Node node = cluster.getNodeById(0);
String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl).setMaxConnectionsPerNode(connectionsPerNode).setConnectionTimeout(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS).setSocketTimeout(SOCKET_TIMEOUT_MS, TimeUnit.MILLISECONDS).setRoutingTimeout(ROUTING_TIMEOUT_MS, TimeUnit.MILLISECONDS).setFailureDetectorThreshold(99).setFailureDetectorThresholdInterval(250));
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class E2ENonblockingCheckoutTest method setUp.
@Before
public void setUp() throws Exception {
// PatternLayout patternLayout = new
// PatternLayout("%d{ABSOLUTE} %-5p [%t/%c]: %m%n");
Logger logger;
/*-
// To analyze whether checkout/checkin paths are blocking add
// log4j.trace statements to KeyedResourcePool checkout/checkin methods.
*/
logger = Logger.getLogger("voldemort.store.socket.clientrequest.ClientRequestExecutorPool");
logger.setLevel(Level.TRACE);
logger = Logger.getLogger("voldemort.utils.pool.KeyedResourcePool");
logger.setLevel(Level.TRACE);
logger = Logger.getLogger("voldemort.utils.pool.QueuedKeyedResourcePool");
logger.setLevel(Level.TRACE);
logger = Logger.getLogger("voldemort.store.socket.SocketStore");
logger.setLevel(Level.DEBUG);
logger = Logger.getLogger("voldemort.store.routed.action.PerformParallelPutRequests");
logger.setLevel(Level.DEBUG);
logger = Logger.getLogger("voldemort.store.routed.action.PerformSerialPutRequests");
logger.setLevel(Level.DEBUG);
cluster = ServerTestUtils.getLocalCluster(3, new int[][] { { 0, 3 }, { 1, 4 }, { 2, 5 } });
servers = new ArrayList<VoldemortServer>();
Properties p = new Properties();
String storageConfigs = BdbStorageConfiguration.class.getName() + "," + InMemoryStorageConfiguration.class.getName() + "," + SlowStorageConfiguration.class.getName();
p.setProperty("storage.configs", storageConfigs);
p.setProperty("testing.slow.queueing.put.ms", Long.toString(SLOW_PUT_MS));
p.setProperty("client.connection.timeout.ms", Integer.toString(CONNECTION_TIMEOUT_MS));
p.setProperty("client.routing.timeout.ms", Integer.toString(ROUTING_TIMEOUT_MS));
for (int i = 0; i < 3; i++) {
VoldemortConfig voldemortConfig = ServerTestUtils.createServerConfigWithDefs(this.useNio, i, TestUtils.createTempDir().getAbsolutePath(), cluster, getStoreDef(i), p);
VoldemortServer voldemortServer = ServerTestUtils.startVoldemortServer(socketStoreFactory, voldemortConfig);
servers.add(voldemortServer);
}
Node node = cluster.getNodeById(0);
String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl).setMaxConnectionsPerNode(CONNECTIONS_PER_NODE).setConnectionTimeout(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS));
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class AdminServiceFilterTest method setUp.
@Override
@Before
public void setUp() throws IOException {
cluster = ServerTestUtils.getLocalCluster(2);
VoldemortConfig config = ServerTestUtils.createServerConfig(useNio, 0, TestUtils.createTempDir().getAbsolutePath(), null, storesXmlfile, new Properties());
config.setEnableNetworkClassLoader(true);
List<StoreDefinition> storeDefs = new StoreDefinitionsMapper().readStoreList(new File(storesXmlfile));
storeDef = StoreDefinitionUtils.getStoreDefinitionWithName(storeDefs, testStoreName);
server = new VoldemortServer(config, cluster);
server.start();
adminClient = ServerTestUtils.getAdminClient(cluster);
}
use of voldemort.server.VoldemortServer in project voldemort by voldemort.
the class AbstractRebalanceTest method startServers.
// This method is susceptible to BindException issues due to TOCTOU
// problem with getLocalCluster (which is used to construct cluster that is
// passed in).
// TODO: (refactor) AbstractRebalanceTest to take advantage of
// ServerTestUtils.startVoldemortCluster.
protected Cluster startServers(Cluster cluster, String storeXmlFile, List<Integer> nodeToStart, Map<String, String> configProps) throws Exception {
for (int node : nodeToStart) {
Properties properties = new Properties();
if (null != configProps) {
for (Entry<String, String> property : configProps.entrySet()) {
properties.put(property.getKey(), property.getValue());
}
}
// turn proxy puts on
properties.put("proxy.puts.during.rebalance", "true");
properties.put("bdb.cache.size", "" + (5 * 1024 * 1024));
properties.put("bdb.one.env.per.store", "true");
VoldemortConfig config = ServerTestUtils.createServerConfig(true, node, TestUtils.createTempDir().getAbsolutePath(), null, storeXmlFile, properties);
VoldemortServer server = ServerTestUtils.startVoldemortServer(socketStoreFactory, config, cluster);
serverMap.put(node, server);
}
return cluster;
}
Aggregations