Skip to content

Commit

Permalink
First testing set
Browse files Browse the repository at this point in the history
  • Loading branch information
ubuntu committed Aug 4, 2016
0 parents commit fa33811
Show file tree
Hide file tree
Showing 200 changed files with 31,521 additions and 0 deletions.
93 changes: 93 additions & 0 deletions Spark/derby.log

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions Spark/metastore_db/README_DO_NOT_TOUCH_FILES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# *************************************************************************
# *** DO NOT TOUCH FILES IN THIS DIRECTORY! ***
# *** FILES IN THIS DIRECTORY AND SUBDIRECTORIES CONSTITUTE A DERBY ***
# *** DATABASE, WHICH INCLUDES THE DATA (USER AND SYSTEM) AND THE ***
# *** FILES NECESSARY FOR DATABASE RECOVERY. ***
# *** EDITING, ADDING, OR DELETING ANY OF THESE FILES MAY CAUSE DATA ***
# *** CORRUPTION AND LEAVE THE DATABASE IN A NON-RECOVERABLE STATE. ***
# *************************************************************************
Binary file added Spark/metastore_db/db.lck
Binary file not shown.
Binary file added Spark/metastore_db/dbex.lck
Binary file not shown.
8 changes: 8 additions & 0 deletions Spark/metastore_db/log/README_DO_NOT_TOUCH_FILES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# *************************************************************************
# *** DO NOT TOUCH FILES IN THIS DIRECTORY! ***
# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE RECOVERY ***
# *** SYSTEM. EDITING, ADDING, OR DELETING FILES IN THIS DIRECTORY ***
# *** WILL CAUSE THE DERBY RECOVERY SYSTEM TO FAIL, LEADING TO ***
# *** NON-RECOVERABLE CORRUPT DATABASES. ***
# *************************************************************************
Binary file added Spark/metastore_db/log/log.ctrl
Binary file not shown.
Binary file added Spark/metastore_db/log/log1.dat
Binary file not shown.
Binary file added Spark/metastore_db/log/logmirror.ctrl
Binary file not shown.
8 changes: 8 additions & 0 deletions Spark/metastore_db/seg0/README_DO_NOT_TOUCH_FILES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# *************************************************************************
# *** DO NOT TOUCH FILES IN THIS DIRECTORY! ***
# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE TO STORE ***
# *** USER AND SYSTEM DATA. EDITING, ADDING, OR DELETING FILES IN THIS ***
# *** DIRECTORY WILL CORRUPT THE ASSOCIATED DERBY DATABASE AND MAKE ***
# *** IT NON-RECOVERABLE. ***
# *************************************************************************
Binary file added Spark/metastore_db/seg0/c10.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c101.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c111.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c121.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c130.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c141.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c150.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c161.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c171.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c180.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c191.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c1a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c1b1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c1c0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c1d1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c1e0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c1f1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c20.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c200.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c211.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c221.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c230.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c241.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c251.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c260.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c271.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c281.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c290.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c2a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c2b1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c2c1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c2d0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c2e1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c2f0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c300.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c31.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c311.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c321.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c331.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c340.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c351.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c361.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c371.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c380.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c391.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c3a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c3b1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c3c0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c3d1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c3e1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c3f1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c400.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c41.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c411.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c421.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c430.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c441.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c451.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c461.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c470.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c481.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c490.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c4a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c4b0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c4c1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c4d1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c4e1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c4f0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c501.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c51.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c510.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c521.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c530.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c541.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c550.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c561.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c570.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c581.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c590.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c5a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c5b0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c5c1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c5d0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c5e1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c5f0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c60.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c601.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c610.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c621.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c630.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c641.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c650.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c661.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c670.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c681.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c690.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c6a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c6b0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c6c1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c6d0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c6e1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c6f0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c701.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c71.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c711.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c721.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c731.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c741.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c751.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c761.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c771.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c781.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c791.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c7a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c7b1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c7c1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c7d1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c7e1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c7f1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c801.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c81.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c811.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c821.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c831.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c840.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c851.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c860.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c871.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c880.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c891.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c8a0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c8b1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c8c1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c8d1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c8e1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c8f1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c90.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c901.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c911.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c920.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c931.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c940.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c951.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c960.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c971.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c981.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c990.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c9a1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c9b1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c9c0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c9d1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c9e0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/c9f1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/ca01.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/ca1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/ca11.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/ca21.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/cb1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/cc0.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/cd1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/ce1.dat
Binary file not shown.
Binary file added Spark/metastore_db/seg0/cf0.dat
Binary file not shown.
23 changes: 23 additions & 0 deletions Spark/metastore_db/service.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#/home/ubuntu/testing/Spark/metastore_db
# ********************************************************************
# *** Please do NOT edit this file. ***
# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. ***
# ********************************************************************
#Thu Aug 04 10:23:35 CEST 2016
SysschemasIndex2Identifier=225
SyscolumnsIdentifier=144
SysconglomeratesIndex1Identifier=49
SysconglomeratesIdentifier=32
SyscolumnsIndex2Identifier=177
SysschemasIndex1Identifier=209
SysconglomeratesIndex3Identifier=81
SystablesIndex2Identifier=129
SyscolumnsIndex1Identifier=161
derby.serviceProtocol=org.apache.derby.database.Database
SysschemasIdentifier=192
derby.storage.propertiesId=16
SysconglomeratesIndex2Identifier=65
derby.serviceLocale=en_US
SystablesIdentifier=96
SystablesIndex1Identifier=113
#--- last line, don't put anything after this line ---
4 changes: 4 additions & 0 deletions Spark/palabras.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

