wshao08 commented on a change in pull request #1657:
URL: https://github.com/apache/iotdb/pull/1657#discussion_r509979474



##########
File path: 
server/src/main/java/org/apache/iotdb/db/conf/directories/strategy/RandomOnDiskUsableSpaceStrategy.java
##########
@@ -18,15 +18,17 @@
  */
 package org.apache.iotdb.db.conf.directories.strategy;
 
+import com.google.common.primitives.Bytes;
+import com.google.common.primitives.Longs;
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Random;
 import org.apache.iotdb.db.exception.DiskSpaceInsufficientException;
 import org.apache.iotdb.db.utils.CommonUtils;
 
 public class RandomOnDiskUsableSpaceStrategy extends DirectoryStrategy {
 
-  private Random random = new Random(System.currentTimeMillis());
+  private SecureRandom random = new 
SecureRandom(Longs.toByteArray(System.currentTimeMillis()));

Review comment:
       Use BytesUtils instead

##########
File path: 
server/src/test/java/org/apache/iotdb/db/conf/adapter/HyperLogLogTest.java
##########
@@ -36,7 +37,7 @@
   public void testStreamLibHll() {
     final int seed = 12345;
     // data on which to calculate distinct count
-    Random random = new Random(seed);
+    SecureRandom random = new SecureRandom(Ints.toByteArray(seed));

Review comment:
       Fixed

##########
File path: 
server/src/test/java/org/apache/iotdb/db/engine/merge/MergeLogTest.java
##########
@@ -39,6 +39,8 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;

Review comment:
       Removed

##########
File path: 
server/src/test/java/org/apache/iotdb/db/integration/IoTDBAutoCreateSchemaIT.java
##########
@@ -35,6 +35,8 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.Statement;
+import org.slf4j.Logger;

Review comment:
       Removed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to