@@ -0,0 +1,1271 @@
+package com.oreilly.learningsparkexamples.java.logs;%0A%0Aimport org.apache.spark.api.java.JavaPairRDD;%0Aimport org.apache.spark.api.java.JavaRDD;%0Aimport org.apache.spark.api.java.function.PairFunction;%0Aimport org.apache.spark.streaming.api.java.JavaStreamingContext;%0Aimport org.apache.spark.streaming.api.java.JavaPairDStream;%0Aimport scala.Tuple2;%0A%0Aimport org.apache.hadoop.io.Writable;%0Aimport org.apache.hadoop.io.IntWritable;%0Aimport org.apache.hadoop.io.LongWritable;%0Aimport org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;%0A%0A%0Aimport java.io.Serializable;%0A%0Apublic class ReadTransferStats implements Serializable %7B%0A%0A  public JavaPairDStream%3CLong, Integer%3E readStats(JavaStreamingContext jssc, String inputDirectory) %7B%0A    // Note: This example doesn't work until Spark 1.2%0A    JavaPairDStream%3CLongWritable, IntWritable%3E input = jssc.fileStream(inputDirectory);%0A    // convert the input from Writables to native types%0A    JavaPairDStream%3CLong, Integer%3E usefulInput = input.mapToPair(%0A      new PairFunction%3CTuple2%3CLongWritable, IntWritable%3E, Long, Integer%3E() %7B%0A        public Tuple2%3CLong, Integer%3E call(Tuple2%3CLongWritable, IntWritable%3E input) %7B%0A          return new Tuple2(input._1().get(), input._2().get());%0A        %7D%0A      %7D);%0A    return usefulInput;%0A  %7D%0A%0A%7D%0A

Add hte start of a java ReadTransferStats (won't work due to API bug)