From e3d6cdd072d153f3d23fc59e6326abf182353bb8 Mon Sep 17 00:00:00 2001 From: stack Date: Fri, 3 Apr 2015 15:32:50 -0700 Subject: [PATCH] HBASE-13382 IntegrationTestBigLinkedList should use SecureRandom (Dima Spivak) --- .../hadoop/hbase/test/IntegrationTestBigLinkedList.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java index 6f28e20f69f..104c5da9d50 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java @@ -23,6 +23,7 @@ import java.io.DataOutput; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InterruptedIOException; +import java.security.SecureRandom; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -306,7 +307,8 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { public void initialize(InputSplit arg0, TaskAttemptContext context) throws IOException, InterruptedException { numNodes = context.getConfiguration().getLong(GENERATOR_NUM_ROWS_PER_MAP_KEY, 25000000); - rand = new Random(); + // Use SecureRandom to avoid issue described in HBASE-13382. + rand = new SecureRandom(); } @Override @@ -1359,7 +1361,7 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { if (cmd.hasOption('n')) { maxQueries = Long.parseLong(cmd.getOptionValue("n")); } - Random rand = new Random(); + Random rand = new SecureRandom(); boolean isSpecificStart = cmd.hasOption('s'); byte[] startKey = isSpecificStart ? Bytes.toBytesBinary(cmd.getOptionValue('s')) : null; int logEvery = cmd.hasOption('l') ? Integer.parseInt(cmd.getOptionValue('l')) : 1;