keith-turner commented on a change in pull request #168:
URL: https://github.com/apache/accumulo-testing/pull/168#discussion_r758740764
##########
File path:
src/main/java/org/apache/accumulo/testing/continuous/ContinuousIngest.java
##########
@@ -141,99 +134,97 @@ public static void main(String[] args) throws Exception {
long lastFlushTime = System.currentTimeMillis();
- int maxColF = env.getMaxColF();
- int maxColQ = env.getMaxColQ();
- boolean checksum =
Boolean.parseBoolean(env.getTestProperty(TestProps.CI_INGEST_CHECKSUM));
- long numEntries =
Long.parseLong(env.getTestProperty(TestProps.CI_INGEST_CLIENT_ENTRIES));
+ final int maxColF = env.getMaxColF();
+ final int maxColQ = env.getMaxColQ();
+ final boolean checksum = Boolean
+ .parseBoolean(testProps.getProperty(TestProps.CI_INGEST_CHECKSUM));
+ final long numEntries = Long
+
.parseLong(testProps.getProperty(TestProps.CI_INGEST_CLIENT_ENTRIES));
+ log.info("Total entries to be written: {}", numEntries);
- Properties testProps = env.getTestProperties();
- if (pauseEnabled(testProps)) {
+ visibilities =
parseVisibilities(testProps.getProperty(TestProps.CI_INGEST_VISIBILITIES));
+
+ pauseEnabled = pauseEnabled(testProps);
+
+ pauseMin =
Integer.parseInt(testProps.getProperty(TestProps.CI_INGEST_PAUSE_WAIT_MIN));
+ pauseMax =
Integer.parseInt(testProps.getProperty(TestProps.CI_INGEST_PAUSE_WAIT_MAX));
+ Preconditions.checkState(0 < pauseMin && pauseMin <= pauseMax,
+ "Bad pause wait min/max, must conform to: 0 < min <= max");
+
+ if (pauseEnabled) {
lastPauseNs = System.nanoTime();
- pauseWaitSec = getPause(testProps, r, CI_INGEST_PAUSE_WAIT_MIN,
CI_INGEST_PAUSE_WAIT_MAX);
+ pauseWaitSec = getPause(rand);
log.info("PAUSING enabled");
- log.info("INGESTING for " + pauseWaitSec + "s");
+ log.info("INGESTING for {}s", pauseWaitSec);
}
final float deleteProbability = getDeleteProbability(testProps);
log.info("DELETES will occur with a probability of {}",
String.format("%.02f", deleteProbability));
- out: while (true) {
- ColumnVisibility cv = getVisibility(r);
+ try (BatchWriter bw = client.createBatchWriter(tableName)) {
+ out: while (true) {
+ ColumnVisibility cv = getVisibility(rand);
- // generate first set of nodes
- for (int index = 0; index < flushInterval; index++) {
- long rowLong = genLong(rowMin, rowMax, r);
+ // generate sets nodes that link to previous set of nodes
+ for (int depth = 0; depth < maxDepth; depth++) {
+ for (int index = 0; index < flushInterval; index++) {
+ long rowLong = genLong(rowMin, rowMax, rand);
- int cf = r.nextInt(maxColF);
- int cq = r.nextInt(maxColQ);
+ byte[] prevRow = depth == 0 ? null : genRow(nodeMap[depth -
1][index].row);
Review comment:
It seems like adding this check for `depth == 0` allowed you to squish
two loops into one. Is that correct? Just want to make sure I am
understanding this correctly because I was finding it hard to follow the change
in the diff for this.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]