gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmarroq...@apache.org
Subject [1/6] gora git commit: GORA-482
Date Sun, 31 Jul 2016 19:33:09 GMT
Repository: gora
Updated Branches:
  refs/heads/master 0e937a1d2 -> fb4ad6a47


GORA-482


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/73cc2894
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/73cc2894
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/73cc2894

Branch: refs/heads/master
Commit: 73cc289467b1072e79f8a10aa4e95c0355814ca1
Parents: 0e937a1
Author: Renato Marroquin <marenato@inf.ethz.ch>
Authored: Thu Jul 28 00:14:12 2016 +0200
Committer: Renato Marroquin <marenato@inf.ethz.ch>
Committed: Thu Jul 28 00:14:12 2016 +0200

----------------------------------------------------------------------
 gora-core/pom.xml                                      |  5 -----
 .../org/apache/gora/mapreduce/GoraMapReduceUtils.java  | 13 +++++--------
 .../org/apache/gora/mapreduce/TestGoraInputFormat.java |  7 +------
 3 files changed, 6 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/73cc2894/gora-core/pom.xml
----------------------------------------------------------------------
diff --git a/gora-core/pom.xml b/gora-core/pom.xml
index 5bab376..0666156 100644
--- a/gora-core/pom.xml
+++ b/gora-core/pom.xml
@@ -105,11 +105,6 @@
 
   <dependencies>
     <!-- Hadoop Dependencies -->
-    <dependency>
-      <groupId>org.apache.gora</groupId>
-      <artifactId>gora-shims-distribution</artifactId>
-      <version>${project.version}</version>
-    </dependency>
 
     <dependency>
       <groupId>org.apache.hadoop</groupId>

http://git-wip-us.apache.org/repos/asf/gora/blob/73cc2894/gora-core/src/main/java/org/apache/gora/mapreduce/GoraMapReduceUtils.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/mapreduce/GoraMapReduceUtils.java b/gora-core/src/main/java/org/apache/gora/mapreduce/GoraMapReduceUtils.java
index f6e3167..208d8cd 100644
--- a/gora-core/src/main/java/org/apache/gora/mapreduce/GoraMapReduceUtils.java
+++ b/gora-core/src/main/java/org/apache/gora/mapreduce/GoraMapReduceUtils.java
@@ -21,8 +21,6 @@ package org.apache.gora.mapreduce;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.gora.shims.hadoop.HadoopShim;
-import org.apache.gora.shims.hadoop.HadoopShimFactory;
 import org.apache.gora.util.StringUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
@@ -32,14 +30,13 @@ import org.apache.hadoop.mapreduce.JobContext;
 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.task.JobContextImpl;
 
 /**
  * MapReduce related utilities for Gora
  */
 public class GoraMapReduceUtils {
 
-  private static final HadoopShim hadoopShim = HadoopShimFactory.INSTANCE().getHadoopShim();
-
   public static class HelperInputFormat<K,V> extends FileInputFormat<K, V> {
     @Override
     public RecordReader<K, V> createRecordReader(InputSplit arg0,
@@ -60,7 +57,7 @@ public class GoraMapReduceUtils {
     String serializationClass =
       PersistentSerialization.class.getCanonicalName();
     String[] serializations = StringUtils.joinStringArrays(
-        conf.getStrings("io.serializations"), 
+        conf.getStrings("io.serializations"),
         "org.apache.hadoop.io.serializer.WritableSerialization",
         StringSerialization.class.getCanonicalName(),
         serializationClass); 
@@ -79,11 +76,11 @@ public class GoraMapReduceUtils {
     throws IOException {
     
     if(inputPath != null) {
-      Job job = hadoopShim.createJob(conf);
+      Job job = Job.getInstance(conf);
       FileInputFormat.addInputPath(job, new Path(inputPath));
-      return hadoopShim.createJobContext(job.getConfiguration());
+      return new JobContextImpl(job.getConfiguration(), null);
     } 
     
-    return hadoopShim.createJobContext(conf);
+    return new JobContextImpl(conf, null);
   }
 }

http://git-wip-us.apache.org/repos/asf/gora/blob/73cc2894/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java
----------------------------------------------------------------------
diff --git a/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java b/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java
index 7e44d8d..e6872a9 100644
--- a/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java
+++ b/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java
@@ -28,8 +28,6 @@ import org.apache.gora.mock.persistency.MockPersistent;
 import org.apache.gora.mock.query.MockQuery;
 import org.apache.gora.mock.store.MockDataStore;
 import org.apache.gora.query.PartitionQuery;
-import org.apache.gora.shims.hadoop.HadoopShim;
-import org.apache.gora.shims.hadoop.HadoopShimFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.mapreduce.InputSplit;
 import org.apache.hadoop.mapreduce.Job;
@@ -38,14 +36,11 @@ import org.junit.Test;
 import static org.junit.Assert.assertTrue;
 
 public class TestGoraInputFormat {
-  
-  private static final HadoopShim hadoopShim = HadoopShimFactory.INSTANCE().getHadoopShim();
 
   public List<InputSplit> getInputSplits()
     throws IOException, InterruptedException {
 
-    //Job job = new Job();
-    Job job = hadoopShim.createJob(new Configuration());
+    Job job = Job.getInstance(new Configuration());
     MockDataStore store = MockDataStore.get();
 
     MockQuery query = store.newQuery();


Mime
View raw message