Mastering Apache Flink and HBase Data Operations
Classified in Computers
Written on in
English with a size of 4.37 KB
Identify High-Volume Customer Purchases in Flink
The following Java code utilizes Apache Flink to identify customers who purchase more than 10 units of a specific item within a session window.
public class CustomerPurchase {
public static void main(String[] args) throws Exception {
final ParameterTool params = ParameterTool.fromArgs(args);
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
DataStream<String> text = env.readTextFile(params.get("input"));
env.getConfig().setGlobalJobParameters(params);
SingleOutputStreamOperator<Tuple3<Long, Integer, Integer>> mapStream = text.map(new MapFunction<String, Tuple3<Long, Integer, Integer>... Continue reading "Mastering Apache Flink and HBase Data Operations" »