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 859FB200C7E for ; Mon, 8 May 2017 22:51:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 845C5160BA2; Mon, 8 May 2017 20:51:06 +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 CC2C4160BC7 for ; Mon, 8 May 2017 22:51:05 +0200 (CEST) Received: (qmail 20181 invoked by uid 500); 8 May 2017 20:51:04 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 19698 invoked by uid 99); 8 May 2017 20:51:04 -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; Mon, 08 May 2017 20:51:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 578A9DFF66; Mon, 8 May 2017 20:51:04 +0000 (UTC) From: keith-turner To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request #256: ACCUMULO-4463: Make block cache implentation con... Content-Type: text/plain Message-Id: <20170508205104.578A9DFF66@git1-us-west.apache.org> Date: Mon, 8 May 2017 20:51:04 +0000 (UTC) archived-at: Mon, 08 May 2017 20:51:06 -0000 Github user keith-turner commented on a diff in the pull request: https://github.com/apache/accumulo/pull/256#discussion_r115350017 --- Diff: server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java --- @@ -175,19 +176,27 @@ public TabletServerResourceManager(TabletServer tserver, VolumeManager fs) { long sCacheSize = acuConf.getAsBytes(Property.TSERV_SUMMARYCACHE_SIZE); long totalQueueSize = acuConf.getAsBytes(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX); - String policy = acuConf.get(Property.TSERV_CACHE_POLICY); - if (policy.equalsIgnoreCase("LRU")) { - _iCache = new LruBlockCache(iCacheSize, blockSize); - _dCache = new LruBlockCache(dCacheSize, blockSize); - _sCache = new LruBlockCache(sCacheSize, blockSize); - } else if (policy.equalsIgnoreCase("TinyLFU")) { - _iCache = new TinyLfuBlockCache(iCacheSize, blockSize); - _dCache = new TinyLfuBlockCache(dCacheSize, blockSize); - _sCache = new TinyLfuBlockCache(sCacheSize, blockSize); - } else { - throw new IllegalArgumentException("Unknown Block cache policy " + policy); + BlockCacheFactory factory; + try { + factory = BlockCacheFactory.getBlockCacheFactory(acuConf); + } catch (Exception e) { + throw new RuntimeException("Error creating Block Cache Factory", e); } + ConfigurationCopy copy = new ConfigurationCopy(acuConf); + copy.set(BlockCacheConfiguration.BLOCK_SIZE_PROPERTY, Long.toString(blockSize)); + copy.set(BlockCacheConfiguration.MAX_SIZE_PROPERTY, Long.toString(iCacheSize)); --- End diff -- This behavior is kind of tricky. What if these properties were already set in acuConf, what should the behavior be? The javadoc for BlockCacheFactory would need to mention this behavior. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---