sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject sqoop git commit: SQOOP-2710. Sqoop2: Move user from context classes to parent TransferableContext
Date Wed, 02 Dec 2015 20:05:55 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 cde1c3ac9 -> e2fc4a75e


SQOOP-2710. Sqoop2: Move user from context classes to parent TransferableContext

(Jarcec via Hari)


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

Branch: refs/heads/sqoop2
Commit: e2fc4a75e8ca452187e869e140a92d8acad86197
Parents: cde1c3a
Author: Hari Shreedharan <hshreedharan@apache.org>
Authored: Wed Dec 2 12:04:58 2015 -0800
Committer: Hari Shreedharan <hshreedharan@apache.org>
Committed: Wed Dec 2 12:04:58 2015 -0800

----------------------------------------------------------------------
 .../org/apache/sqoop/job/etl/DestroyerContext.java   | 13 +------------
 .../org/apache/sqoop/job/etl/ExtractorContext.java   | 14 +-------------
 .../org/apache/sqoop/job/etl/InitializerContext.java | 13 +------------
 .../java/org/apache/sqoop/job/etl/LoaderContext.java | 15 +--------------
 .../org/apache/sqoop/job/etl/PartitionerContext.java | 14 +-------------
 .../apache/sqoop/job/etl/TransferableContext.java    | 12 +++++++++++-
 6 files changed, 16 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2fc4a75/common/src/main/java/org/apache/sqoop/job/etl/DestroyerContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/job/etl/DestroyerContext.java b/common/src/main/java/org/apache/sqoop/job/etl/DestroyerContext.java
