Review Board 1.7.22


SQOOP-1228 Method Configuration#unset is not available on Hadoop < 1.2.0

Review Request #15275 - Created Nov. 6, 2013 and updated

Jarek Cecho
SQOOP-1228
Reviewers
Sqoop
sqoop-trunk
I've removed the call to method "unset".
Verified tests on Hadoop profile 20 and 100.

Diff revision 1 (Latest)

  1. src/java/org/apache/sqoop/util/password/CryptoFileLoader.java: Loading...
src/java/org/apache/sqoop/util/password/CryptoFileLoader.java
Revision 54d2cf56aab25b2f30c916008db9217d0e8cae8b New Change
[20] 153 lines
[+20] [+] public String loadPassword(String p, Configuration configuration) throws IOException {
154
    return new String(decryptedBytes);
154
    return new String(decryptedBytes);
155
  }
155
  }
156

    
   
156

   
157
  @Override
157
  @Override
158
  public void cleanUpConfiguration(Configuration configuration) {
158
  public void cleanUpConfiguration(Configuration configuration) {
159
    configuration.unset(PROPERTY_CRYPTO_PASSPHRASE);
159
    // Usage of Configuration#unset would be much better here, sadly
160
    configuration.unset(PROPERTY_CRYPTO_SALT);
160
    // this particular API is not available in Hadoop 0.20 and < 1.2.0
161
    configuration.unset(PROPERTY_CRYPTO_KEY_LEN);
161
    // that we are still supporting. Hence we are overriding the configs
162
    configuration.unset(PROPERTY_CRYPTO_ITERATIONS);
162
    // with default values.

    
   
163
    configuration.set(PROPERTY_CRYPTO_PASSPHRASE, "REMOVED");

    
   
164
    configuration.set(PROPERTY_CRYPTO_SALT, DEFAULT_SALT);

    
   
165
    configuration.setInt(PROPERTY_CRYPTO_KEY_LEN, DEFAULT_KEY_LEN);

    
   
166
    configuration.setInt(PROPERTY_CRYPTO_ITERATIONS, DEFAULT_ITERATIONS);
163
  }
167
  }
164
}
168
}
  1. src/java/org/apache/sqoop/util/password/CryptoFileLoader.java: Loading...