You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nemo.apache.org by GitBox <gi...@apache.org> on 2018/11/09 09:48:29 UTC

[GitHub] johnyangk commented on a change in pull request #153: [NEMO-245, 247] Handle watermark in OutputWriter and Implement unbounded word count example

johnyangk commented on a change in pull request #153: [NEMO-245,247] Handle watermark in OutputWriter and Implement unbounded word count example
URL: https://github.com/apache/incubator-nemo/pull/153#discussion_r232157834
 
 

 ##########
 File path: examples/beam/src/main/java/org/apache/nemo/examples/beam/WindowedWordCount.java
 ##########
 @@ -41,19 +43,64 @@
   private WindowedWordCount() {
   }
 
+  public static final String INPUT_TYPE_BOUNDED = "bounded";
+  public static final String INPUT_TYPE_UNBOUNDED = "unbounded";
+
+
+  private static PCollection<KV<String, Long>> getSource(
+    final Pipeline p,
+    final String[] args) {
+
+    final String inputType = args[2];
+    if (inputType.compareTo(INPUT_TYPE_BOUNDED) == 0) {
+      final String inputFilePath = args[3];
+      return GenericSourceSink.read(p, inputFilePath)
+        .apply(ParDo.of(new DoFn<String, String>() {
+          @ProcessElement
+          public void processElement(@Element final String elem,
+                                     final OutputReceiver<String> out) {
+            final String[] splitt = elem.split("!");
 
 Review comment:
   Make '!' a static variable.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services