Class MinimalWordCount


  • public class MinimalWordCount
    extends java.lang.Object
    An example that counts words in Shakespeare.

    This class, MinimalWordCount, is the first in a series of four successively more detailed 'word count' examples. Here, for simplicity, we don't show any error-checking or argument processing, and focus on construction of the pipeline, which chains together the application of core transforms.

    Next, see the WordCount pipeline, then the DebuggingWordCount, and finally the WindowedWordCount pipeline, for more detailed examples that introduce additional concepts.

    Concepts:

       1. Reading data from text files
       2. Specifying 'inline' transforms
       3. Counting items in a PCollection
       4. Writing data to text files
     

    No arguments are required to run this pipeline. It will be executed with the DirectRunner. You can see the results in the output files in your current working directory, with names like "wordcounts-00001-of-00005. When running on a distributed service, you would use an appropriate file service.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MinimalWordCount

        public MinimalWordCount()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)