use of voldemort.client.protocol.admin.StreamingClient in project voldemort by voldemort.
the class SlopStreamingTestEnvironment method makeSlopStreamingClient.
public StreamingClient makeSlopStreamingClient(boolean wrapException) throws InterruptedException {
startFinishLatch.await();
if (throwIntermittentException)
waitForFaultyNodeLatch.await();
Props property = new Props();
property.put("streaming.platform.bootstrapURL", bootstrapUrl);
property.put("streaming.platform.max.failed.nodes", numFailedNodes);
StreamingClientConfig config = new StreamingClientConfig(property);
StreamingClient streamer = new StreamingClient(config);
Callable<Integer> cpCallable = new CheckpointCallable();
Callable<Integer> rbCallable = new RollbackCallable();
List<String> stores = new ArrayList();
stores.add(STORE_NAME);
List<Integer> failedNodes = new ArrayList<Integer>();
for (int i = 0; i < numFailedNodes; i++) failedNodes.add(i + 1);
if (!wrapException) {
streamer.initStreamingSessions(stores, cpCallable, rbCallable, true, failedNodes);
} else {
try {
streamer.initStreamingSessions(stores, cpCallable, rbCallable, true, failedNodes);
} catch (Exception e) {
logger.error(e);
}
}
return streamer;
}
Aggregations