@@ -0,0 +1,874 @@
+package com.amazonaws.vivanih.hadoop.cascading;%0A%0Aimport org.apache.spark.api.java.*;%0Aimport org.apache.spark.api.java.function.Function;%0A%0Apublic class Main %7B%0A  public static void main(String%5B%5D args) %7B%0A    String logFile = %22$YOUR_SPARK_HOME/README.md%22; // Should be some file on your system%0A    JavaSparkContext sc = new JavaSparkContext(%22local%22, %22Simple App%22,%0A      %22$YOUR_SPARK_HOME%22, new String%5B%5D%7B%22target/simple-project-1.0.jar%22%7D);%0A    JavaRDD%3CString%3E logData = sc.textFile(logFile).cache();%0A%0A    long numAs = logData.filter(new Function%3CString, Boolean%3E() %7B%0A      public Boolean call(String s) %7B return s.contains(%22a%22); %7D%0A    %7D).count();%0A%0A    long numBs = logData.filter(new Function%3CString, Boolean%3E() %7B%0A      public Boolean call(String s) %7B return s.contains(%22b%22); %7D%0A    %7D).count();%0A%0A    System.out.println(%22Lines with a: %22 + numAs + %22, lines with b: %22 + numBs);%0A  %7D%0A%7D%0A

Create Main.java