This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.define "master" do |master| | |
master.vm.box = "ubuntu/trusty64" | |
master.vm.hostname = "master.local" | |
master.vm.network "private_network", ip: "192.168.2.2" | |
end | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 8192 | |
v.cpus = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.dedunu.datascience</groupId> | |
<artifactId>sample</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.dedunumax.mapperOnly; | |
import java.io.IOException; | |
import org.apache.hadoop.io.LongWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Mapper; | |
public class Map extends Mapper<LongWritable, Text, Text, Text> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.dedunu.hadoop.muiltiinputsample; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.InputSplit; | |
import org.apache.hadoop.mapreduce.RecordReader; | |
import org.apache.hadoop.mapreduce.TaskAttemptContext; | |
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; | |
import org.apache.hadoop.mapreduce.lib.input.LineRecordReader; | |
import java.io.IOException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IAB1 | Arts & Entertainment | |
---|---|---|
IAB1-1 | Books & Literature | |
IAB1-2 | Celebrity Fan/Gossip | |
IAB1-3 | Fine Art | |
IAB1-4 | Humor | |
IAB1-5 | Movies | |
IAB1-6 | Music | |
IAB1-7 | Television | |
IAB2 | Automotive | |
IAB2-1 | Auto Parts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.dedunu.datascience.sample | |
import org.apache.spark.{SparkContext, SparkConf} | |
object Driver { | |
def main(args: Array[String]): Unit = { | |
val sparkConf = new SparkConf().setAppName("Sample Job Name") | |
val sparkContext = new SparkContext(sparkConf) | |
val textFile = sparkContext.textFile("file://" + args(0) + "/*") | |
val counts = textFile.flatMap(line => line.split(" ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
__author__ = 'dedunu' | |
connection = boto3.client( | |
'emr', | |
region_name='us-west-1', | |
aws_access_key_id='<Your AWS Access Key>', | |
aws_secret_access_key='<You AWS Secred Key>', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto.emr | |
import boto.exception | |
from boto.emr.instance_group import InstanceGroup | |
__author__ = 'dedunu' | |
connection = boto.emr.connect_to_region( | |
region_name='us-east-1', | |
aws_access_key_id='<Your AWS Access Key>', | |
aws_secret_access_key='<You AWS Secred Key>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto.emr | |
import boto.exception | |
from boto.emr.instance_group import InstanceGroup | |
__author__ = 'dedunu' | |
connection = boto.emr.connect_to_region( | |
region_name='us-east-1', | |
aws_access_key_id='<Your AWS Access Key>', | |
aws_secret_access_key='<You AWS Secred Key>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
/** | |
* Date -1 | |
* Get the date prior to a specific date. | |
*/ | |
public class DateMinusOne { |