sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-988: Validation option should provide some output that validation is being done
Date Tue, 16 Apr 2013 16:58:08 GMT
Updated Branches:
  refs/heads/trunk 2d3341488 -> 7567315de


SQOOP-988: Validation option should provide some output that validation is being done

(Venkat Ranganathan via Jarek Jarcec Cecho)


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

Branch: refs/heads/trunk
Commit: 7567315de6056117755c2dd78fc02480ae12c884
Parents: 2d33414
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Apr 16 09:56:29 2013 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Apr 16 09:56:29 2013 -0700

----------------------------------------------------------------------
 src/java/com/cloudera/sqoop/mapreduce/JobBase.java |   24 ++++++++++++--
 .../apache/sqoop/validation/RowCountValidator.java |    1 +
 2 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/7567315d/src/java/com/cloudera/sqoop/mapreduce/JobBase.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/mapreduce/JobBase.java b/src/java/com/cloudera/sqoop/mapreduce/JobBase.java
index b89612d..974422a 100644
--- a/src/java/com/cloudera/sqoop/mapreduce/JobBase.java
+++ b/src/java/com/cloudera/sqoop/mapreduce/JobBase.java
@@ -18,23 +18,29 @@
 
 package com.cloudera.sqoop.mapreduce;
 
+import java.io.IOException;
+import java.sql.SQLException;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.mapreduce.InputFormat;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.mapreduce.OutputFormat;
-import com.cloudera.sqoop.SqoopOptions;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.apache.sqoop.config.ConfigurationHelper;
 import org.apache.sqoop.manager.ConnManager;
-import org.apache.sqoop.validation.*;
+import org.apache.sqoop.validation.ValidationContext;
+import org.apache.sqoop.validation.ValidationException;
+import org.apache.sqoop.validation.ValidationFailureHandler;
+import org.apache.sqoop.validation.ValidationThreshold;
+import org.apache.sqoop.validation.Validator;
 
-import java.io.IOException;
-import java.sql.SQLException;
+import com.cloudera.sqoop.SqoopOptions;
 
 /**
  * @deprecated Moving to use org.apache.sqoop namespace.
  */
+@Deprecated
 public class JobBase
     extends org.apache.sqoop.mapreduce.JobBase {
 
@@ -75,6 +81,16 @@ public class JobBase
         ReflectionUtils.newInstance(options.getValidationFailureHandlerClass(),
           conf);
 
+    StringBuilder sb = new StringBuilder();
+    sb.append("Validating the integrity of the import using the "
+      + "following configuration\n");
+    sb.append("\tValidator : ").append(validator.getClass().getName())
+      .append('\n');
+    sb.append("\tThreshold Specifier : ")
+      .append(threshold.getClass().getName()).append('\n');
+    sb.append("\tFailure Handler : ")
+      .append(failureHandler.getClass().getName()).append('\n');
+    LOG.info(sb.toString());
     validator.validate(validationContext, threshold, failureHandler);
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7567315d/src/java/org/apache/sqoop/validation/RowCountValidator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/validation/RowCountValidator.java b/src/java/org/apache/sqoop/validation/RowCountValidator.java
index ca21232..fb4fbc2 100644
--- a/src/java/org/apache/sqoop/validation/RowCountValidator.java
+++ b/src/java/org/apache/sqoop/validation/RowCountValidator.java
@@ -51,6 +51,7 @@ public class RowCountValidator implements Validator {
 
     if (validationThreshold.compare(validationContext.getSourceRowCount(),
       validationContext.getTargetRowCount())) {
+      LOG.info("Data successfully validated");
       return true;
     }
 


Mime
View raw message