DomGarguilo commented on a change in pull request #168:
URL: https://github.com/apache/accumulo-testing/pull/168#discussion_r754497460
##########
File path:
src/main/java/org/apache/accumulo/testing/continuous/ContinuousIngest.java
##########
@@ -86,51 +82,49 @@ private static int getFlushEntries(Properties props) {
return
Integer.parseInt(props.getProperty(TestProps.CI_INGEST_FLUSH_ENTRIES,
"1000000"));
}
- private static void pauseCheck(Properties props, Random rand) throws
InterruptedException {
- if (pauseEnabled(props)) {
+ private static void pauseCheck(Random rand) throws InterruptedException {
+ if (pauseEnabled) {
long elapsedNano = System.nanoTime() - lastPauseNs;
if (elapsedNano > (TimeUnit.SECONDS.toNanos(pauseWaitSec))) {
- long pauseDurationSec = getPause(props, rand,
CI_INGEST_PAUSE_DURATION_MIN,
- CI_INGEST_PAUSE_DURATION_MAX);
- log.info("PAUSING for " + pauseDurationSec + "s");
+ long pauseDurationSec = getPause(rand);
+ log.info("PAUSING for {}s", pauseDurationSec);
Thread.sleep(TimeUnit.SECONDS.toMillis(pauseDurationSec));
lastPauseNs = System.nanoTime();
- pauseWaitSec = getPause(props, rand, CI_INGEST_PAUSE_WAIT_MIN,
CI_INGEST_PAUSE_WAIT_MAX);
- log.info("INGESTING for " + pauseWaitSec + "s");
+ pauseWaitSec = getPause(rand);
+ log.info("INGESTING for {}s", pauseWaitSec);
}
}
}
public static void main(String[] args) throws Exception {
- try (ContinuousEnv env = new ContinuousEnv(args)) {
+ try (ContinuousEnv env = new ContinuousEnv(args);
+ AccumuloClient client = env.getAccumuloClient()) {
- visibilities =
parseVisibilities(env.getTestProperty(TestProps.CI_INGEST_VISIBILITIES));
-
- long rowMin = env.getRowMin();
- long rowMax = env.getRowMax();
+ final long rowMin = env.getRowMin();
+ final long rowMax = env.getRowMax();
if (rowMin < 0 || rowMax < 0 || rowMax <= rowMin) {
throw new IllegalArgumentException("bad min and max");
}
- AccumuloClient client = env.getAccumuloClient();
String tableName = env.getAccumuloTableName();
if (!client.tableOperations().exists(tableName)) {
throw new TableNotFoundException(null, tableName,
"Consult the README and create the table before starting ingest.");
}
- BatchWriter bw = client.createBatchWriter(tableName);
-
- Random r = new Random();
+ Random rand = new Random();
byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes(UTF_8);
+ log.info("Ingest instance ID: {} current time: {}ms", new
String(ingestInstanceId, UTF_8),
Review comment:
Yea I agree, I'm not sure that I see the usefulness of this log, I just
left it in since it was already there and made it more descriptive.
--
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]