sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [2/2] sqoop git commit: SQOOP-2054: Sqoop2: Client cannot understand server exceptions
Date Fri, 30 Jan 2015 21:18:50 GMT
SQOOP-2054: Sqoop2: Client cannot understand server exceptions

(Richard Zhou via Abraham Elmahrek)


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

Branch: refs/heads/sqoop2
Commit: f7efa38005525e2fb22ce1af0323bf265d719c00
Parents: d7ba495
Author: Abraham Elmahrek <abe@apache.org>
Authored: Fri Jan 30 13:16:24 2015 -0800
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Fri Jan 30 13:16:24 2015 -0800

----------------------------------------------------------------------
 .../code/AVROIntermediateDataFormatError.java   |  47 +++++
 .../code/CSVIntermediateDataFormatError.java    |  64 ++++++
 .../sqoop/error/code/CommonRepositoryError.java | 201 +++++++++++++++++++
 .../sqoop/error/code/ConfigurableError.java     |  46 +++++
 .../apache/sqoop/error/code/DerbyRepoError.java |  74 +++++++
 .../error/code/GenericJdbcConnectorError.java   | 103 ++++++++++
 .../sqoop/error/code/HdfsConnectorError.java    |  53 +++++
 .../error/code/IntermediateDataFormatError.java |  60 ++++++
 .../code/JSONIntermediateDataFormatError.java   |  51 +++++
 .../sqoop/error/code/KafkaConnectorErrors.java  |  46 +++++
 .../sqoop/error/code/KiteConnectorError.java    |  52 +++++
 .../sqoop/error/code/MRExecutionError.java      |  97 +++++++++
 .../error/code/MapreduceSubmissionError.java    |  52 +++++
 .../apache/sqoop/error/code/MatcherError.java   |  45 +++++
 .../sqoop/error/code/PostgresqlRepoError.java   |  51 +++++
 .../apache/sqoop/error/code/ServerError.java    |  57 ++++++
 .../jdbc/GenericJdbcConnectorError.java         | 103 ----------
 .../connector/jdbc/GenericJdbcExecutor.java     |   1 +
 .../connector/jdbc/GenericJdbcExtractor.java    |   1 +
 .../jdbc/GenericJdbcFromInitializer.java        |   3 +-
 .../connector/jdbc/GenericJdbcPartitioner.java  |   1 +
 .../jdbc/GenericJdbcToInitializer.java          |   3 +-
 .../sqoop/connector/hdfs/HdfsConnector.java     |   1 +
 .../connector/hdfs/HdfsConnectorError.java      |  53 -----
 .../sqoop/connector/hdfs/HdfsExtractor.java     |   1 +
 .../apache/sqoop/connector/hdfs/HdfsLoader.java |   1 +
 .../sqoop/connector/hdfs/HdfsPartitioner.java   |   1 +
 .../connector/kafka/KafkaConnectorErrors.java   |  46 -----
 .../sqoop/connector/kafka/KafkaLoader.java      |   1 +
 .../connector/kite/KiteConnectorError.java      |  52 -----
 .../connector/kite/KiteDatasetExecutor.java     |   1 +
 .../connector/kite/KiteFromInitializer.java     |   1 +
 .../sqoop/connector/kite/KiteToInitializer.java |   1 +
 .../sqoop/configurable/ConfigurableError.java   |  46 -----
 .../sqoop/connector/common/SqoopAvroUtils.java  |   2 +-
 .../sqoop/connector/common/SqoopIDFUtils.java   |   4 +-
 .../idf/AVROIntermediateDataFormat.java         |   1 +
 .../idf/AVROIntermediateDataFormatError.java    |  47 -----
 .../idf/CSVIntermediateDataFormat.java          |   1 +
 .../idf/CSVIntermediateDataFormatError.java     |  64 ------
 .../connector/idf/IntermediateDataFormat.java   |   1 +
 .../idf/IntermediateDataFormatError.java        |  60 ------
 .../idf/JSONIntermediateDataFormat.java         |   2 +
 .../idf/JSONIntermediateDataFormatError.java    |  51 -----
 .../sqoop/connector/matcher/MatcherError.java   |  45 -----
 .../spi/ConnectorConfigurableUpgrader.java      |   2 +-
 .../org/apache/sqoop/job/MRExecutionError.java  |  97 ---------
 .../apache/sqoop/job/mr/SqoopInputFormat.java   |   2 +-
 .../org/apache/sqoop/job/mr/SqoopMapper.java    |   2 +-
 .../job/mr/SqoopOutputFormatLoadExecutor.java   |   2 +-
 .../org/apache/sqoop/job/mr/SqoopSplit.java     |   2 +-
 .../common/CommonRepositoryError.java           | 201 -------------------
 .../common/CommonRepositoryHandler.java         |   1 +
 .../sqoop/repository/derby/DerbyRepoError.java  |  74 -------
 .../derby/DerbyRepositoryHandler.java           |   1 +
 .../sqoop/repository/derby/TestJobHandling.java |   2 +-
 .../repository/derby/TestLinkHandling.java      |   2 +-
 .../postgresql/PostgresqlRepoError.java         |  51 -----
 .../postgresql/PostgresqlRepositoryHandler.java |   1 +
 .../sqoop/handler/ConnectorRequestHandler.java  |   2 +-
 .../sqoop/handler/DriverRequestHandler.java     |   2 +-
 .../org/apache/sqoop/handler/HandlerUtils.java  |   2 +-
 .../apache/sqoop/handler/JobRequestHandler.java |   2 +-
 .../sqoop/handler/LinkRequestHandler.java       |   2 +-
 .../sqoop/handler/SubmissionRequestHandler.java |   2 +-
 .../sqoop/handler/VersionRequestHandler.java    |   2 +-
 .../org/apache/sqoop/server/RequestContext.java |   2 +-
 .../apache/sqoop/server/common/ServerError.java |  57 ------
 .../mapreduce/MapreduceSubmissionEngine.java    |   1 +
 .../mapreduce/MapreduceSubmissionError.java     |  52 -----
 70 files changed, 1139 insertions(+), 1121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/AVROIntermediateDataFormatError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/AVROIntermediateDataFormatError.java b/common/src/main/java/org/apache/sqoop/error/code/AVROIntermediateDataFormatError.java
