Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2929010070 for ; Fri, 18 Apr 2014 07:57:58 +0000 (UTC) Received: (qmail 71277 invoked by uid 500); 18 Apr 2014 06:55:55 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 70816 invoked by uid 500); 18 Apr 2014 06:55:54 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 70808 invoked by uid 99); 18 Apr 2014 06:55:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2014 06:55:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tychang@gmail.com designates 209.85.213.45 as permitted sender) Received: from [209.85.213.45] (HELO mail-yh0-f45.google.com) (209.85.213.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2014 06:55:47 +0000 Received: by mail-yh0-f45.google.com with SMTP id a41so1227737yho.18 for ; Thu, 17 Apr 2014 23:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=nVT17BJJzxD78luwYCWMUroHo3y1p6Bi6EDXw7TuWLU=; b=ICXraOvph2uykRh625I08VlYPL3xGm0zHZohMMRmuwGXJR/WENi7RaAjrR6VEwCt7n BBg6FxaUJ2waqBObLEFSQxsd+PU5ZN+1S1GqFzNyGSPIJfrG5LP9s6YP/vPfykVT64Gk lqOw6Lasx7WonOl4jw0+YOuZ9vSs+o3ARlCJ0OkCxL1foBUgl/7Z8BTe09U/rngaGwcU fnyUr/rjroo6O/iAOyJgYeAeB67IxeYY/4/wB+CGYuhnz+xPBHWthhom8V4qRD+CJjeI FYDnpVPcw/ceGhvk8AII4DrZNYnrhJ9Toox1g84r6GHaf4F9TFokYpzaxnjMbfuMy/cK c3Pw== MIME-Version: 1.0 X-Received: by 10.236.110.131 with SMTP id u3mr192673yhg.99.1397804127186; Thu, 17 Apr 2014 23:55:27 -0700 (PDT) Received: by 10.170.166.67 with HTTP; Thu, 17 Apr 2014 23:55:27 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Apr 2014 23:55:27 -0700 Message-ID: Subject: Re: Will BloomFilter still be cached if setCacheBlocks(false) per Get()? From: Tianying Chang To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=001a1133236c7771fc04f74ba273 X-Virus-Checked: Checked by ClamAV on apache.org --001a1133236c7771fc04f74ba273 Content-Type: text/plain; charset=UTF-8 Ted, thanks, I am convinced that BLOOM is cached even when block cache turned off per-family or per-query, because the code in CompoundBloomFilter.java below. The highlighted "true" made sure the cacheBlock is on for BLOOM reader.readBlock(index.getRootBlockOffset(block), index.getRootBlockDataSize(block), true, true, false, BlockType.BLOOM_CHUNK); On Thu, Apr 17, 2014 at 3:39 PM, Ted Yu wrote: > Tianying: > Please take a look at CacheConfig#shouldCacheBlockOnRead() which is called > by HFileReaderV2#readBlock() > > Cheers > > > On Wed, Apr 16, 2014 at 5:39 PM, Tianying Chang wrote: > > > Cool. Thanks! > > > > Just to dig deeper, is this because BloomFilter is part of Meta, and > Meta > > block always cached no matter what? > > > > Or it is because the BloomFilter is in the upper level of the searchTree > in > > the code path I pasted? I guess that code path is actually for data > block, > > not meta block? > > > > // Call HFile's caching block reader API. We always cache index > > // blocks, otherwise we might get terrible performance. > > boolean shouldCache = cacheBlocks || (lookupLevel < > > searchTreeLevel); > > BlockType expectedBlockType; > > if (lookupLevel < searchTreeLevel - 1) { > > expectedBlockType = BlockType.INTERMEDIATE_INDEX; > > } else if (lookupLevel == searchTreeLevel - 1) { > > expectedBlockType = BlockType.LEAF_INDEX; > > } else { > > // this also accounts for ENCODED_DATA > > expectedBlockType = BlockType.DATA; > > } > > > > > > On Wed, Apr 16, 2014 at 4:59 PM, Ted Yu wrote: > > > > > bq. it is always cached on read even when per-family/per-query > > cacheBlocks > > > is turned off. > > > > > > True. > > > > > > > > > On Wed, Apr 16, 2014 at 4:41 PM, Tianying Chang > > wrote: > > > > > > > Hi, > > > > > > > > We have a use case where some data are mostly random read, so it > > polluted > > > > cache and caused big GC. It is better to turn off the block cache for > > > those > > > > data. So we are going to call setCacheBlocks(false) for those get(). > We > > > > know that the index will be still cached based on below code path, so > > we > > > > are safe there. But it is not clear if BloomFilter belong to the > > level < > > > > searchTreeLevel, and also get cached also. > > > > > > > > // Call HFile's caching block reader API. We always cache > > index > > > > // blocks, otherwise we might get terrible performance. > > > > boolean shouldCache = cacheBlocks || (lookupLevel < > > > > searchTreeLevel); > > > > BlockType expectedBlockType; > > > > if (lookupLevel < searchTreeLevel - 1) { > > > > expectedBlockType = BlockType.INTERMEDIATE_INDEX; > > > > } else if (lookupLevel == searchTreeLevel - 1) { > > > > expectedBlockType = BlockType.LEAF_INDEX; > > > > } else { > > > > // this also accounts for ENCODED_DATA > > > > expectedBlockType = BlockType.DATA; > > > > } > > > > > > > > Or I think because BloomFilter is part of Meta data, so it is always > > > cached > > > > on read even when per-family/per-query cacheBlocks is turned off. Am > I > > > > right? > > > > > > > > Thanks > > > > Tian-Ying > > > > > > > > > > --001a1133236c7771fc04f74ba273--