Skip to content

HADOOP-17544. Mark KeyProvider as Stable. #2776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import org.bouncycastle.jce.provider.BouncyCastleProvider;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
Expand All @@ -57,7 +57,7 @@
* <code>KeyProvider</code> implementations must be thread safe.
*/
@InterfaceAudience.Public
@InterfaceStability.Unstable
@InterfaceStability.Stable
public abstract class KeyProvider implements Closeable {
public static final String DEFAULT_CIPHER_NAME =
CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_DEFAULT_CIPHER_KEY;
Expand Down Expand Up @@ -135,20 +135,14 @@ public boolean equals(Object rhs) {
return false;
}
final KeyVersion kv = (KeyVersion) rhs;
return new EqualsBuilder().
append(name, kv.name).
append(versionName, kv.versionName).
append(material, kv.material).
isEquals();
return Objects.equals(name, kv.name)
&& Objects.equals(versionName, kv.versionName)
&& Arrays.equals(material, kv.material);
}

@Override
public int hashCode() {
return new HashCodeBuilder().
append(name).
append(versionName).
append(material).
toHashCode();
return Objects.hash(name, versionName, Arrays.hashCode(material));
}
}

Expand Down