package com.ercancan.spark import org.apache.log4j.{Level, Logger} import org.apache.spark.{SparkConf, SparkContext} /** * Spark word count example * @author Ercan Can */ object WordCount { //Main function which implements the primary logic of SPARC job def main(args: Array[String]) { /* Windows binaries for Hadoop versions Apache Spark requires the executable file winutils.exe to function correctly on the Windows Operating System when running against a non-Windows cluster. */ System.setProperty("hadoop.home.dir", "C:\\winutils") Logger.getLogger("org").setLevel(Level.ERROR) /* Create the SPARK configuration. This is entry point to SPARK applicaion. Our application named as "wordcount". We're going to run our application on an embedded SPARK instance on our local box which cold use up to two core cpu. */ val conf = new SparkConf().setAppName("wor...