Repository: sqoop Updated Branches: refs/heads/sqoop2 d7ba495af -> f7efa3800
http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormatError.java ---------------------------------------------------------------------- diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormatError.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormatError.java deleted file mode 100644 index f7c9abb..0000000 --- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormatError.java +++ /dev/null @@ -1,60 +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; - [email protected] [email protected] -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/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormat.java ---------------------------------------------------------------------- diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormat.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormat.java index 4c67c1a..0fac41a 100644 --- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormat.java +++ b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormat.java @@ -24,6 +24,8 @@ import org.apache.commons.codec.binary.Base64; 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.error.code.JSONIntermediateDataFormatError; import org.apache.sqoop.schema.Schema; import org.apache.sqoop.schema.type.Column; import org.apache.sqoop.utils.ClassUtils; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormatError.java ---------------------------------------------------------------------- diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormatError.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormatError.java deleted file mode 100644 index 0c29a8f..0000000 --- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/JSONIntermediateDataFormatError.java +++ /dev/null @@ -1,51 +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; - [email protected] [email protected] -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/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/matcher/MatcherError.java ---------------------------------------------------------------------- diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/matcher/MatcherError.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/matcher/MatcherError.java deleted file mode 100644 index 18693c2..0000000 --- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/matcher/MatcherError.java +++ /dev/null @@ -1,45 +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.matcher; - -import org.apache.sqoop.classification.InterfaceAudience; -import org.apache.sqoop.classification.InterfaceStability; -import org.apache.sqoop.common.ErrorCode; - [email protected] [email protected] -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/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/spi/ConnectorConfigurableUpgrader.java ---------------------------------------------------------------------- diff --git a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/spi/ConnectorConfigurableUpgrader.java b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/spi/ConnectorConfigurableUpgrader.java index 55f8edb..b5aa7b8 100644 --- a/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/spi/ConnectorConfigurableUpgrader.java +++ b/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/spi/ConnectorConfigurableUpgrader.java @@ -21,7 +21,7 @@ package org.apache.sqoop.connector.spi; import org.apache.sqoop.classification.InterfaceAudience; import org.apache.sqoop.classification.InterfaceStability; import org.apache.sqoop.common.SqoopException; -import org.apache.sqoop.configurable.ConfigurableError; +import org.apache.sqoop.error.code.ConfigurableError; import org.apache.sqoop.model.MFromConfig; import org.apache.sqoop.model.MLinkConfig; import org.apache.sqoop.model.MToConfig; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/execution/mapreduce/src/main/java/org/apache/sqoop/job/MRExecutionError.java ---------------------------------------------------------------------- diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/MRExecutionError.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/MRExecutionError.java deleted file mode 100644 index e70b7e2..0000000 --- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/MRExecutionError.java +++ /dev/null @@ -1,97 +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.job; - -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/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopInputFormat.java ---------------------------------------------------------------------- diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopInputFormat.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopInputFormat.java index a562e02..db31ca4 100644 --- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopInputFormat.java +++ b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopInputFormat.java @@ -32,7 +32,7 @@ import org.apache.log4j.Logger; import org.apache.sqoop.common.Direction; import org.apache.sqoop.common.PrefixContext; import org.apache.sqoop.common.SqoopException; -import org.apache.sqoop.job.MRExecutionError; +import org.apache.sqoop.error.code.MRExecutionError; import org.apache.sqoop.job.MRJobConstants; import org.apache.sqoop.job.etl.Partition; import org.apache.sqoop.job.etl.Partitioner; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopMapper.java ---------------------------------------------------------------------- diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopMapper.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopMapper.java index dee0011..d6fe6af 100644 --- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopMapper.java +++ b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopMapper.java @@ -32,7 +32,7 @@ import org.apache.sqoop.connector.idf.IntermediateDataFormat; import org.apache.sqoop.connector.matcher.Matcher; import org.apache.sqoop.connector.matcher.MatcherFactory; import org.apache.sqoop.job.MRJobConstants; -import org.apache.sqoop.job.MRExecutionError; +import org.apache.sqoop.error.code.MRExecutionError; import org.apache.sqoop.common.PrefixContext; 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/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java ---------------------------------------------------------------------- diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java index 58a9eed..fc18586 100644 --- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java +++ b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java @@ -37,7 +37,7 @@ import org.apache.sqoop.connector.idf.IntermediateDataFormat; import org.apache.sqoop.connector.matcher.Matcher; import org.apache.sqoop.connector.matcher.MatcherFactory; import org.apache.sqoop.job.MRJobConstants; -import org.apache.sqoop.job.MRExecutionError; +import org.apache.sqoop.error.code.MRExecutionError; import org.apache.sqoop.common.PrefixContext; 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/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopSplit.java ---------------------------------------------------------------------- diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopSplit.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopSplit.java index c2f5756..b81f4d6 100644 --- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopSplit.java +++ b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopSplit.java @@ -24,7 +24,7 @@ import java.io.IOException; import org.apache.hadoop.io.Writable; import org.apache.hadoop.mapreduce.InputSplit; import org.apache.sqoop.common.SqoopException; -import org.apache.sqoop.job.MRExecutionError; +import org.apache.sqoop.error.code.MRExecutionError; import org.apache.sqoop.job.etl.Partition; import org.apache.sqoop.utils.ClassUtils; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryError.java ---------------------------------------------------------------------- diff --git a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryError.java b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryError.java deleted file mode 100644 index 7a7b28c..0000000 --- a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryError.java +++ /dev/null @@ -1,201 +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.repository.common; - -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/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java ---------------------------------------------------------------------- diff --git a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java index 5c9247a..4feaee6 100644 --- a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java +++ b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java @@ -24,6 +24,7 @@ import org.apache.sqoop.common.DirectionError; import org.apache.sqoop.common.SqoopException; import org.apache.sqoop.common.SupportedDirections; import org.apache.sqoop.driver.Driver; +import org.apache.sqoop.error.code.CommonRepositoryError; import org.apache.sqoop.model.SubmissionError; import org.apache.sqoop.model.MBooleanInput; import org.apache.sqoop.model.MConfig; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java ---------------------------------------------------------------------- diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java deleted file mode 100644 index 6bc5674..0000000 --- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoError.java +++ /dev/null @@ -1,74 +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.repository.derby; - -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/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java ---------------------------------------------------------------------- diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java index 3bef3c5..2f05fcb 100644 --- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java +++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java @@ -44,6 +44,7 @@ import org.apache.sqoop.common.SqoopException; import org.apache.sqoop.connector.ConnectorHandler; import org.apache.sqoop.connector.ConnectorManagerUtils; import org.apache.sqoop.driver.Driver; +import org.apache.sqoop.error.code.DerbyRepoError; import org.apache.sqoop.model.MConfigType; import org.apache.sqoop.model.MConfigurableType; import org.apache.sqoop.model.MDriver; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestJobHandling.java ---------------------------------------------------------------------- diff --git a/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestJobHandling.java b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestJobHandling.java index 458450b..6a248e9 100644 --- a/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestJobHandling.java +++ b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestJobHandling.java @@ -36,7 +36,7 @@ import org.apache.sqoop.model.MDriver; import org.apache.sqoop.model.MJob; import org.apache.sqoop.model.MMapInput; import org.apache.sqoop.model.MStringInput; -import org.apache.sqoop.repository.common.CommonRepositoryError; +import org.apache.sqoop.error.code.CommonRepositoryError; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestLinkHandling.java ---------------------------------------------------------------------- diff --git a/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestLinkHandling.java b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestLinkHandling.java index 5602c7c..523464b 100644 --- a/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestLinkHandling.java +++ b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestLinkHandling.java @@ -31,7 +31,7 @@ import org.apache.sqoop.model.MConfig; import org.apache.sqoop.model.MLink; import org.apache.sqoop.model.MMapInput; import org.apache.sqoop.model.MStringInput; -import org.apache.sqoop.repository.common.CommonRepositoryError; +import org.apache.sqoop.error.code.CommonRepositoryError; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepoError.java ---------------------------------------------------------------------- diff --git a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepoError.java b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepoError.java deleted file mode 100644 index 19ee505..0000000 --- a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepoError.java +++ /dev/null @@ -1,51 +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.repository.postgresql; - -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/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java ---------------------------------------------------------------------- diff --git a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java index 4013d22..85af9a4 100644 --- a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java +++ b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java @@ -23,6 +23,7 @@ import static org.apache.sqoop.repository.postgresql.PostgresqlSchemaCreateQuery import org.apache.log4j.Logger; import org.apache.sqoop.common.Direction; import org.apache.sqoop.common.SqoopException; +import org.apache.sqoop.error.code.PostgresqlRepoError; import org.apache.sqoop.repository.JdbcRepositoryContext; import org.apache.sqoop.repository.common.CommonRepoConstants; import org.apache.sqoop.repository.common.CommonRepositoryHandler; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java index ccf928e..9a5d14b 100644 --- a/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java +++ b/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java @@ -35,7 +35,7 @@ import org.apache.sqoop.model.MConnector; import org.apache.sqoop.server.RequestContext; import org.apache.sqoop.server.RequestContext.Method; import org.apache.sqoop.server.RequestHandler; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; public class ConnectorRequestHandler implements RequestHandler { http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java index 81efb89..2409df4 100644 --- a/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java +++ b/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java @@ -26,7 +26,7 @@ import org.apache.sqoop.json.JsonBean; import org.apache.sqoop.server.RequestContext; import org.apache.sqoop.server.RequestHandler; import org.apache.sqoop.server.RequestContext.Method; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; public class DriverRequestHandler implements RequestHandler { http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java b/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java index 93ff60b..7579b44 100644 --- a/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java +++ b/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java @@ -20,7 +20,7 @@ package org.apache.sqoop.handler; import org.apache.sqoop.common.SqoopException; import org.apache.sqoop.connector.ConnectorManager; import org.apache.sqoop.repository.Repository; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; public class HandlerUtils { http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java index f4482ce..7a6ee2b 100644 --- a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java +++ b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java @@ -48,7 +48,7 @@ import org.apache.sqoop.repository.RepositoryManager; import org.apache.sqoop.request.HttpEventContext; import org.apache.sqoop.server.RequestContext; import org.apache.sqoop.server.RequestHandler; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; import org.apache.sqoop.validation.ConfigValidationResult; import org.apache.sqoop.validation.Status; import org.json.simple.JSONObject; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java index 74fa321..026d9ee 100644 --- a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java +++ b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java @@ -40,7 +40,7 @@ import org.apache.sqoop.repository.Repository; import org.apache.sqoop.repository.RepositoryManager; import org.apache.sqoop.server.RequestContext; import org.apache.sqoop.server.RequestHandler; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; import org.apache.sqoop.validation.ConfigValidationResult; import org.json.simple.JSONObject; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java index a0b29c8..5c788ce 100644 --- a/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java +++ b/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java @@ -30,7 +30,7 @@ import org.apache.sqoop.repository.RepositoryManager; import org.apache.sqoop.server.RequestContext; import org.apache.sqoop.server.RequestContext.Method; import org.apache.sqoop.server.RequestHandler; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; public class SubmissionRequestHandler implements RequestHandler { http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java index 2eaa0ac..f78d7a5 100644 --- a/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java +++ b/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java @@ -26,7 +26,7 @@ import org.apache.sqoop.json.VersionBean; import org.apache.sqoop.server.RequestContext; import org.apache.sqoop.server.RequestContext.Method; import org.apache.sqoop.server.RequestHandler; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; /** * Version request handler is supporting following resources: * http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/server/RequestContext.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/server/RequestContext.java b/server/src/main/java/org/apache/sqoop/server/RequestContext.java index 5324a0a..c661b71 100644 --- a/server/src/main/java/org/apache/sqoop/server/RequestContext.java +++ b/server/src/main/java/org/apache/sqoop/server/RequestContext.java @@ -21,7 +21,7 @@ import org.apache.hadoop.security.authentication.client.PseudoAuthenticator; import org.apache.hadoop.security.token.delegation.web.HttpUserGroupInformation; import org.apache.sqoop.common.SqoopException; import org.apache.sqoop.security.AuthenticationManager; -import org.apache.sqoop.server.common.ServerError; +import org.apache.sqoop.error.code.ServerError; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/server/src/main/java/org/apache/sqoop/server/common/ServerError.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/server/common/ServerError.java b/server/src/main/java/org/apache/sqoop/server/common/ServerError.java deleted file mode 100644 index c68ab57..0000000 --- a/server/src/main/java/org/apache/sqoop/server/common/ServerError.java +++ /dev/null @@ -1,57 +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.server.common; - -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/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java ---------------------------------------------------------------------- diff --git a/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java b/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java index d15bcfc..f249318 100644 --- a/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java +++ b/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java @@ -39,6 +39,7 @@ import org.apache.sqoop.common.Direction; import org.apache.sqoop.common.MapContext; import org.apache.sqoop.common.SqoopException; import org.apache.sqoop.driver.SubmissionEngine; +import org.apache.sqoop.error.code.MapreduceSubmissionError; import org.apache.sqoop.execution.mapreduce.MRJobRequest; import org.apache.sqoop.execution.mapreduce.MapreduceExecutionEngine; import org.apache.sqoop.driver.JobRequest; http://git-wip-us.apache.org/repos/asf/sqoop/blob/f7efa380/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionError.java ---------------------------------------------------------------------- diff --git a/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionError.java b/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionError.java deleted file mode 100644 index 4af95b0..0000000 --- a/submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionError.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.submission.mapreduce; - -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; - } -}