este texto es el primer texto
que es importante para el ejercicio
en el que es el objetivo contar palabras
21 changes: 21 additions & 0 deletions Spark/spark-pi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/python

import sys, random
from pyspark import SparkConf, SparkContext

if len(sys.argv)<2 :
NUM_SAMPLES=100000
else:
NUM_SAMPLES=int(sys.argv[1])

conf = SparkConf().setMaster("local").setAppName("My App")
sc = SparkContext(conf = conf)
def sample(p):
x, y = random.random(), random.random()
return 1 if x*x + y*y < 1 else 0

count = sc.parallelize(xrange(0, NUM_SAMPLES)).map(sample) \
.reduce(lambda a, b: a + b)
print "Pi is roughly %f" % (4.0 * count / NUM_SAMPLES)


10 changes: 10 additions & 0 deletions Spark/spark_pi.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

val NUM_SAMPLES=100000
val count = sc.parallelize(1 to NUM_SAMPLES).map{i =>
val x = Math.random()
val y = Math.random()
if (x*x + y*y < 1) 1 else 0
}.reduce(_ + _)
println("Pi is roughly " + 4.0 * count / NUM_SAMPLES)


16 changes: 16 additions & 0 deletions Spark/wc_spark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from pyspark import SparkConf, SparkContext
import sys

conf = SparkConf().setMaster("local").setAppName("My App")
sc = SparkContext(conf = conf)

if len(sys.argv)<2 :
print 'An input file is needed'
sys.exit(2)
else:
lines = sc.textFile(str(sys.argv[1]))
words = lines.flatMap(lambda x: x.split(" "))
result = words.map(lambda x: (x, 1)).reduceByKey(lambda x, y: x + y)
extract= result.filter(lambda x:x[1]>2)
for pair in extract.take(extract.count()):
print(pair)
Binary file added WordCount/WordCount.jar
Binary file not shown.
159 changes: 159 additions & 0 deletions WordCount/WordCount.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hadoop.examples;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

