HADOOP-16011. OsSecureRandom very slow compared to other SecureRandom implementations. Contributed by Siyao Meng.

Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
This commit is contained in:
Siyao Meng 2019-04-03 14:28:43 -07:00 committed by Wei-Chiu Chuang
parent 366186d999
commit e62cbcbc83
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@
import org.apache.hadoop.conf.Configuration;
import com.google.common.base.Preconditions;
import org.apache.hadoop.crypto.random.OsSecureRandom;
import org.apache.hadoop.crypto.random.OpensslSecureRandom;
import org.apache.hadoop.util.ReflectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -57,7 +57,7 @@ public OpensslAesCtrCryptoCodec() {
public void setConf(Configuration conf) {
this.conf = conf;
final Class<? extends Random> klass = conf.getClass(
HADOOP_SECURITY_SECURE_RANDOM_IMPL_KEY, OsSecureRandom.class,
HADOOP_SECURITY_SECURE_RANDOM_IMPL_KEY, OpensslSecureRandom.class,
Random.class);
try {
random = ReflectionUtils.newInstance(klass, conf);

View File

@ -2889,7 +2889,7 @@
<property>
<name>hadoop.security.secure.random.impl</name>
<value></value>
<value>org.apache.hadoop.crypto.random.OpensslSecureRandom</value>
<description>
Implementation of secure random.
</description>