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 DC809200C14 for ; Tue, 7 Feb 2017 20:15:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DB3C1160B32; Tue, 7 Feb 2017 19:15:46 +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 31B98160B3E for ; Tue, 7 Feb 2017 20:15:46 +0100 (CET) Received: (qmail 30797 invoked by uid 500); 7 Feb 2017 19:15:45 -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 30786 invoked by uid 99); 7 Feb 2017 19:15:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2017 19:15:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id EAB941A00BB for ; Tue, 7 Feb 2017 19:15:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Tf2lcAqFKTTp for ; Tue, 7 Feb 2017 19:15:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id C6AC45F1BA for ; Tue, 7 Feb 2017 19:15:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 37798E012C for ; Tue, 7 Feb 2017 19:15:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id E97A425286 for ; Tue, 7 Feb 2017 19:15:41 +0000 (UTC) Date: Tue, 7 Feb 2017 19:15:41 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@tephra.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TEPHRA-215) Share PruneUpperBoundWriter across all TransactionProcessors on the same region server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 07 Feb 2017 19:15:47 -0000 [ https://issues.apache.org/jira/browse/TEPHRA-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15856593#comment-15856593 ] ASF GitHub Bot commented on TEPHRA-215: --------------------------------------- Github user gokulavasan commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/32#discussion_r99903840 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriterSupplier.java --- @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.tephra.hbase.txprune; + + +import com.google.common.base.Supplier; + +/** + * Supplies instances of {@link PruneUpperBoundWriter} implementations. + */ +public class PruneUpperBoundWriterSupplier implements Supplier { + + private final DataJanitorState dataJanitorState; + private final long pruneFlushInterval; + + protected static volatile PruneUpperBoundWriter instance; + protected static Object lock = new Object(); + + public PruneUpperBoundWriterSupplier(DataJanitorState dataJanitorState, long pruneFlushInterval) { + this.dataJanitorState = dataJanitorState; + this.pruneFlushInterval = pruneFlushInterval; + } + + @Override + public PruneUpperBoundWriter get() { + if (instance == null) { + synchronized (lock) { + if (instance == null) { + instance = new PruneUpperBoundWriter(dataJanitorState, pruneFlushInterval); + instance.start(); --- End diff -- @poornachandra Do you have any thoughts on how to address this? > Share PruneUpperBoundWriter across all TransactionProcessors on the same region server > -------------------------------------------------------------------------------------- > > Key: TEPHRA-215 > URL: https://issues.apache.org/jira/browse/TEPHRA-215 > Project: Tephra > Issue Type: Improvement > Affects Versions: 0.11.0-incubating > Reporter: Gokul Gunasekaran > Assignee: Gokul Gunasekaran > Fix For: 0.11.0-incubating > > > Currently we start one prune upperbound writer thread per TransactionProcessor coprocessor. Instead we should be able to share only one thread that flushes writes to the prune state table periodically. -- This message was sent by Atlassian JIRA (v6.3.15#6346)