/**
* This is an example Hadoop Map/Reduce application.
* It reads the text input files, breaks each line into words
* and counts them. The output is a locally sorted list of words and the
* count of how often they occurred.
*
* To run: bin/hadoop jar build/hadoop-examples.jar wordcount
* [-m <i>maps</i>] [-r <i>reduces</i>] <i>in-dir</i> <i>out-dir</i>
*/
public class WordCount extends Configured implements Tool {

/**
* Counts the words in each line.
* For each line of input, break the line into words and emit them as
* (<b>word</b>, <b>1</b>).
*/
public static class MapClass extends MapReduceBase
implements Mapper<LongWritable, Text, Text, IntWritable> {

private final static IntWritable one = new IntWritable(1);
private Text word = new Text();

public void map(LongWritable key, Text value,
OutputCollector<Text, IntWritable> output,
Reporter reporter) throws IOException {
String line = value.toString();
StringTokenizer itr = new StringTokenizer(line, " \t\n\r\f.,;:-?¿!¡'");
while (itr.hasMoreTokens()) {
word.set(itr.nextToken().toLowerCase());
output.collect(word, one);
}
}
}

/**
* A reducer class that just emits the sum of the input values.
*/
public static class Reduce extends MapReduceBase
implements Reducer<Text, IntWritable, Text, IntWritable> {

public void reduce(Text key, Iterator<IntWritable> values,
OutputCollector<Text, IntWritable> output,
Reporter reporter) throws IOException {
int sum = 0;
while (values.hasNext()) {
sum += values.next().get();
}
if (sum>1000) output.collect(key, new IntWritable(sum));
}
}

static int printUsage() {
System.out.println("wordcount [-m <maps>] [-r <reduces>] <input> <output>");
ToolRunner.printGenericCommandUsage(System.out);
return -1;
}

/**
* The main driver for word count map/reduce program.
* Invoke this method to submit the map/reduce job.
* @throws IOException When there is communication problems with the
* job tracker.
*/
public int run(String[] args) throws Exception {
JobConf conf = new JobConf(getConf(), WordCount.class);
conf.setJobName("wordcount");

// the keys are words (strings)
conf.setOutputKeyClass(Text.class);
// the values are counts (ints)
conf.setOutputValueClass(IntWritable.class);

conf.setMapperClass(MapClass.class);
conf.setCombinerClass(Reduce.class);
conf.setReducerClass(Reduce.class);

List<String> other_args = new ArrayList<String>();
for(int i=0; i < args.length; ++i) {
try {
if ("-m".equals(args[i])) {
conf.setNumMapTasks(Integer.parseInt(args[++i]));
} else if ("-r".equals(args[i])) {
conf.setNumReduceTasks(Integer.parseInt(args[++i]));
} else {
other_args.add(args[i]);
}
} catch (NumberFormatException except) {
System.out.println("ERROR: Integer expected instead of " + args[i]);
return printUsage();
} catch (ArrayIndexOutOfBoundsException except) {
System.out.println("ERROR: Required parameter missing from " +
args[i-1]);
return printUsage();
}
}
// Make sure there are exactly 2 parameters left.
if (other_args.size() != 2) {
System.out.println("ERROR: Wrong number of parameters: " +
other_args.size() + " instead of 2.");
return printUsage();
}
FileInputFormat.setInputPaths(conf, other_args.get(0));
FileOutputFormat.setOutputPath(conf, new Path(other_args.get(1)));

JobClient.runJob(conf);
return 0;
}


public static void main(String[] args) throws Exception {
int res = ToolRunner.run(new Configuration(), new WordCount(), args);
System.exit(res);
}

}
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions WordCount/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

program=`echo $1 | awk -F "." '{print $1}'`

if [ ! -d "${program}_classes" ]
then mkdir ${program}_classes/;
fi


HADOOP_PATH=/opt/hadoop

HADOOP_CLASSES=/opt/hadoop-2.7.2/etc/hadoop:/opt/hadoop-2.7.2/share/hadoop/common/lib/*:/opt/hadoop-2.7.2/share/hadoop/common/*:/opt/hadoop-2.7.2/share/hadoop/hdfs:/opt/hadoop-2.7.2/share/hadoop/hdfs/lib/*:/opt/hadoop-2.7.2/share/hadoop/hdfs/*:/opt/hadoop-2.7.2/share/hadoop/yarn/lib/*:/opt/hadoop-2.7.2/share/hadoop/yarn/*:/opt/hadoop-2.7.2/share/hadoop/mapreduce/lib/*:/opt/hadoop-2.7.2/share/hadoop/mapreduce/*:/contrib/capacity-scheduler/*.jar


javac -classpath $HADOOP_CLASSES -d ${program}_classes/ $1

jar -cvf ${program}.jar -C ${program}_classes/ .;
Loading

0 comments on commit fa33811

Please sign in to comment.