index 38d94db..759431e 100644
--- a/common/src/main/java/org/apache/sqoop/job/etl/DestroyerContext.java
+++ b/common/src/main/java/org/apache/sqoop/job/etl/DestroyerContext.java
@@ -35,13 +35,10 @@ public class DestroyerContext extends TransferableContext {
 
   private Schema schema;
 
-  private String user;
-
   public DestroyerContext(ImmutableContext context, boolean success, Schema schema, String
user) {
-    super(context);
+    super(context, user);
     this.success = success;
     this.schema = schema;
-    this.user = user;
   }
 
   /**
@@ -62,12 +59,4 @@ public class DestroyerContext extends TransferableContext {
     return schema;
   }
 
-  /**
-   * Return user associated with this step.
-   *
-   * @return
-   */
-  public String getUser() {
-    return user;
-  }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2fc4a75/common/src/main/java/org/apache/sqoop/job/etl/ExtractorContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/job/etl/ExtractorContext.java b/common/src/main/java/org/apache/sqoop/job/etl/ExtractorContext.java
index 748bdfb..89b0230 100644
--- a/common/src/main/java/org/apache/sqoop/job/etl/ExtractorContext.java
+++ b/common/src/main/java/org/apache/sqoop/job/etl/ExtractorContext.java
@@ -36,13 +36,10 @@ public class ExtractorContext extends TransferableContext {
 
   private final Schema schema;
 
-  private final String user;
-
   public ExtractorContext(ImmutableContext context, DataWriter writer, Schema schema, String
user) {
-    super(context);
+    super(context, user);
     this.writer = writer;
     this.schema = schema;
-    this.user = user;
   }
 
   /**
@@ -61,13 +58,4 @@ public class ExtractorContext extends TransferableContext {
   public Schema getSchema() {
     return schema;
   }
-  /**
-   * Return the user
-   *
-   * @return
-   */
-  public String getUser() {
-    return user;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2fc4a75/common/src/main/java/org/apache/sqoop/job/etl/InitializerContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/job/etl/InitializerContext.java b/common/src/main/java/org/apache/sqoop/job/etl/InitializerContext.java
index 7ad0d70..6212f43 100644
--- a/common/src/main/java/org/apache/sqoop/job/etl/InitializerContext.java
+++ b/common/src/main/java/org/apache/sqoop/job/etl/InitializerContext.java
@@ -31,11 +31,8 @@ import org.apache.sqoop.common.MutableContext;
 @InterfaceStability.Unstable
 public class InitializerContext extends TransferableContext {
 
-  private String user;
-
   public InitializerContext(MutableContext context, String user) {
-    super(context);
-    this.user = user;
+    super(context, user);
   }
 
   /**
@@ -51,12 +48,4 @@ public class InitializerContext extends TransferableContext {
     return (MutableContext)super.getContext();
   }
 
-  /**
-   * Return the user
-   *
-   * @return
-   */
-  public String getUser() {
-    return user;
-  }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2fc4a75/common/src/main/java/org/apache/sqoop/job/etl/LoaderContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/job/etl/LoaderContext.java b/common/src/main/java/org/apache/sqoop/job/etl/LoaderContext.java
index f0f2e38..48f8e02 100644
--- a/common/src/main/java/org/apache/sqoop/job/etl/LoaderContext.java
+++ b/common/src/main/java/org/apache/sqoop/job/etl/LoaderContext.java
@@ -36,13 +36,10 @@ public class LoaderContext extends TransferableContext {
 
   private final Schema schema;
 
-  private final String user;
-
   public LoaderContext(ImmutableContext context, DataReader reader, Schema schema, String
user) {
-    super(context);
+    super(context, user);
     this.reader = reader;
     this.schema = schema;
-    this.user = user;
   }
 
   /**
@@ -62,14 +59,4 @@ public class LoaderContext extends TransferableContext {
   public Schema getSchema() {
     return schema;
   }
-
-  /**
-   * Return the String representing the user.
-   *
-   * @return
-   */
-  public String getUser() {
-    return user;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2fc4a75/common/src/main/java/org/apache/sqoop/job/etl/PartitionerContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/job/etl/PartitionerContext.java b/common/src/main/java/org/apache/sqoop/job/etl/PartitionerContext.java
index b39497b..df31cae 100644
--- a/common/src/main/java/org/apache/sqoop/job/etl/PartitionerContext.java
+++ b/common/src/main/java/org/apache/sqoop/job/etl/PartitionerContext.java
@@ -37,13 +37,10 @@ public class PartitionerContext extends TransferableContext {
 
   private boolean skipMaxPartitionCheck = false;
 
-  private String user;
-
   public PartitionerContext(ImmutableContext context, long maxPartitions, Schema schema,
String user) {
-    super(context);
+    super(context, user);
     this.maxPartitions = maxPartitions;
     this.schema = schema;
-    this.user = user;
   }
 
   /**
@@ -92,13 +89,4 @@ public class PartitionerContext extends TransferableContext {
   public Schema getSchema() {
     return schema;
   }
-
-  /**
-   * Return user that submitted job
-   *
-   * @return
-   */
-  public String getUser() {
-    return user;
-  }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2fc4a75/common/src/main/java/org/apache/sqoop/job/etl/TransferableContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/job/etl/TransferableContext.java b/common/src/main/java/org/apache/sqoop/job/etl/TransferableContext.java
index ad18e29..eccb93e 100644
--- a/common/src/main/java/org/apache/sqoop/job/etl/TransferableContext.java
+++ b/common/src/main/java/org/apache/sqoop/job/etl/TransferableContext.java
@@ -30,8 +30,11 @@ public abstract class TransferableContext {
 
   ImmutableContext context;
 
-  public TransferableContext(ImmutableContext context) {
+  private String user;
+
+  public TransferableContext(ImmutableContext context, String user) {
     this.context = context;
+    this.user = user;
   }
 
   /**
@@ -77,4 +80,11 @@ public abstract class TransferableContext {
   public boolean getBoolean(String key, boolean defaultValue) {
     return context.getBoolean(key, defaultValue);
   }
+
+  /**
+   * Return user who started this job (e.g. the one who run "start job" in shell)
+   */
+  public String getUser() {
+    return user;
+  }
 }


Mime
View raw message