new file mode 100644
index 0000000..d4ca193
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/AVROIntermediateDataFormatError.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.classification.InterfaceAudience;
+import org.apache.sqoop.classification.InterfaceStability;
+import org.apache.sqoop.common.ErrorCode;
+
+@InterfaceAudience.Public
+@InterfaceStability.Unstable
+public enum AVROIntermediateDataFormatError implements ErrorCode {
+  /** An unknown error has occurred. */
+  AVRO_INTERMEDIATE_DATA_FORMAT_0000("An unknown error has occurred."),
+
+  ;
+
+  private final String message;
+
+  private AVROIntermediateDataFormatError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/CSVIntermediateDataFormatError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/CSVIntermediateDataFormatError.java b/common/src/main/java/org/apache/sqoop/error/code/CSVIntermediateDataFormatError.java
new file mode 100644
index 0000000..cb80132
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/CSVIntermediateDataFormatError.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.classification.InterfaceAudience;
+import org.apache.sqoop.classification.InterfaceStability;
+import org.apache.sqoop.common.ErrorCode;
+
+@InterfaceAudience.Public
+@InterfaceStability.Unstable
+public enum CSVIntermediateDataFormatError implements ErrorCode {
+  /** An unknown error has occurred. */
+  CSV_INTERMEDIATE_DATA_FORMAT_0000("An unknown error has occurred."),
+
+  /** An encoding is missing in the Java native libraries. */
+  CSV_INTERMEDIATE_DATA_FORMAT_0001("Native character set error."),
+
+  /** Error while escaping a row. */
+  CSV_INTERMEDIATE_DATA_FORMAT_0002("An error has occurred while escaping a row."),
+
+  /** Error while escaping a row. */
+  CSV_INTERMEDIATE_DATA_FORMAT_0003("An error has occurred while unescaping a row."),
+
+  /**
+   * For arrays and maps we use JSON representation and incorrect representation
+   * results in parse exception
+   */
+  CSV_INTERMEDIATE_DATA_FORMAT_0004("JSON parse internal error."),
+
+  /** Unsupported bit values */
+  CSV_INTERMEDIATE_DATA_FORMAT_0005("Unsupported bit value."),
+
+  ;
+
+  private final String message;
+
+  private CSVIntermediateDataFormatError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/CommonRepositoryError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/CommonRepositoryError.java b/common/src/main/java/org/apache/sqoop/error/code/CommonRepositoryError.java
new file mode 100644
index 0000000..952be3f
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/CommonRepositoryError.java
@@ -0,0 +1,201 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum CommonRepositoryError implements ErrorCode {
+  // JDBC Repository Handler Errors: Prefix COMMON
+
+  /** The system was unable to run the specified query. */
+  COMMON_0000("Unable to run specified query"),
+
+  /** The system was unable to query the repository for given entity */
+  COMMON_0001("Unable to retrieve entity data"),
+
+  /** The repository contains more than one connector with same name */
+  COMMON_0002("Invalid entity state - multiple connectors with name"),
+
+  /** The system does not support the given input type.*/
+  COMMON_0003("Unknown input type encountered"),
+
+  /** The system does not support the given config type.*/
+  COMMON_0004("Unknown config type encountered"),
+
+  /** No input was found for the given config. */
+  COMMON_0005("The config contains no input"),
+
+  /** The system could not load the config due to unexpected position of input.*/
+  COMMON_0006("The config input retrieved does not match expected position"),
+
+  /**
+   * The system could not load the connector due to unexpected position
+   * of config.
+   */
+  COMMON_0007("The config retrieved does not match expected position"),
+
+  /**
+   * The system was not able to register entity due to a pre-assigned
+   * persistence identifier.
+   */
+  COMMON_0008("Entity cannot have preassigned persistence id"),
+
+  /**
+   * The system was unable to register various entities.
+   */
+  COMMON_0009("Unexpected update count when registering entity"),
+
+  /**
+   * The system was unable to register entity due to a failure to retrieve
+   * the generated identifier.
+   */
+  COMMON_0010("Unable to retrieve generated identifier"),
+
+  /**
+   * The system was unable to register connector due to a server
+   * error.
+   */
+  COMMON_0011("Registration of connector failed"),
+
+  /**
+   * The system was not able to register connector due to an unexpected
+   * update count.
+   */
+  COMMON_0012("Unexpected update count on config registration"),
+
+  /**
+   * The system was unable to register connector due to a failure to
+   * retrieve the generated identifier for a config.
+   */
+  COMMON_0013("Unable to retrieve generated identifier for config"),
+
+  /**
+   * The system was unable to register connector due to an unexpected
+   * update count for config input registration.
+   */
+  COMMON_0014("Unexpected update count for config input"),
+
+  /**
+   * The system was unable to register connector due to a failure to
+   * retrieve the generated identifier for a config input.
+   */
+  COMMON_0015("Unable to retrieve generated identifier for config input"),
+
+  /** We cant create new link in repository **/
+  COMMON_0016("Unable to create new link data"),
+
+  /** We can't save values for input to repository **/
+  COMMON_0017("Unable to save input values to the repository"),
+
+  /** We can't update link in repository **/
+  COMMON_0018("Unable to update link in repository"),
+
+  /** We can't delete link in repository **/
+  COMMON_0019("Unable to delete link in repository"),
+
+  /** We can't restore link from repository **/
+  COMMON_0020("Unable to load link from repository"),
+
+  /** We can't restore specific link from repository **/
+  COMMON_0021("Unable to load specific link from repository"),
+
+  /** We're unable to check if given link already exists */
+  COMMON_0022("Unable to check if given link exists"),
+
+  /** We cant create new job in repository **/
+  COMMON_0023("Unable to create new job data"),
+
+  /** We can't update job in repository **/
+  COMMON_0024("Unable to update job in repository"),
+
+  /** We can't delete job in repository **/
+  COMMON_0025("Unable to delete job in repository"),
+
+  /** We're unable to check if given job already exists */
+  COMMON_0026("Unable to check if given job exists"),
+
+  /** We can't restore specific job from repository **/
+  COMMON_0027("Unable to load specific job from repository"),
+
+  /** We can't restore job from repository **/
+  COMMON_0028("Unable to load job from repository"),
+
+  /** Can't verify if link is referenced from somewhere **/
+  COMMON_0029("Unable to check if link is in use"),
+
+  /** We're unable to check if given submission already exists */
+  COMMON_0030("Unable to check if given submission exists"),
+
+  /** We cant create new submission in repository **/
+  COMMON_0031("Unable to create new submission data"),
+
+  /** We can't update submission in repository **/
+  COMMON_0032("Unable to update submission in the repository"),
+
+  /** Can't purge old submissions **/
+  COMMON_0033("Unable to purge old submissions"),
+
+  /** Can't retrieve unfinished submissions **/
+  COMMON_0034("Can't retrieve unfinished submissions"),
+
+  /** Can't update connector **/
+  COMMON_0035("Update of connector failed"),
+
+  /** Can't retrieve all submissions **/
+  COMMON_0036("Can't retrieve all submissions"),
+
+  /** Can't retrieve submissions for a job **/
+  COMMON_0037("Can't retrieve submissions for a job"),
+
+  /** Can't enable/disable link **/
+  COMMON_0038("Can't enable/disable link"),
+
+  /** Can't enable/disable job **/
+  COMMON_0039("Can't enable/disable job"),
+
+  /** Can't update driver config **/
+  COMMON_0040("Update of driver config failed"),
+
+  /** Can't retrieve all connectors **/
+  COMMON_0041("Can't retrieve all connectors"),
+
+  /** Can't register config direction **/
+  COMMON_0042("Could not register config direction"),
+
+  /** Can't set connector direction **/
+  COMMON_0043("Could not set connector direction"),
+
+  /** The system was unable to register driver due to a server error **/
+  COMMON_0044("Registration of driver failed")
+
+  ;
+
+  private final String message;
+
+  private CommonRepositoryError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/ConfigurableError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/ConfigurableError.java b/common/src/main/java/org/apache/sqoop/error/code/ConfigurableError.java
new file mode 100644
index 0000000..551fc59
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/ConfigurableError.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.classification.InterfaceAudience;
+import org.apache.sqoop.classification.InterfaceStability;
+import org.apache.sqoop.common.ErrorCode;
+
+@InterfaceAudience.Public
+@InterfaceStability.Unstable
+public enum ConfigurableError implements ErrorCode {
+
+  /** An unknown error has occurred. */
+  CONFIGURABLE_0001("Link object upgrade called, but no upgrade routine provided for LINK config"),
+  CONFIGURABLE_0002("Job object upgrade called, but no upgrade routine provided for FROM job config"),
+  CONFIGURABLE_0003("Job object upgrade called, but no upgrade routine provided for TO job config"),
+ ;
+  private final String message;
+
+  private ConfigurableError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/DerbyRepoError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/DerbyRepoError.java b/common/src/main/java/org/apache/sqoop/error/code/DerbyRepoError.java
new file mode 100644
index 0000000..dddc3d8
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/DerbyRepoError.java
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum DerbyRepoError implements ErrorCode {
+
+  /** An unknown error has occurred. */
+  DERBYREPO_0000("An unknown error has occurred"),
+
+  /** The system was unable to shutdown embedded derby repository server. */
+  DERBYREPO_0001("Unable to shutdown embedded  Derby instance"),
+
+  /** The system was unable to run the specified query. */
+  DERBYREPO_0002("Unable to run specified query"),
+
+  /**
+   * The system was unable to register various entities.
+   */
+  DERBYREPO_0003("Unexpected update count when registering entity"),
+
+  /**
+   * The system was unable to register entity due to a failure to retrieve
+   * the generated identifier.
+   */
+  DERBYREPO_0004("Unable to retrieve generated identifier"),
+
+  /** We cant create new link in repository **/
+  DERBYREPO_0005("Unable to create new link data"),
+
+  /** Can't detect version of the database structures **/
+  DERBYREPO_0006("Can't detect version of repository storage"),
+
+  /** Can't add directions **/
+  DERBYREPO_0007("Could not add directions"),
+
+  /** Can't get ID of direction **/
+  DERBYREPO_0008("Could not get ID of recently added direction"),
+
+  /** The system was unable to register driver due to a server error **/
+  DERBYREPO_0009("Registration of driver failed"),
+
+  ;
+
+  private final String message;
+
+  private DerbyRepoError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/GenericJdbcConnectorError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/GenericJdbcConnectorError.java b/common/src/main/java/org/apache/sqoop/error/code/GenericJdbcConnectorError.java
new file mode 100644
index 0000000..03bc104
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/GenericJdbcConnectorError.java
@@ -0,0 +1,103 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum GenericJdbcConnectorError implements ErrorCode {
+
+  /** Unable to load the driver class. */
+  GENERIC_JDBC_CONNECTOR_0000("Unable to load the driver class"),
+
+  /** Unable to get a connection. */
+  GENERIC_JDBC_CONNECTOR_0001("Unable to get a connection"),
+
+  /** Unable to execute the SQL statement. */
+  GENERIC_JDBC_CONNECTOR_0002("Unable to execute the SQL statement"),
+
+  /** Unable to access meta data. */
+  GENERIC_JDBC_CONNECTOR_0003("Unable to access meta data"),
+
+  /** Error occurs while retrieving data from result. */
+  GENERIC_JDBC_CONNECTOR_0004("Error occurs while retrieving data from result"),
+
+  /** No column is found to partition data. */
+  GENERIC_JDBC_CONNECTOR_0005("No column is found to partition data"),
+
+  /** No boundaries are found for partition column. */
+  GENERIC_JDBC_CONNECTOR_0006("No boundaries are found for partition column"),
+
+  /** The table name and the table sql cannot be specify together. */
+  GENERIC_JDBC_CONNECTOR_0007("The table name and the table sql "
+      + "cannot be specified together"),
+
+  /** Neither the table name nor the table sql are specified. */
+  GENERIC_JDBC_CONNECTOR_0008("Neither the table name nor the table sql "
+      + "are specified"),
+
+  /** No substitute token in the specified sql. */
+  GENERIC_JDBC_CONNECTOR_0010("No substitute token in the specified sql"),
+
+  /** The type is not supported. */
+  GENERIC_JDBC_CONNECTOR_0011("The type is not supported"),
+
+  /** The required option has not been set yet. */
+  GENERIC_JDBC_CONNECTOR_0012("The required option has not been set yet"),
+
+  /** No parameter marker in the specified sql. */
+  GENERIC_JDBC_CONNECTOR_0013("No parameter marker in the specified sql"),
+
+  /** The table columns cannot be specified when
+   *  the table sql is specified during export. */
+  GENERIC_JDBC_CONNECTOR_0014("The table columns cannot be specified "
+      + "when the table sql is specified during export"),
+
+  /** Unsupported values in partition column */
+  GENERIC_JDBC_CONNECTOR_0015("Partition column contains unsupported values"),
+
+  /** Can't fetch schema */
+  GENERIC_JDBC_CONNECTOR_0016("Can't fetch schema"),
+
+  /** Neither the table name nor the table sql are specified. */
+  GENERIC_JDBC_CONNECTOR_0017("The stage table is not empty."),
+
+  GENERIC_JDBC_CONNECTOR_0018("Error occurred while transferring data from " +
+    "stage table to destination table."),
+
+  GENERIC_JDBC_CONNECTOR_0019("Table name extraction not supported."),
+
+  GENERIC_JDBC_CONNECTOR_0020("Unknown direction."),
+
+  GENERIC_JDBC_CONNECTOR_0021("Schema column size do not match the result set column size"),
+
+  ;
+
+  private final String message;
+
+  private GenericJdbcConnectorError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/HdfsConnectorError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/HdfsConnectorError.java b/common/src/main/java/org/apache/sqoop/error/code/HdfsConnectorError.java
new file mode 100644
index 0000000..8514541
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/HdfsConnectorError.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum HdfsConnectorError implements ErrorCode{
+  /** Error occurs during partitioner run */
+  GENERIC_HDFS_CONNECTOR_0000("Error occurs during partitioner run"),
+  /** Error occurs during extractor run */
+  GENERIC_HDFS_CONNECTOR_0001("Error occurs during extractor run"),
+  /** Unsupported output format type found **/
+  GENERIC_HDFS_CONNECTOR_0002("Unknown output format type"),
+  /** The system was unable to load the specified class. */
+  GENERIC_HDFS_CONNECTOR_0003("Unable to load the specified class"),
+  /** The system was unable to instantiate the specified class. */
+  GENERIC_HDFS_CONNECTOR_0004("Unable to instantiate the specified class"),
+  /** Error occurs during loader run */
+  GENERIC_HDFS_CONNECTOR_0005("Error occurs during loader run"),
+  GENERIC_HDFS_CONNECTOR_0006("Unknown job type")
+
+  ;
+
+  private final String message;
+
+  private HdfsConnectorError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/IntermediateDataFormatError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/IntermediateDataFormatError.java b/common/src/main/java/org/apache/sqoop/error/code/IntermediateDataFormatError.java
new file mode 100644
index 0000000..ce529a9
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/IntermediateDataFormatError.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.classification.InterfaceAudience;
+import org.apache.sqoop.classification.InterfaceStability;
+import org.apache.sqoop.common.ErrorCode;
+
+@InterfaceAudience.Public
+@InterfaceStability.Unstable
+public enum IntermediateDataFormatError implements ErrorCode {
+  /** An unknown error has occurred. */
+  INTERMEDIATE_DATA_FORMAT_0000("An unknown error has occurred."),
+
+  /** Number of columns in schema does not match the data set. */
+  INTERMEDIATE_DATA_FORMAT_0001("Wrong number of columns."),
+
+  /** Schema is missing in the IDF. */
+  INTERMEDIATE_DATA_FORMAT_0002("Schema is null."),
+
+  INTERMEDIATE_DATA_FORMAT_0003("JSON parse error"),
+
+  /** Column type isn't known by Intermediate Data Format. */
+  INTERMEDIATE_DATA_FORMAT_0004("Unknown column type."),
+
+  /** Column value cannot be null. */
+  INTERMEDIATE_DATA_FORMAT_0005("Column value cannot be null"),
+
+  ;
+
+  private final String message;
+
+  private IntermediateDataFormatError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/JSONIntermediateDataFormatError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/JSONIntermediateDataFormatError.java b/common/src/main/java/org/apache/sqoop/error/code/JSONIntermediateDataFormatError.java
new file mode 100644
index 0000000..db8d0c7
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/JSONIntermediateDataFormatError.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.classification.InterfaceAudience;
+import org.apache.sqoop.classification.InterfaceStability;
+import org.apache.sqoop.common.ErrorCode;
+
+@InterfaceAudience.Public
+@InterfaceStability.Unstable
+public enum JSONIntermediateDataFormatError implements ErrorCode {
+  /** An unknown error has occurred. */
+  JSON_INTERMEDIATE_DATA_FORMAT_0000("An unknown error has occurred."),
+
+  JSON_INTERMEDIATE_DATA_FORMAT_0001("JSON array parse error."),
+
+  JSON_INTERMEDIATE_DATA_FORMAT_0002("JSON object parse error."),
+
+  ;
+
+  private final String message;
+
+  private JSONIntermediateDataFormatError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/KafkaConnectorErrors.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/KafkaConnectorErrors.java b/common/src/main/java/org/apache/sqoop/error/code/KafkaConnectorErrors.java
new file mode 100644
index 0000000..436b852
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/KafkaConnectorErrors.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum KafkaConnectorErrors implements ErrorCode {
+
+  KAFKA_CONNECTOR_0000("Unknown error occurred."),
+  KAFKA_CONNECTOR_0001("Error occurred while sending data to Kafka")
+  ;
+
+  private final String message;
+
+  private KafkaConnectorErrors(String message) {
+    this.message = message;
+  }
+
+  @Override
+  public String getCode() {
+    return name();
+  }
+
+  /**
+   * @return the message associated with error code.
+   */
+  @Override
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/KiteConnectorError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/KiteConnectorError.java b/common/src/main/java/org/apache/sqoop/error/code/KiteConnectorError.java
new file mode 100644
index 0000000..7db9904
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/KiteConnectorError.java
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum KiteConnectorError implements ErrorCode {
+
+  /** Unsupported dataset URI scheme */
+  GENERIC_KITE_CONNECTOR_0000("Unsupported dataset URI scheme"),
+
+  /** Target dataset is not empty */
+  GENERIC_KITE_CONNECTOR_0001("Dataset is not empty"),
+
+  /** Dataset does not exist */
+  GENERIC_KITE_CONNECTOR_0002("Dataset does not exist"),
+
+  /** Error occurred while creating partitions */
+  GENERIC_KITE_CONNECTOR_0003("Error occurred while creating partitions"),
+
+  ;
+
+  private final String message;
+
+  private KiteConnectorError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/MRExecutionError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/MRExecutionError.java b/common/src/main/java/org/apache/sqoop/error/code/MRExecutionError.java
new file mode 100644
index 0000000..21e5c82
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/MRExecutionError.java
@@ -0,0 +1,97 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+/**
+ *
+ */
+public enum MRExecutionError implements ErrorCode {
+
+  MAPRED_EXEC_0000("Unknown error"),
+
+  /** Error occurs during job execution. */
+  MAPRED_EXEC_0008("Error occurs during job execution"),
+
+  /** The system was unable to load the specified class. */
+  MAPRED_EXEC_0009("Unable to load the specified class"),
+
+  /** The system was unable to instantiate the specified class. */
+  MAPRED_EXEC_0010("Unable to instantiate the specified class"),
+
+  /** The parameter already exists in the context */
+  MAPRED_EXEC_0011("The parameter already exists in the context"),
+
+  /** The type is not supported */
+  MAPRED_EXEC_0012("The type is not supported"),
+
+  /** Cannot write to the data writer */
+  MAPRED_EXEC_0013("Cannot write to the data writer"),
+
+  /** Cannot read from the data reader */
+  MAPRED_EXEC_0014("Cannot read to the data reader"),
+
+  /** Unable to write data due to interrupt */
+  MAPRED_EXEC_0015("Unable to write data due to interrupt"),
+
+  /** Unable to read data due to interrupt */
+  MAPRED_EXEC_0016("Unable to read data due to interrupt"),
+
+  /** Error occurs during extractor run */
+  MAPRED_EXEC_0017("Error occurs during extractor run"),
+
+  /** Error occurs during loader run */
+  MAPRED_EXEC_0018("Error occurs during loader run"),
+
+  MAPRED_EXEC_0019("Data have not been completely consumed yet"),
+
+  /** The required option has not been set yet */
+  MAPRED_EXEC_0020("The required option has not been set yet"),
+
+  /** Error occurs during partitioner run */
+  MAPRED_EXEC_0021("Error occurs during partitioner run"),
+
+  /** Unable to parse because it is not properly delimited */
+  MAPRED_EXEC_0022("Unable to parse because it is not properly delimited"),
+
+  /** Unknown job type */
+  MAPRED_EXEC_0023("Unknown job type"),
+
+  /** Unsupported output format type found **/
+  MAPRED_EXEC_0024("Unknown output format type"),
+
+  /** Got invalid number of partitions from Partitioner */
+  MAPRED_EXEC_0025("Retrieved invalid number of partitions from Partitioner"),
+
+  ;
+
+  private final String message;
+
+  private MRExecutionError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/MapreduceSubmissionError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/MapreduceSubmissionError.java b/common/src/main/java/org/apache/sqoop/error/code/MapreduceSubmissionError.java
new file mode 100644
index 0000000..0a38bba
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/MapreduceSubmissionError.java
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+/**
+ *
+ */
+public enum MapreduceSubmissionError implements ErrorCode {
+
+  MAPREDUCE_0001("Unknown error"),
+
+  MAPREDUCE_0002("Failure on submission engine initialization"),
+
+  MAPREDUCE_0003("Can't get RunningJob instance"),
+
+  MAPREDUCE_0004("Unknown map reduce job status"),
+
+  MAPREDUCE_0005("Failure on submission engine destroy"),
+
+  ;
+
+  private final String message;
+
+  private MapreduceSubmissionError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/MatcherError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/MatcherError.java b/common/src/main/java/org/apache/sqoop/error/code/MatcherError.java
new file mode 100644
index 0000000..5269c56
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/MatcherError.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.classification.InterfaceAudience;
+import org.apache.sqoop.classification.InterfaceStability;
+import org.apache.sqoop.common.ErrorCode;
+
+@InterfaceAudience.Public
+@InterfaceStability.Unstable
+public enum MatcherError implements ErrorCode {
+  MATCHER_0000("To few Schemas provided."),
+
+  ;
+
+  private final String message;
+
+  private MatcherError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/PostgresqlRepoError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/PostgresqlRepoError.java b/common/src/main/java/org/apache/sqoop/error/code/PostgresqlRepoError.java
new file mode 100644
index 0000000..29b8342
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/PostgresqlRepoError.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum PostgresqlRepoError implements ErrorCode {
+
+  POSTGRESQLREPO_0000("An unknown error has occurred"),
+
+  POSTGRESQLREPO_0001("Unable to run specified query"),
+
+  POSTGRESQLREPO_0002("Update of driver config failed"),
+
+  POSTGRESQLREPO_0003("Could not add directions"),
+
+  POSTGRESQLREPO_0004("Could not get ID of recently added direction"),
+
+  POSTGRESQLREPO_0005("Unsupported repository version"),
+
+  ;
+
+  private final String message;
+
+  private PostgresqlRepoError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/common/src/main/java/org/apache/sqoop/error/code/ServerError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/ServerError.java b/common/src/main/java/org/apache/sqoop/error/code/ServerError.java
new file mode 100644
index 0000000..86cca7d
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/error/code/ServerError.java
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.error.code;
+
+import org.apache.sqoop.common.ErrorCode;
+
+/**
+ *
+ */
+public enum ServerError implements ErrorCode {
+
+  /** Unknown error on server side. */
+  SERVER_0001("Unknown server error"),
+
+  /** Unknown error on server side. */
+  SERVER_0002("Unsupported HTTP method"),
+
+  /** We've received invalid HTTP request */
+  SERVER_0003("Invalid HTTP request"),
+
+  /** Invalid argument in HTTP request */
+  SERVER_0004("Invalid argument in HTTP request"),
+
+  /** Invalid entity requested */
+  SERVER_0005("Invalid entity requested"),
+
+  ;
+
+  private final String message;
+
+  private ServerError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorError.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorError.java b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorError.java
deleted file mode 100644
index 0fa4a32..0000000
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorError.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.connector.jdbc;
-
-import org.apache.sqoop.common.ErrorCode;
-
-public enum GenericJdbcConnectorError implements ErrorCode {
-
-  /** Unable to load the driver class. */
-  GENERIC_JDBC_CONNECTOR_0000("Unable to load the driver class"),
-
-  /** Unable to get a connection. */
-  GENERIC_JDBC_CONNECTOR_0001("Unable to get a connection"),
-
-  /** Unable to execute the SQL statement. */
-  GENERIC_JDBC_CONNECTOR_0002("Unable to execute the SQL statement"),
-
-  /** Unable to access meta data. */
-  GENERIC_JDBC_CONNECTOR_0003("Unable to access meta data"),
-
-  /** Error occurs while retrieving data from result. */
-  GENERIC_JDBC_CONNECTOR_0004("Error occurs while retrieving data from result"),
-
-  /** No column is found to partition data. */
-  GENERIC_JDBC_CONNECTOR_0005("No column is found to partition data"),
-
-  /** No boundaries are found for partition column. */
-  GENERIC_JDBC_CONNECTOR_0006("No boundaries are found for partition column"),
-
-  /** The table name and the table sql cannot be specify together. */
-  GENERIC_JDBC_CONNECTOR_0007("The table name and the table sql "
-      + "cannot be specified together"),
-
-  /** Neither the table name nor the table sql are specified. */
-  GENERIC_JDBC_CONNECTOR_0008("Neither the table name nor the table sql "
-      + "are specified"),
-
-  /** No substitute token in the specified sql. */
-  GENERIC_JDBC_CONNECTOR_0010("No substitute token in the specified sql"),
-
-  /** The type is not supported. */
-  GENERIC_JDBC_CONNECTOR_0011("The type is not supported"),
-
-  /** The required option has not been set yet. */
-  GENERIC_JDBC_CONNECTOR_0012("The required option has not been set yet"),
-
-  /** No parameter marker in the specified sql. */
-  GENERIC_JDBC_CONNECTOR_0013("No parameter marker in the specified sql"),
-
-  /** The table columns cannot be specified when
-   *  the table sql is specified during export. */
-  GENERIC_JDBC_CONNECTOR_0014("The table columns cannot be specified "
-      + "when the table sql is specified during export"),
-
-  /** Unsupported values in partition column */
-  GENERIC_JDBC_CONNECTOR_0015("Partition column contains unsupported values"),
-
-  /** Can't fetch schema */
-  GENERIC_JDBC_CONNECTOR_0016("Can't fetch schema"),
-
-  /** Neither the table name nor the table sql are specified. */
-  GENERIC_JDBC_CONNECTOR_0017("The stage table is not empty."),
-
-  GENERIC_JDBC_CONNECTOR_0018("Error occurred while transferring data from " +
-    "stage table to destination table."),
-
-  GENERIC_JDBC_CONNECTOR_0019("Table name extraction not supported."),
-
-  GENERIC_JDBC_CONNECTOR_0020("Unknown direction."),
-
-  GENERIC_JDBC_CONNECTOR_0021("Schema column size do not match the result set column size"),
-
-  ;
-
-  private final String message;
-
-  private GenericJdbcConnectorError(String message) {
-    this.message = message;
-  }
-
-  public String getCode() {
-    return name();
-  }
-
-  public String getMessage() {
-    return message;
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExecutor.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExecutor.java b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExecutor.java
index e94a19b..5e7e4e6 100644
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExecutor.java
+++ b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExecutor.java
@@ -28,6 +28,7 @@ import java.sql.Statement;
 
 import org.apache.log4j.Logger;
 import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.error.code.GenericJdbcConnectorError;
 
 public class GenericJdbcExecutor {
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExtractor.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExtractor.java b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExtractor.java
index a349956..3287e16 100644
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExtractor.java
+++ b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExtractor.java
@@ -25,6 +25,7 @@ import org.apache.log4j.Logger;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.jdbc.configuration.FromJobConfiguration;
 import org.apache.sqoop.connector.jdbc.configuration.LinkConfiguration;
+import org.apache.sqoop.error.code.GenericJdbcConnectorError;
 import org.apache.sqoop.job.etl.Extractor;
 import org.apache.sqoop.job.etl.ExtractorContext;
 import org.apache.sqoop.schema.Schema;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcFromInitializer.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcFromInitializer.java b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcFromInitializer.java
index 1b30fb4..1ecd152 100644
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcFromInitializer.java
+++ b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcFromInitializer.java
@@ -20,8 +20,6 @@ package org.apache.sqoop.connector.jdbc;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
@@ -31,6 +29,7 @@ import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.jdbc.configuration.FromJobConfiguration;
 import org.apache.sqoop.connector.jdbc.configuration.LinkConfiguration;
 import org.apache.sqoop.connector.jdbc.util.SqlTypesUtils;
+import org.apache.sqoop.error.code.GenericJdbcConnectorError;
 import org.apache.sqoop.job.Constants;
 import org.apache.sqoop.job.etl.Initializer;
 import org.apache.sqoop.job.etl.InitializerContext;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcPartitioner.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcPartitioner.java b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcPartitioner.java
index b68d8d0..23b57c0 100644
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcPartitioner.java
+++ b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcPartitioner.java
@@ -30,6 +30,7 @@ import java.util.TimeZone;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.jdbc.configuration.LinkConfiguration;
 import org.apache.sqoop.connector.jdbc.configuration.FromJobConfiguration;
+import org.apache.sqoop.error.code.GenericJdbcConnectorError;
 import org.apache.sqoop.job.etl.Partition;
 import org.apache.sqoop.job.etl.Partitioner;
 import org.apache.sqoop.job.etl.PartitionerContext;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcToInitializer.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcToInitializer.java b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcToInitializer.java
index 5e6f983..400c0f2 100644
--- a/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcToInitializer.java
+++ b/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcToInitializer.java
@@ -20,8 +20,6 @@ package org.apache.sqoop.connector.jdbc;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
@@ -31,6 +29,7 @@ import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.jdbc.configuration.LinkConfiguration;
 import org.apache.sqoop.connector.jdbc.configuration.ToJobConfiguration;
 import org.apache.sqoop.connector.jdbc.util.SqlTypesUtils;
+import org.apache.sqoop.error.code.GenericJdbcConnectorError;
 import org.apache.sqoop.job.etl.Initializer;
 import org.apache.sqoop.job.etl.InitializerContext;
 import org.apache.sqoop.schema.Schema;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnector.java
----------------------------------------------------------------------
diff --git a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnector.java b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnector.java
index f70142d..2d5ba58 100644
--- a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnector.java
+++ b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnector.java
@@ -29,6 +29,7 @@ import org.apache.sqoop.connector.hdfs.configuration.LinkConfiguration;
 import org.apache.sqoop.connector.hdfs.configuration.ToJobConfiguration;
 import org.apache.sqoop.connector.spi.ConnectorConfigurableUpgrader;
 import org.apache.sqoop.connector.spi.SqoopConnector;
+import org.apache.sqoop.error.code.HdfsConnectorError;
 import org.apache.sqoop.job.etl.From;
 import org.apache.sqoop.job.etl.To;
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnectorError.java
----------------------------------------------------------------------
diff --git a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnectorError.java b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnectorError.java
deleted file mode 100644
index 71f0a03..0000000
--- a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsConnectorError.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.connector.hdfs;
-
-import org.apache.sqoop.common.ErrorCode;
-
-public enum HdfsConnectorError implements ErrorCode{
-  /** Error occurs during partitioner run */
-  GENERIC_HDFS_CONNECTOR_0000("Error occurs during partitioner run"),
-  /** Error occurs during extractor run */
-  GENERIC_HDFS_CONNECTOR_0001("Error occurs during extractor run"),
-  /** Unsupported output format type found **/
-  GENERIC_HDFS_CONNECTOR_0002("Unknown output format type"),
-  /** The system was unable to load the specified class. */
-  GENERIC_HDFS_CONNECTOR_0003("Unable to load the specified class"),
-  /** The system was unable to instantiate the specified class. */
-  GENERIC_HDFS_CONNECTOR_0004("Unable to instantiate the specified class"),
-  /** Error occurs during loader run */
-  GENERIC_HDFS_CONNECTOR_0005("Error occurs during loader run"),
-  GENERIC_HDFS_CONNECTOR_0006("Unknown job type")
-
-  ;
-
-  private final String message;
-
-  private HdfsConnectorError(String message) {
-    this.message = message;
-  }
-
-  public String getCode() {
-    return name();
-  }
-
-  public String getMessage() {
-    return message;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsExtractor.java
----------------------------------------------------------------------
diff --git a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsExtractor.java b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsExtractor.java
index 9f3367b..f70d56b 100644
--- a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsExtractor.java
+++ b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsExtractor.java
@@ -34,6 +34,7 @@ import org.apache.sqoop.common.PrefixContext;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.hdfs.configuration.FromJobConfiguration;
 import org.apache.sqoop.connector.hdfs.configuration.LinkConfiguration;
+import org.apache.sqoop.error.code.HdfsConnectorError;
 import org.apache.sqoop.etl.io.DataWriter;
 import org.apache.sqoop.job.etl.Extractor;
 import org.apache.sqoop.job.etl.ExtractorContext;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsLoader.java
----------------------------------------------------------------------
diff --git a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsLoader.java b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsLoader.java
index 556c112..bdee878 100644
--- a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsLoader.java
+++ b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsLoader.java
@@ -32,6 +32,7 @@ import org.apache.sqoop.connector.hdfs.configuration.ToJobConfiguration;
 import org.apache.sqoop.connector.hdfs.hdfsWriter.GenericHdfsWriter;
 import org.apache.sqoop.connector.hdfs.hdfsWriter.HdfsSequenceWriter;
 import org.apache.sqoop.connector.hdfs.hdfsWriter.HdfsTextWriter;
+import org.apache.sqoop.error.code.HdfsConnectorError;
 import org.apache.sqoop.etl.io.DataReader;
 import org.apache.sqoop.job.etl.Loader;
 import org.apache.sqoop.job.etl.LoaderContext;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsPartitioner.java
----------------------------------------------------------------------
diff --git a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsPartitioner.java b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsPartitioner.java
index 181528c..78fd60a 100644
--- a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsPartitioner.java
+++ b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsPartitioner.java
@@ -42,6 +42,7 @@ import org.apache.sqoop.common.PrefixContext;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.hdfs.configuration.FromJobConfiguration;
 import org.apache.sqoop.connector.hdfs.configuration.LinkConfiguration;
+import org.apache.sqoop.error.code.HdfsConnectorError;
 import org.apache.sqoop.job.etl.Partition;
 import org.apache.sqoop.job.etl.Partitioner;
 import org.apache.sqoop.job.etl.PartitionerContext;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaConnectorErrors.java
----------------------------------------------------------------------
diff --git a/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaConnectorErrors.java b/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaConnectorErrors.java
deleted file mode 100644
index f94efea..0000000
--- a/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaConnectorErrors.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.connector.kafka;
-
-import org.apache.sqoop.common.ErrorCode;
-
-public enum KafkaConnectorErrors implements ErrorCode {
-
-  KAFKA_CONNECTOR_0000("Unknown error occurred."),
-  KAFKA_CONNECTOR_0001("Error occurred while sending data to Kafka")
-  ;
-
-  private final String message;
-
-  private KafkaConnectorErrors(String message) {
-    this.message = message;
-  }
-
-  @Override
-  public String getCode() {
-    return name();
-  }
-
-  /**
-   * @return the message associated with error code.
-   */
-  @Override
-  public String getMessage() {
-    return message;
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaLoader.java
----------------------------------------------------------------------
diff --git a/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaLoader.java b/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaLoader.java
index 1c08f60..ad9ec34 100644
--- a/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaLoader.java
+++ b/connector/connector-kafka/src/main/java/org/apache/sqoop/connector/kafka/KafkaLoader.java
@@ -24,6 +24,7 @@ import org.apache.log4j.Logger;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.kafka.configuration.ToJobConfiguration;
 import org.apache.sqoop.connector.kafka.configuration.LinkConfiguration;
+import org.apache.sqoop.error.code.KafkaConnectorErrors;
 import org.apache.sqoop.job.etl.Loader;
 import org.apache.sqoop.job.etl.LoaderContext;
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteConnectorError.java
----------------------------------------------------------------------
diff --git a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteConnectorError.java b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteConnectorError.java
deleted file mode 100644
index 5775fcf..0000000
--- a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteConnectorError.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.connector.kite;
-
-import org.apache.sqoop.common.ErrorCode;
-
-public enum KiteConnectorError implements ErrorCode {
-
-  /** Unsupported dataset URI scheme */
-  GENERIC_KITE_CONNECTOR_0000("Unsupported dataset URI scheme"),
-
-  /** Target dataset is not empty */
-  GENERIC_KITE_CONNECTOR_0001("Dataset is not empty"),
-
-  /** Dataset does not exist */
-  GENERIC_KITE_CONNECTOR_0002("Dataset does not exist"),
-
-  /** Error occurred while creating partitions */
-  GENERIC_KITE_CONNECTOR_0003("Error occurred while creating partitions"),
-
-  ;
-
-  private final String message;
-
-  private KiteConnectorError(String message) {
-    this.message = message;
-  }
-
-  public String getCode() {
-    return name();
-  }
-
-  public String getMessage() {
-    return message;
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteDatasetExecutor.java
----------------------------------------------------------------------
diff --git a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteDatasetExecutor.java b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteDatasetExecutor.java
index e4514b5..cf8b627 100644
--- a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteDatasetExecutor.java
+++ b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteDatasetExecutor.java
@@ -25,6 +25,7 @@ import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.common.FileFormat;
 import org.apache.sqoop.connector.common.AvroDataTypeUtil;
 import org.apache.sqoop.connector.kite.util.KiteDataTypeUtil;
+import org.apache.sqoop.error.code.KiteConnectorError;
 import org.kitesdk.data.Dataset;
 import org.kitesdk.data.DatasetDescriptor;
 import org.kitesdk.data.DatasetReader;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteFromInitializer.java
----------------------------------------------------------------------
diff --git a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteFromInitializer.java b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteFromInitializer.java
index 2f82eaa..292510a 100644
--- a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteFromInitializer.java
+++ b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteFromInitializer.java
@@ -22,6 +22,7 @@ import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.kite.configuration.FromJobConfiguration;
 import org.apache.sqoop.connector.kite.configuration.LinkConfiguration;
 import org.apache.sqoop.connector.common.AvroDataTypeUtil;
+import org.apache.sqoop.error.code.KiteConnectorError;
 import org.apache.sqoop.job.etl.Initializer;
 import org.apache.sqoop.job.etl.InitializerContext;
 import org.apache.sqoop.schema.Schema;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
----------------------------------------------------------------------
diff --git a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
index ef94d48..a9cff77 100644
--- a/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
+++ b/connector/connector-kite/src/main/java/org/apache/sqoop/connector/kite/KiteToInitializer.java
@@ -23,6 +23,7 @@ import org.apache.sqoop.connector.common.FileFormat;
 import org.apache.sqoop.connector.kite.configuration.ConfigUtil;
 import org.apache.sqoop.connector.kite.configuration.LinkConfiguration;
 import org.apache.sqoop.connector.kite.configuration.ToJobConfiguration;
+import org.apache.sqoop.error.code.KiteConnectorError;
 import org.apache.sqoop.job.etl.Initializer;
 import org.apache.sqoop.job.etl.InitializerContext;
 import org.apache.sqoop.schema.NullSchema;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/configurable/ConfigurableError.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/configurable/ConfigurableError.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/configurable/ConfigurableError.java
deleted file mode 100644
index 6236870..0000000
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/configurable/ConfigurableError.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.configurable;
-
-import org.apache.sqoop.classification.InterfaceAudience;
-import org.apache.sqoop.classification.InterfaceStability;
-import org.apache.sqoop.common.ErrorCode;
-
-@InterfaceAudience.Public
-@InterfaceStability.Unstable
-public enum ConfigurableError implements ErrorCode {
-
-  /** An unknown error has occurred. */
-  CONFIGURABLE_0001("Link object upgrade called, but no upgrade routine provided for LINK config"),
-  CONFIGURABLE_0002("Job object upgrade called, but no upgrade routine provided for FROM job config"),
-  CONFIGURABLE_0003("Job object upgrade called, but no upgrade routine provided for TO job config"),
- ;
-  private final String message;
-
-  private ConfigurableError(String message) {
-    this.message = message;
-  }
-
-  public String getCode() {
-    return name();
-  }
-
-  public String getMessage() {
-    return message;
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopAvroUtils.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopAvroUtils.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopAvroUtils.java
index 5e6f238..857271a 100644
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopAvroUtils.java
+++ b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopAvroUtils.java
@@ -21,7 +21,7 @@ import org.apache.avro.Schema;
 import org.apache.sqoop.classification.InterfaceAudience;
 import org.apache.sqoop.classification.InterfaceStability;
 import org.apache.sqoop.common.SqoopException;
-import org.apache.sqoop.connector.idf.IntermediateDataFormatError;
+import org.apache.sqoop.error.code.IntermediateDataFormatError;
 import org.apache.sqoop.schema.type.AbstractComplexListType;
 import org.apache.sqoop.schema.type.Column;
 import org.apache.sqoop.schema.type.FixedPoint;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopIDFUtils.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopIDFUtils.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopIDFUtils.java
index c5eb6a3..71641ed 100644
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopIDFUtils.java
+++ b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/common/SqoopIDFUtils.java
@@ -20,8 +20,8 @@ package org.apache.sqoop.connector.common;
 import org.apache.sqoop.classification.InterfaceAudience;
 import org.apache.sqoop.classification.InterfaceStability;
 import org.apache.sqoop.common.SqoopException;
-import org.apache.sqoop.connector.idf.CSVIntermediateDataFormatError;
-import org.apache.sqoop.connector.idf.IntermediateDataFormatError;
+import org.apache.sqoop.error.code.CSVIntermediateDataFormatError;
+import org.apache.sqoop.error.code.IntermediateDataFormatError;
 import org.apache.sqoop.schema.type.AbstractComplexListType;
 import org.apache.sqoop.schema.type.Column;
 import org.apache.sqoop.schema.type.ColumnType;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormat.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormat.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormat.java
index 3350599..fef8202 100644
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormat.java
+++ b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormat.java
@@ -36,6 +36,7 @@ import org.apache.avro.util.Utf8;
 import org.apache.sqoop.classification.InterfaceAudience;
 import org.apache.sqoop.classification.InterfaceStability;
 import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.error.code.IntermediateDataFormatError;
 import org.apache.sqoop.schema.type.Column;
 import org.apache.sqoop.utils.ClassUtils;
 import org.joda.time.LocalDate;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormatError.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormatError.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormatError.java
deleted file mode 100644
index fd1b7d3..0000000
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/AVROIntermediateDataFormatError.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sqoop.connector.idf;
-
-import org.apache.sqoop.classification.InterfaceAudience;
-import org.apache.sqoop.classification.InterfaceStability;
-import org.apache.sqoop.common.ErrorCode;
-
-@InterfaceAudience.Public
-@InterfaceStability.Unstable
-public enum AVROIntermediateDataFormatError implements ErrorCode {
-  /** An unknown error has occurred. */
-  AVRO_INTERMEDIATE_DATA_FORMAT_0000("An unknown error has occurred."),
-
-  ;
-
-  private final String message;
-
-  private AVROIntermediateDataFormatError(String message) {
-    this.message = message;
-  }
-
-  public String getCode() {
-    return name();
-  }
-
-  public String getMessage() {
-    return message;
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormat.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormat.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormat.java
index b716e79..c233fb2 100644
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormat.java
+++ b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormat.java
@@ -24,6 +24,7 @@ import org.apache.sqoop.classification.InterfaceAudience;
 import org.apache.sqoop.classification.InterfaceStability;
 import org.apache.log4j.Logger;
 import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.error.code.IntermediateDataFormatError;
 import org.apache.sqoop.schema.Schema;
 import org.apache.sqoop.schema.type.AbstractComplexListType;
 import org.apache.sqoop.schema.type.Column;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormatError.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormatError.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormatError.java
deleted file mode 100644
index 6828bb9..0000000
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormatError.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sqoop.connector.idf;
-
-import org.apache.sqoop.classification.InterfaceAudience;
-import org.apache.sqoop.classification.InterfaceStability;
-import org.apache.sqoop.common.ErrorCode;
-
-@InterfaceAudience.Public
-@InterfaceStability.Unstable
-public enum CSVIntermediateDataFormatError implements ErrorCode {
-  /** An unknown error has occurred. */
-  CSV_INTERMEDIATE_DATA_FORMAT_0000("An unknown error has occurred."),
-
-  /** An encoding is missing in the Java native libraries. */
-  CSV_INTERMEDIATE_DATA_FORMAT_0001("Native character set error."),
-
-  /** Error while escaping a row. */
-  CSV_INTERMEDIATE_DATA_FORMAT_0002("An error has occurred while escaping a row."),
-
-  /** Error while escaping a row. */
-  CSV_INTERMEDIATE_DATA_FORMAT_0003("An error has occurred while unescaping a row."),
-
-  /**
-   * For arrays and maps we use JSON representation and incorrect representation
-   * results in parse exception
-   */
-  CSV_INTERMEDIATE_DATA_FORMAT_0004("JSON parse internal error."),
-
-  /** Unsupported bit values */
-  CSV_INTERMEDIATE_DATA_FORMAT_0005("Unsupported bit value."),
-
-  ;
-
-  private final String message;
-
-  private CSVIntermediateDataFormatError(String message) {
-    this.message = message;
-  }
-
-  public String getCode() {
-    return name();
-  }
-
-  public String getMessage() {
-    return message;
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormat.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormat.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormat.java
index 8bcf8c3..f4cd044 100644
--- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormat.java
+++ b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormat.java
@@ -21,6 +21,7 @@ package org.apache.sqoop.connector.idf;
 import org.apache.sqoop.classification.InterfaceAudience;
 import org.apache.sqoop.classification.InterfaceStability;
 import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.error.code.IntermediateDataFormatError;
 import org.apache.sqoop.schema.Schema;
 import org.apache.sqoop.utils.ClassUtils;
 import org.joda.time.DateTime;


Mime
View raw message