use of voldemort.client.protocol.admin.AdminClientConfig in project voldemort by voldemort.
the class AdminServiceBasicTest 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(onlineRetention));
serverProperties.setProperty(VoldemortConfig.DEFAULT_STORAGE_SPACE_QUOTA_IN_KB, Long.toString(defaultStoreQuota));
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);
}
use of voldemort.client.protocol.admin.AdminClientConfig in project voldemort by voldemort.
the class VoldemortBuildAndPushJob method createAdminClient.
private AdminClient createAdminClient(String url, boolean fetchAllStoresXml, int connectionTimeoutSec, int socketTimeoutSec) {
ClientConfig config = new ClientConfig().setBootstrapUrls(url).setConnectionTimeout(connectionTimeoutSec, TimeUnit.SECONDS).setFetchAllStoresXmlInBootstrap(fetchAllStoresXml);
AdminClientConfig adminConfig = new AdminClientConfig().setAdminSocketTimeoutSec(socketTimeoutSec);
return new AdminClient(adminConfig, config);
}
use of voldemort.client.protocol.admin.AdminClientConfig 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.client.protocol.admin.AdminClientConfig 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));
}
use of voldemort.client.protocol.admin.AdminClientConfig in project voldemort by voldemort.
the class AdminToolUtils method getAdminClient.
/**
* Utility function that constructs AdminClient.
*
* @param url URL pointing to the bootstrap node
* @return Newly constructed AdminClient
*/
public static AdminClient getAdminClient(String url) {
ClientConfig config = new ClientConfig().setBootstrapUrls(url).setConnectionTimeout(5, TimeUnit.SECONDS);
AdminClientConfig adminConfig = new AdminClientConfig().setAdminSocketTimeoutSec(5);
return new AdminClient(adminConfig, config);
}
Aggregations