@@ -0,0 +1,2196 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.dataArtisans.flinkCascading.example;%0A%0Aimport cascading.flow.Flow;%0Aimport cascading.flow.FlowConnector;%0Aimport cascading.flow.FlowDef;%0Aimport cascading.operation.regex.RegexSplitGenerator;%0Aimport cascading.pipe.Each;%0Aimport cascading.pipe.Pipe;%0Aimport cascading.pipe.assembly.AggregateBy;%0Aimport cascading.pipe.assembly.CountBy;%0Aimport cascading.scheme.hadoop.TextDelimited;%0Aimport cascading.tap.Tap;%0Aimport cascading.tap.hadoop.Hfs;%0Aimport cascading.tuple.Fields;%0Aimport com.dataArtisans.flinkCascading.FlinkConnector;%0A%0Aimport java.util.Properties;%0A%0Apublic class WordCount %7B%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09Fields token = new Fields( %22token%22 );%0A%09%09Fields text = new Fields( %22text%22 );%0A%09%09RegexSplitGenerator splitter = new RegexSplitGenerator( token, %22%5C%5Cs+%22 );%0A%09%09// only returns %22token%22%0A%09%09Pipe docPipe = new Each( %22token%22, text, splitter, Fields.RESULTS );%0A%0A%09%09Pipe wcPipe = new Pipe( %22wc%22, docPipe );%0A%09%09wcPipe = new AggregateBy( wcPipe, token, new CountBy(new Fields(%22count%22)));%0A%0A%09%09Tap inTap = new Hfs(new TextDelimited(text, %22%5Cn%22 ), args%5B0%5D);%0A%09%09Tap outTap = new Hfs(new TextDelimited(false, %22%5Cn%22), args%5B1%5D);%0A%0A%09%09FlowDef flowDef = FlowDef.flowDef().setName( %22wc%22 )%0A%09%09%09%09.addSource( docPipe, inTap )%0A%09%09%09%09.addTailSink( wcPipe, outTap );%0A%0A%09%09FlowConnector flowConnector = new FlinkConnector();%0A%0A%09%09Flow wcFlow = flowConnector.connect( flowDef );%0A%0A%09%09wcFlow.complete();%0A%09%7D%0A%0A%7D%0A

add WordCount example