accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] mikewalch commented on a change in pull request #15: Added random pausing to continuous ingest
Date Tue, 03 Jul 2018 17:57:26 GMT
mikewalch commented on a change in pull request #15: Added random pausing to continuous ingest
URL: https://github.com/apache/accumulo-testing/pull/15#discussion_r199899717
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/testing/core/continuous/ContinuousIngest.java
 ##########
 @@ -45,11 +45,43 @@
   private static final byte[] EMPTY_BYTES = new byte[0];
 
   private static List<ColumnVisibility> visibilities;
+  private static long lastPause;
+  private static long pauseWaitMs;
 
   private static ColumnVisibility getVisibility(Random rand) {
     return visibilities.get(rand.nextInt(visibilities.size()));
   }
 
+  private static boolean pauseEnabled(Properties props) {
+    String value = props.getProperty(TestProps.CI_INGEST_PAUSE_ENABLED);
+    return value != null && value.equals("true");
+  }
+
+  private static int getPauseWaitMs(Properties props, Random rand) {
+    int waitMin = Integer.parseInt(props.getProperty(TestProps.CI_INGEST_PAUSE_WAIT_MIN));
+    int waitMax = Integer.parseInt(props.getProperty(TestProps.CI_INGEST_PAUSE_WAIT_MAX));
+    return (rand.nextInt(waitMax - waitMin) + waitMin) * 1000;
+  }
+
+  private static int getPauseDurationMs(Properties props, Random rand) {
+    int durationMin = Integer.parseInt(props.getProperty(TestProps.CI_INGEST_PAUSE_DURATION_MIN));
+    int durationMax = Integer.parseInt(props.getProperty(TestProps.CI_INGEST_PAUSE_DURATION_MAX));
+    return (rand.nextInt(durationMax - durationMin) + durationMin) * 1000;
 
 Review comment:
   I now return min if they are equal.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message