Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. int[] results;
  2.  
  3. public void configure(JobConf job) {
  4. // targetPeriod = Integer.parseInt(job.get("Predict"));
  5. String[] pred = job.get("Predict").split(",");
  6. results = new int[pred.length];
  7.  
  8. for (int i = 0; i < pred.length; i++) {
  9. try {
  10. results[i] = Integer.parseInt(pred[i]);
  11. } catch (NumberFormatException nfe) {
  12. }
  13. ;
  14. }
  15.  
  16.  
  17.  
  18.  
  19. protected void reduce(final IntWritable key, final Iterable<Text> values,
  20. final Context context) throws IOException, InterruptedException {
  21.  
  22. // int targetPeriod = Integer.parseInt(predict.trim());
  23. String predictfin = null;
  24. // int targetPeriod = 10;
  25. "EXCEPTION HERE"---->
  26. double[] projectedCumulativeScoreAtTargetPeriod = new double[results.length];
  27. // Participant participant = new Participant(values,targetPeriod);
  28. for (int i = 0; i < results.length; i++) {
  29. Participant participant = new Participant(values, results[i]);
  30.  
  31.  
  32.  
  33.  
  34. 14/07/25 15:23:12 INFO mapred.JobClient: Task Id : attempt_201407110824_0728_r_000000_0, Status : FAILED
  35. java.lang.NullPointerException
  36. at ProjectionReducer.reduce(ProjectionReducer.java:38)
  37. at ProjectionReducer.reduce(ProjectionReducer.java:1)
  38. at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:177)
  39. at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
  40. at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418)
  41. at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
  42. at java.security.AccessController.doPrivileged(Native Method)
  43. at javax.security.auth.Subject.doAs(Subject.java:396)
  44. at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
  45. at org.apache.hadoop.mapred.Child.main(Child.java:249)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement