accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo-testing] branch master updated: BulkIngest CI improvements (#101)
Date Tue, 23 Jul 2019 16:12:38 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii 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 99a9a82  BulkIngest CI improvements (#101)
99a9a82 is described below

commit 99a9a8244b1dbd0100cb5913d32460cedcc0961b
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Tue Jul 23 12:12:34 2019 -0400

    BulkIngest CI improvements (#101)
    
    * Add job name
    * Seed Random with strong seed
    * Fix linked list to chain adjacent elements, rather than skip over
      adjacent elements to link to the next element
---
 .../org/apache/accumulo/testing/continuous/BulkIngest.java   |  5 +++--
 .../accumulo/testing/continuous/ContinuousInputFormat.java   | 12 +++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/accumulo/testing/continuous/BulkIngest.java b/src/main/java/org/apache/accumulo/testing/continuous/BulkIngest.java
index 120daa2..93bd9ea 100644
--- a/src/main/java/org/apache/accumulo/testing/continuous/BulkIngest.java
+++ b/src/main/java/org/apache/accumulo/testing/continuous/BulkIngest.java
@@ -49,14 +49,15 @@ public class BulkIngest extends Configured implements Tool {
 
   @Override
   public int run(String[] args) throws Exception {
+    String ingestInstanceId = UUID.randomUUID().toString();
+
     Job job = Job.getInstance(getConf());
+    job.setJobName("BulkIngest_" + ingestInstanceId);
     job.setJarByClass(BulkIngest.class);
     // very important to prevent guava conflicts
     job.getConfiguration().set("mapreduce.job.classloader", "true");
     FileSystem fs = FileSystem.get(job.getConfiguration());
 
-    String ingestInstanceId = UUID.randomUUID().toString();
-
     log.info(String.format("UUID %d %s", System.currentTimeMillis(), ingestInstanceId));
 
     job.setInputFormatClass(ContinuousInputFormat.class);
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 218e1c5..4399e3f 100644
--- a/src/main/java/org/apache/accumulo/testing/continuous/ContinuousInputFormat.java
+++ b/src/main/java/org/apache/accumulo/testing/continuous/ContinuousInputFormat.java
@@ -25,6 +25,8 @@ 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;
 import java.util.Random;
@@ -128,7 +130,12 @@ public class ContinuousInputFormat extends InputFormat<Key,Value>
{
         maxQual = job.getConfiguration().getInt(PROP_QUAL_MAX, Short.MAX_VALUE);
         checksum = job.getConfiguration().getBoolean(PROP_CHECKSUM, false);
 
-        random = new Random();
+        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);
+        }
         nodeCount = 0;
       }
 
@@ -158,9 +165,8 @@ public class ContinuousInputFormat extends InputFormat<Key,Value>
{
 
         if (nodeCount < numNodes) {
           CRC32 cksum = checksum ? new CRC32() : null;
-          byte[] prevRow = prevKey != null ? prevKey.getRowData().toArray() : null;
-
           prevKey = currKey;
+          byte[] prevRow = prevKey != null ? prevKey.getRowData().toArray() : null;
           currKey = genKey(cksum);
           currValue = new Value(createValue(uuid, prevRow, cksum));
 


Mime
View raw message