From notifications-return-43940-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Tue Jul 3 19:57:28 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 069F6180674 for ; Tue, 3 Jul 2018 19:57:27 +0200 (CEST) Received: (qmail 22258 invoked by uid 500); 3 Jul 2018 17:57:27 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 22247 invoked by uid 99); 3 Jul 2018 17:57:27 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2018 17:57:27 +0000 From: GitBox To: notifications@accumulo.apache.org Subject: [GitHub] mikewalch commented on a change in pull request #15: Added random pausing to continuous ingest Message-ID: <153064064645.16617.18324971214165548081.gitbox@gitbox.apache.org> Date: Tue, 03 Jul 2018 17:57:26 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 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