From dev-return-695-apmail-tephra-dev-archive=tephra.apache.org@tephra.incubator.apache.org Thu Jan 26 01:25:38 2017 Return-Path: X-Original-To: apmail-tephra-dev-archive@minotaur.apache.org Delivered-To: apmail-tephra-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 489A319F50 for ; Thu, 26 Jan 2017 01:25:38 +0000 (UTC) Received: (qmail 42008 invoked by uid 500); 26 Jan 2017 01:25:38 -0000 Delivered-To: apmail-tephra-dev-archive@tephra.apache.org Received: (qmail 41968 invoked by uid 500); 26 Jan 2017 01:25:38 -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 41955 invoked by uid 99); 26 Jan 2017 01:25:38 -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; Thu, 26 Jan 2017 01:25:38 +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 BE4EA1A04DA for ; Thu, 26 Jan 2017 01:25:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.198 X-Spam-Level: X-Spam-Status: No, score=-1.198 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id b7c-19oFOccz for ; Thu, 26 Jan 2017 01:25:36 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id B8C8D5FC67 for ; Thu, 26 Jan 2017 01:25:35 +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 C2F96E0555 for ; Thu, 26 Jan 2017 01:25:27 +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 DECC2252AE for ; Thu, 26 Jan 2017 01:25:26 +0000 (UTC) Date: Thu, 26 Jan 2017 01:25:26 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@tephra.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TEPHRA-210) Streamline where tephra properties are fetched in TransactionProcessor coprocessor MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TEPHRA-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15838971#comment-15838971 ] ASF GitHub Bot commented on TEPHRA-210: --------------------------------------- Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/28#discussion_r97917171 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java --- @@ -140,29 +143,37 @@ public void start(CoprocessorEnvironment e) throws IOException { ttlByFamily.put(columnDesc.getName(), ttl); } - this.allowEmptyValues = env.getConfiguration().getBoolean(TxConstants.ALLOW_EMPTY_VALUES_KEY, - TxConstants.ALLOW_EMPTY_VALUES_DEFAULT); + String allowEmptyValuesFromTableDesc = tableDesc.getValue(TxConstants.ALLOW_EMPTY_VALUES_KEY); + Configuration conf = getConfiguration(env); + boolean allowEmptyValuesFromConfig = (conf != null) ? + conf.getBoolean(TxConstants.ALLOW_EMPTY_VALUES_KEY, TxConstants.ALLOW_EMPTY_VALUES_DEFAULT) : + TxConstants.ALLOW_EMPTY_VALUES_DEFAULT; + + // If the property is not present in the tableDescriptor, get it from the Configuration + this.allowEmptyValues = (allowEmptyValuesFromTableDesc != null) ? --- End diff -- It might help readability if we move reading `allowEmptyValues` into a private method > Streamline where tephra properties are fetched in TransactionProcessor coprocessor > ---------------------------------------------------------------------------------- > > Key: TEPHRA-210 > URL: https://issues.apache.org/jira/browse/TEPHRA-210 > Project: Tephra > Issue Type: Improvement > Reporter: Gokul Gunasekaran > Assignee: Gokul Gunasekaran > Fix For: 0.11.0-incubating > > > Tephra properties that are being in the TransactionProcessor coprocessor are: > TxConstants.ALLOW_EMPTY_VALUES_KEY > TxConstants.READ_NON_TX_DATA > TxConstants.Manager.CFG_TX_MAX_LIFETIME > TxConstants.TransactionPruning.PRUNE_ENABLE > TxConstants.TransactionPruning.PRUNE_STATE_TABLE > Out of the above properties, first two are table specific and thus ideally should come from the tableDesc (and can default to the value in env.getConfiguration). The other three properties should fetched from a ``Configuration`` provided by a protected method that could be overriden by derived classes (default implementation could still fetch it from env.getConfiguration). Moreover, these two properties are used in filtering of data during Hbase client calls and thus need to be available right away (unlike the other three properties which are used only in background operations such as compaction). > Use Case: When Tephra is used in other projects, the user of TransactionProcessor coprocessor can provide a way to get this configuration instead of relying on hbase-site.xml always. > Proposal: Read the table specific properties in coprocessor, such as ALLOW_EMPTY_VALUES, READ_NON_TX_DATA from tableDescriptor and fall back to env.getConfiguration. For other three properties, introduce a method whose default implementation returns env.getConfiguration() that contains those properties, which could be overriden by derived classes. Also, these three values should loaded lazily when required during compaction/flush. -- This message was sent by Atlassian JIRA (v6.3.4#6332)