Search in sources :

Example 1 with WatermarkConfiguration

use of edu.snu.mist.client.datastreams.configurations.WatermarkConfiguration in project mist by snuspl.

the class GroupRecoveryTest method buildQuery.

/**
 * Builds the query for this test.
 * @return the built MISTQuery
 */
private MISTQuery buildQuery() {
    /**
     * Build the query which consists of:
     * SRC1 -> toTuple -> reduceByKey -> sort -> toString -> sink1
     */
    final SourceConfiguration localTextSocketSource1Conf = TextSocketSourceConfiguration.newBuilder().setHostAddress("localhost").setHostPort(16118).build();
    final MISTQueryBuilder queryBuilder = new MISTQueryBuilder();
    queryBuilder.setApplicationId("test-group");
    final int defaultWatermarkPeriod = 100;
    final WatermarkConfiguration testConf = PeriodicWatermarkConfiguration.newBuilder().setWatermarkPeriod(defaultWatermarkPeriod).build();
    queryBuilder.socketTextStream(localTextSocketSource1Conf, testConf).map(toTupleMapFunc).reduceByKey(0, String.class, countFunc).map(m -> new TreeMap<>(m)).map(toStringMapFunc).textSocketOutput("localhost", SINK_PORT);
    return queryBuilder.build();
}
Also used : MISTQueryBuilder(edu.snu.mist.client.MISTQueryBuilder) SourceConfiguration(edu.snu.mist.client.datastreams.configurations.SourceConfiguration) TextSocketSourceConfiguration(edu.snu.mist.client.datastreams.configurations.TextSocketSourceConfiguration) PeriodicWatermarkConfiguration(edu.snu.mist.client.datastreams.configurations.PeriodicWatermarkConfiguration) WatermarkConfiguration(edu.snu.mist.client.datastreams.configurations.WatermarkConfiguration)

Aggregations

MISTQueryBuilder (edu.snu.mist.client.MISTQueryBuilder)1 PeriodicWatermarkConfiguration (edu.snu.mist.client.datastreams.configurations.PeriodicWatermarkConfiguration)1 SourceConfiguration (edu.snu.mist.client.datastreams.configurations.SourceConfiguration)1 TextSocketSourceConfiguration (edu.snu.mist.client.datastreams.configurations.TextSocketSourceConfiguration)1 WatermarkConfiguration (edu.snu.mist.client.datastreams.configurations.WatermarkConfiguration)1