Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 85E27200CF3 for ; Wed, 13 Sep 2017 10:51:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 846C31609CA; Wed, 13 Sep 2017 08:51:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CB53E1609C9 for ; Wed, 13 Sep 2017 10:51:19 +0200 (CEST) Received: (qmail 2348 invoked by uid 500); 13 Sep 2017 08:51:19 -0000 Mailing-List: contact dev-help@tephra.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tephra.incubator.apache.org Delivered-To: mailing list dev@tephra.incubator.apache.org Received: (qmail 2337 invoked by uid 99); 13 Sep 2017 08:51:18 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2017 08:51:18 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 40A60D4436 for ; Wed, 13 Sep 2017 08:51:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.02 X-Spam-Level: X-Spam-Status: No, score=-4.02 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id G_g7CXovKiCQ for ; Wed, 13 Sep 2017 08:51:17 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id AAE855FE43 for ; Wed, 13 Sep 2017 08:51:16 +0000 (UTC) Received: (qmail 2308 invoked by uid 99); 13 Sep 2017 08:51:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2017 08:51:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E0DD1F5635; Wed, 13 Sep 2017 08:51:15 +0000 (UTC) From: chtyim To: dev@tephra.incubator.apache.org Reply-To: dev@tephra.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-tephra pull request #53: (TEPHRA-243) Improve logging for slow log... Content-Type: text/plain Message-Id: <20170913085115.E0DD1F5635@git1-us-west.apache.org> Date: Wed, 13 Sep 2017 08:51:15 +0000 (UTC) archived-at: Wed, 13 Sep 2017 08:51:20 -0000 Github user chtyim commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/53#discussion_r138559950 --- Diff: tephra-core/src/main/java/org/apache/tephra/persist/AbstractTransactionLog.java --- @@ -48,21 +52,30 @@ protected long timestamp; private volatile boolean initialized; private volatile boolean closed; + private AtomicLong writtenUpTo = new AtomicLong(); private AtomicLong syncedUpTo = new AtomicLong(); - private List pendingWrites = Lists.newLinkedList(); + private Queue pendingWrites = new ConcurrentLinkedQueue<>(); private TransactionLogWriter writer; - public AbstractTransactionLog(long timestamp, MetricsCollector metricsCollector) { + private final AtomicLong positionBeforeAppend = new AtomicLong(0); + private final AtomicInteger countSinceLastSync = new AtomicInteger(0); --- End diff -- And this can be just an `int` as well. ---