当前位置: 首页>>代码示例>>Java>>正文


Java TimeWindow.getEnd方法代码示例

本文整理汇总了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));
}
 
开发者ID:flink-taiwan,项目名称:jcconf2016-workshop,代码行数:20,代码来源:TaxiRideWithKafka.java

示例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));
}
 
开发者ID:flink-taiwan,项目名称:jcconf2016-workshop,代码行数:19,代码来源:TaxiRidePopularPlacesAnswer.java

示例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));
}
 
开发者ID:thr0n,项目名称:clojured-taxi-rides,代码行数:20,代码来源:PopularPlaces.java

示例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));
}
 
开发者ID:thr0n,项目名称:clojured-taxi-rides,代码行数:20,代码来源:PopularPlacesFromKafka.java

示例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));
}
 
开发者ID:dineshtrivedi,项目名称:flink-java-project,代码行数:13,代码来源:PoupularPlacesMain.java

示例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);
}
 
开发者ID:sics-dna,项目名称:isc4flink,代码行数:8,代码来源:ExtWindowTimeExtractor.java

示例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);
}
 
开发者ID:sics-dna,项目名称:isc4flink,代码行数:8,代码来源:WindowTimeExtractor.java


注:本文中的org.apache.flink.streaming.api.windowing.windows.TimeWindow.getEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。