本文整理汇总了Java中org.apache.flink.streaming.api.windowing.windows.TimeWindow.getEnd方法的典型用法代码示例。如果您正苦于以下问题:Java TimeWindow.getEnd方法的具体用法?Java TimeWindow.getEnd怎么用?Java TimeWindow.getEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.streaming.api.windowing.windows.TimeWindow
的用法示例。
在下文中一共展示了TimeWindow.getEnd方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.flink.streaming.api.windowing.windows.TimeWindow; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void apply(
Tuple key,
TimeWindow window,
Iterable<Tuple2<Integer, Boolean>> gridCells,
Collector<Tuple4<Integer, Long, Boolean, Integer>> out) throws Exception {
int cellId = ((Tuple2<Integer, Boolean>)key).f0;
boolean isStart = ((Tuple2<Integer, Boolean>)key).f1;
long windowTime = window.getEnd();
int cnt = 0;
for(Tuple2<Integer, Boolean> c : gridCells) {
cnt += 1;
}
out.collect(new Tuple4<>(cellId, windowTime, isStart, cnt));
}
示例2: apply
import org.apache.flink.streaming.api.windowing.windows.TimeWindow; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void apply(
Tuple key,
TimeWindow window,
Iterable<Tuple2<Integer, TaxiRide>> values,
Collector<Tuple3<Integer, Long, Integer>> out) throws Exception {
int cellId = ((Tuple1<Integer>)key).f0;
long windowTime = window.getEnd();
int cnt = 0;
for(Tuple2<Integer, TaxiRide> v : values) {
cnt += 1;
}
out.collect(new Tuple3<>(cellId, windowTime, cnt));
}
示例3: apply
import org.apache.flink.streaming.api.windowing.windows.TimeWindow; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void apply(
Tuple key,
TimeWindow window,
Iterable<Tuple2<Integer, Boolean>> values,
Collector<Tuple4<Integer, Long, Boolean, Integer>> out) throws Exception {
int cellId = ((Tuple2<Integer, Boolean>) key).f0;
boolean isStart = ((Tuple2<Integer, Boolean>) key).f1;
long windowTime = window.getEnd();
int cnt = 0;
for (Tuple2<Integer, Boolean> v : values) {
cnt += 1;
}
out.collect(new Tuple4<>(cellId, windowTime, isStart, cnt));
}
示例4: apply
import org.apache.flink.streaming.api.windowing.windows.TimeWindow; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void apply(
Tuple key,
TimeWindow window,
Iterable<Tuple2<Integer, Boolean>> gridCells,
Collector<Tuple4<Integer, Long, Boolean, Integer>> out) throws Exception {
int cellId = ((Tuple2<Integer, Boolean>)key).f0;
boolean isStart = ((Tuple2<Integer, Boolean>)key).f1;
long windowTime = window.getEnd();
int cnt = 0;
for(Tuple2<Integer, Boolean> c : gridCells) {
cnt += 1;
}
out.collect(new Tuple4<>(cellId, windowTime, isStart, cnt));
}
示例5: apply
import org.apache.flink.streaming.api.windowing.windows.TimeWindow; //导入方法依赖的package包/类
@Override
public void apply(Tuple key, TimeWindow timeWindow, Iterable<Tuple2<Integer, Boolean>> events,
Collector<Tuple4<Integer, Long, Boolean, Integer>> collector) throws Exception {
Tuple2<Integer, Boolean> castedKey = (Tuple2<Integer, Boolean>)key;
int gridId = castedKey.f0;
boolean isStart = castedKey.f1;
long windowTime = timeWindow.getEnd();
int rideCounter = Iterables.size(events);
collector.collect(Tuple4.of(gridId, windowTime, isStart, rideCounter));
}
示例6: apply
import org.apache.flink.streaming.api.windowing.windows.TimeWindow; //导入方法依赖的package包/类
@Override
public void apply(K key, TimeWindow timeWindow, Iterable<Tuple3<K, Tuple4<Double, Double,Long,Long>, RV>> iterable, Collector<Tuple3<K, Tuple4<Double, Double, Long, Long>, RV>> collector) throws Exception {
Tuple3<K,Tuple4<Double,Double,Long,Long>, RV> out = iterable.iterator().next();
out.f1.f2 = timeWindow.getStart();
out.f1.f3 = timeWindow.getEnd();
collector.collect(out);
}
示例7: apply
import org.apache.flink.streaming.api.windowing.windows.TimeWindow; //导入方法依赖的package包/类
@Override
public void apply(K key, TimeWindow timeWindow, Iterable<Tuple2<K, Tuple4<Double, Double,Long,Long>>> iterable, Collector<Tuple2<K, Tuple4<Double, Double, Long, Long>>> collector) throws Exception {
Tuple2<K,Tuple4<Double,Double,Long,Long>> out = iterable.iterator().next();
out.f1.f2 = timeWindow.getStart();
out.f1.f3 = timeWindow.getEnd();
collector.collect(out);
}