accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo-testing] branch master updated: Use non blocking secure random for seeding. (#106)
Date Tue, 30 Jul 2019 18:17:29 GMT
This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo-testing.git


The following commit(s) were added to refs/heads/master by this push:
     new b3a3823  Use non blocking secure random for seeding. (#106)
b3a3823 is described below

commit b3a3823583b7cea747d54e2e09922fc665783bea
Author: Keith Turner <kturner@apache.org>
AuthorDate: Tue Jul 30 14:17:24 2019 -0400

    Use non blocking secure random for seeding. (#106)
    
    When attempting to generate bulk data to ingest, map reduce jobs were
    timing out.  The jobs were blocked in SecureRandom code for over 10
    minutes (likely trying to read /dev/random, but not sure about this).
    This change creates a SecureRandom that should be non-blocking
    with Java's default configs. With this change generating bulk data no
    longer times out.
---
 .../accumulo/testing/continuous/ContinuousInputFormat.java       | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/accumulo/testing/continuous/ContinuousInputFormat.java
b/src/main/java/org/apache/accumulo/testing/continuous/ContinuousInputFormat.java
index 4399e3f..ecf8172 100644
--- a/src/main/java/org/apache/accumulo/testing/continuous/ContinuousInputFormat.java
+++ b/src/main/java/org/apache/accumulo/testing/continuous/ContinuousInputFormat.java
@@ -25,7 +25,6 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.List;
@@ -130,12 +129,8 @@ public class ContinuousInputFormat extends InputFormat<Key,Value>
{
         maxQual = job.getConfiguration().getInt(PROP_QUAL_MAX, Short.MAX_VALUE);
         checksum = job.getConfiguration().getBoolean(PROP_CHECKSUM, false);
 
-        try {
-          random = new Random(SecureRandom.getInstanceStrong().nextLong());
-        } catch (NoSuchAlgorithmException e) {
-          throw new AssertionError(
-              "Seeding random from a strong secure random algorithm should never fail", e);
-        }
+        random = new Random(new SecureRandom().nextLong());
+
         nodeCount = 0;
       }
 


Mime
View raw message