From issues-return-6694-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Wed May 8 18:04:28 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9F3B5180630 for ; Wed, 8 May 2019 20:04:28 +0200 (CEST) Received: (qmail 84466 invoked by uid 500); 8 May 2019 18:04:28 -0000 Mailing-List: contact issues-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list issues@phoenix.apache.org Received: (qmail 84454 invoked by uid 99); 8 May 2019 18:04:28 -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; Wed, 08 May 2019 18:04:28 +0000 From: GitBox To: issues@phoenix.apache.org Subject: [GitHub] [phoenix] priyankporwal commented on a change in pull request #469: PHOENIX-5156 Consistent Global Indexes for Non-Transactional Tables Message-ID: <155733866302.5950.14828552037752067177.gitbox@gitbox.apache.org> Date: Wed, 08 May 2019 18:04:23 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit priyankporwal commented on a change in pull request #469: PHOENIX-5156 Consistent Global Indexes for Non-Transactional Tables URL: https://github.com/apache/phoenix/pull/469#discussion_r282182720 ########## File path: phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java ########## @@ -116,18 +110,67 @@ private static final Log LOG = LogFactory.getLog(Indexer.class); private static final OperationStatus IGNORE = new OperationStatus(OperationStatusCode.SUCCESS); private static final OperationStatus NOWRITE = new OperationStatus(OperationStatusCode.SUCCESS); - + + /** + * Class to represent pending data table rows + */ + private static class PendingRow { + private long latestTimestamp; + private long count; + PendingRow(long latestTimestamp) { + count = 1; + this.latestTimestamp = latestTimestamp; + } + + public void add(long timestamp) { + count++; + if (latestTimestamp < timestamp) { + latestTimestamp = timestamp; + } + } + + public void remove() { + count--; + } + + public long getCount() { + return count; + } + + public long getLatestTimestamp() { + return latestTimestamp; + } + } protected IndexWriter writer; Review comment: Nit: rename writer to preWriter? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services