Search in sources :

Example 1 with StreamingClient

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;
}
Also used : StreamingClient(voldemort.client.protocol.admin.StreamingClient) StreamingClientConfig(voldemort.client.protocol.admin.StreamingClientConfig) ArrayList(java.util.ArrayList) Props(voldemort.utils.Props) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 StreamingClient (voldemort.client.protocol.admin.StreamingClient)1 StreamingClientConfig (voldemort.client.protocol.admin.StreamingClientConfig)1 Props (voldemort.utils.Props)1