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();
}
Aggregations