5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-20 19:00:48 +08:00

SQOOP-1724: Sqoop2: Support old config types for backward compatibility in connector data upgrade

(Veena Basavaraj via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-11-13 12:07:44 -08:00
parent 90ec25b2a8
commit 8c33cdd983
2 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,10 @@ public enum MConfigType {
/** Unknown config type */ /** Unknown config type */
OTHER, OTHER,
@Deprecated
// NOTE: only exists to support the connector data upgrade path
CONNECTION,
/** link config type */ /** link config type */
LINK, LINK,

View File

@ -1979,6 +1979,9 @@ public void loadDriverConfigs(List<MConfig> driverConfig,
} }
driverConfig.add(mDriverConfig); driverConfig.add(mDriverConfig);
break; break;
case CONNECTION:
// do nothing
break;
default: default:
throw new SqoopException(CommonRepositoryError.COMMON_0004, throw new SqoopException(CommonRepositoryError.COMMON_0004,
"connector-" + fromConnectorId + ":" + configType); "connector-" + fromConnectorId + ":" + configType);
@ -2107,6 +2110,7 @@ public void loadConnectorConfigTypes(List<MConfig> linkConfig, List<MConfig> fro
MConfigType mConfigType = MConfigType.valueOf(configType); MConfigType mConfigType = MConfigType.valueOf(configType);
switch (mConfigType) { switch (mConfigType) {
case CONNECTION:
case LINK: case LINK:
if (linkConfig.size() != configIndex) { if (linkConfig.size() != configIndex) {
throw new SqoopException(CommonRepositoryError.COMMON_0007, throw new SqoopException(CommonRepositoryError.COMMON_0007,