Ok, no problem
In fact If I print it try to read an empty line
That’s the line: >--------------1234-------023456------------------------------------------------------------------------023456------<
234560.0
That’s the line: >--------------1201-------123456------------------------------------------------------------------------123456------<
1234560.0
That’s the line: >--------------2003-------053456------------------------------------------------------------------------053456------<
534560.0
That’s the line: >--------------2001-------043456------------------------------------------------------------------------043456------<
434560.0
That’s the line: ><
So what I did is to add the line with the prefix STN— since in the mapper
if (line.startsWith(„STN—“))
return;
should exit.
--------------1234-------023456------------------------------------------------------------------------023456------
--------------1201-------123456------------------------------------------------------------------------123456------
--------------2003-------053456------------------------------------------------------------------------053456------
--------------2001-------043456------------------------------------------------------------------------043456------
STN-----------1988-------043456------------------------------------------------------------------------043456------
but still the same prob:
That’s the line: >--------------1234-------023456------------------------------------------------------------------------023456------<
234560.0
That’s the line: >--------------1201-------123456------------------------------------------------------------------------123456------<
1234560.0
That’s the line: >--------------2003-------053456------------------------------------------------------------------------053456------<
534560.0
That’s the line: >--------------2001-------043456------------------------------------------------------------------------043456------<
434560.0
That’s the line: ><
*** Edit ***
Ok, it is working now :),
public void map(LongWritable key, Text value,
MaxTemperatureMapper.Context context) throws IOException,
InterruptedException {
line = value.toString();
System.out.println("That's the line from mapper: >"+line+"<");
/*if (line.startsWith("STN---"))*/
** if (line.isEmpty())**
{
return;
}
year = DataSet.getYear(line);
airTemperature = DataSet.getMax(line);
if (airTemperature != DataSet.MISSING) {
context.write(new Text(year), new IntWritable(airTemperature));
}
}
}
*** Edit ***
Ok, now the next step is to test the jocl implementation (jocl/MaxTemperature.java)
which uses gpu in the reduce part (MaxTemperatureReducer)
Of course, I’ll post some errors The map task is done correctly meanwhile the reduce part has some problems
^[[A^[[Agabriele@gabriele-K52JU:~$ hadoop jar MaxTemperature.jar MaxTemperature /user/gabriele/input /user/gabriele/output
13/11/20 09:37:46 INFO util.NativeCodeLoader: Loaded the native-hadoop library
13/11/20 09:37:46 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
13/11/20 09:37:46 INFO input.FileInputFormat: Total input paths to process : 1
13/11/20 09:37:46 WARN snappy.LoadSnappy: Snappy native library not loaded
13/11/20 09:37:46 INFO mapred.JobClient: Running job: job_local1521899308_0001
13/11/20 09:37:46 INFO mapred.LocalJobRunner: Waiting for map tasks
13/11/20 09:37:46 INFO mapred.LocalJobRunner: Starting task: attempt_local1521899308_0001_m_000000_0
13/11/20 09:37:46 INFO util.ProcessTree: setsid exited with exit code 0
13/11/20 09:37:46 INFO mapred.Task: Using ResourceCalculatorPlugin : org.apache.hadoop.util.LinuxResourceCalculatorPlugin@95149e
13/11/20 09:37:46 INFO mapred.MapTask: Processing split: hdfs://localhost:9000/user/gabriele/input/temperatures.txt:0+700
13/11/20 09:37:46 INFO mapred.MapTask: io.sort.mb = 100
13/11/20 09:37:47 INFO mapred.MapTask: data buffer = 79691776/99614720
13/11/20 09:37:47 INFO mapred.MapTask: record buffer = 262144/327680
13/11/20 09:37:47 INFO mapred.MapTask: Starting flush of map output
13/11/20 09:37:47 INFO mapred.MapTask: Finished spill 0
13/11/20 09:37:47 INFO mapred.Task: Task:attempt_local1521899308_0001_m_000000_0 is done. And is in the process of commiting
13/11/20 09:37:47 INFO mapred.LocalJobRunner:
13/11/20 09:37:47 INFO mapred.Task: Task ‚attempt_local1521899308_0001_m_000000_0‘ done.
13/11/20 09:37:47 INFO mapred.LocalJobRunner: Finishing task: attempt_local1521899308_0001_m_000000_0
13/11/20 09:37:47 INFO mapred.LocalJobRunner: Map task executor complete.
13/11/20 09:37:47 INFO mapred.Task: Using ResourceCalculatorPlugin : org.apache.hadoop.util.LinuxResourceCalculatorPlugin@1b647b9
13/11/20 09:37:47 INFO mapred.LocalJobRunner:
13/11/20 09:37:47 INFO mapred.Merger: Merging 1 sorted segments
13/11/20 09:37:47 INFO mapred.Merger: Down to the last merge-pass, with 1 segments left of total size: 68 bytes
13/11/20 09:37:47 INFO mapred.LocalJobRunner:
13/11/20 09:37:47 WARN mapred.LocalJobRunner: job_local1521899308_0001
java.lang.NoClassDefFoundError: org/jocl/CLException
at jocl.MaxTemperatureReducer.setup(MaxTemperatureReducer.java:26)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:174)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:398)
Caused by: java.lang.ClassNotFoundException: org.jocl.CLException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
… 5 more
13/11/20 09:37:47 INFO mapred.JobClient: map 100% reduce 0%
13/11/20 09:37:47 INFO mapred.JobClient: Job complete: job_local1521899308_0001
13/11/20 09:37:47 INFO mapred.JobClient: Counters: 20
13/11/20 09:37:47 INFO mapred.JobClient: File Input Format Counters
13/11/20 09:37:47 INFO mapred.JobClient: Bytes Read=700
13/11/20 09:37:47 INFO mapred.JobClient: FileSystemCounters
13/11/20 09:37:47 INFO mapred.JobClient: FILE_BYTES_READ=80999
13/11/20 09:37:47 INFO mapred.JobClient: HDFS_BYTES_READ=700
13/11/20 09:37:47 INFO mapred.JobClient: FILE_BYTES_WRITTEN=150048
13/11/20 09:37:47 INFO mapred.JobClient: Map-Reduce Framework
13/11/20 09:37:47 INFO mapred.JobClient: Reduce input groups=0
13/11/20 09:37:47 INFO mapred.JobClient: Map output materialized bytes=72
13/11/20 09:37:47 INFO mapred.JobClient: Combine output records=0
13/11/20 09:37:47 INFO mapred.JobClient: Map input records=10
13/11/20 09:37:47 INFO mapred.JobClient: Reduce shuffle bytes=0
13/11/20 09:37:47 INFO mapred.JobClient: Physical memory (bytes) snapshot=0
13/11/20 09:37:47 INFO mapred.JobClient: Reduce output records=0
13/11/20 09:37:47 INFO mapred.JobClient: Spilled Records=6
13/11/20 09:37:47 INFO mapred.JobClient: Map output bytes=54
13/11/20 09:37:47 INFO mapred.JobClient: Total committed heap usage (bytes)=159907840
13/11/20 09:37:47 INFO mapred.JobClient: CPU time spent (ms)=0
13/11/20 09:37:47 INFO mapred.JobClient: Virtual memory (bytes) snapshot=0
13/11/20 09:37:47 INFO mapred.JobClient: SPLIT_RAW_BYTES=123
13/11/20 09:37:47 INFO mapred.JobClient: Map output records=6
13/11/20 09:37:47 INFO mapred.JobClient: Combine input records=0
13/11/20 09:37:47 INFO mapred.JobClient: Reduce input records=0
Any ideas ?