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 7B8F4200C6E for ; Mon, 8 May 2017 23:17:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7A312160BA5; Mon, 8 May 2017 21:17:52 +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 C281C160BA2 for ; Mon, 8 May 2017 23:17:51 +0200 (CEST) Received: (qmail 18637 invoked by uid 500); 8 May 2017 21:17:51 -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 18626 invoked by uid 99); 8 May 2017 21:17:50 -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 21:17:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 94F32DFBC8; Mon, 8 May 2017 21:17:50 +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: <20170508211750.94F32DFBC8@git1-us-west.apache.org> Date: Mon, 8 May 2017 21:17:50 +0000 (UTC) archived-at: Mon, 08 May 2017 21:17:52 -0000 Github user keith-turner commented on a diff in the pull request: https://github.com/apache/accumulo/pull/256#discussion_r115355497 --- 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 -- Also, putting the CacheType i the factory API allows the user to tune the cache differently for index vs data vs summary. For example if my cache impl has 5 tuning parameters, I may want to set tune differently for index vs data cache. --- 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. ---