HBASE-13382 IntegrationTestBigLinkedList should use SecureRandom (Dima Spivak)

This commit is contained in:
stack 2015-04-03 15:32:50 -07:00
parent 95893ffebd
commit e3d6cdd072
1 changed files with 4 additions and 2 deletions

View File

@ -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;