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 35F1B200ACC for ; Mon, 2 May 2016 19:06:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 347ED1609B0; Mon, 2 May 2016 19:06:59 +0200 (CEST) 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 53EDF1609A6 for ; Mon, 2 May 2016 19:06:58 +0200 (CEST) Received: (qmail 86352 invoked by uid 500); 2 May 2016 17:06:57 -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 86340 invoked by uid 99); 2 May 2016 17:06:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 17:06:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EB896C04B9 for ; Mon, 2 May 2016 17:06:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.429 X-Spam-Level: * X-Spam-Status: No, score=1.429 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id pxvRyrd3rbUr for ; Mon, 2 May 2016 17:06:53 +0000 (UTC) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E944A5FBB9 for ; Mon, 2 May 2016 17:06:53 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id n129so115488138wmn.1 for ; Mon, 02 May 2016 10:06:53 -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; bh=Gcyn62y0pjfM6d0whaYTcLi1WnMMMNEpQJpoHYKEgpY=; b=wBsh+72OiLd0OYd4bLYrp5Q49K/9N7MBuT5OUo/XTjLa7yee9sSSZEvFWIx897dWLt xywZ6Ll7563xrk8SLavjMg1LYDIuyuh0j0NUBna8Q7WqDBRrMpR4Bpk7pCslKGoK7EB8 xw35s9rWmXAABu1G1veEYW0dGg3lPmZ+Vnz/LQ/qZeiFdwo6HIFHgY6R+qHcw/ycyA8n wCIBStaw81toAGkPHBhBU6PS/8lALSHkOfb+Ak+swntSkAYH7rOLwrTMh18SjtRBtQAr 5C7m+9RAoP5nsVcyRe9RWWFH5eg63euv7a6fnhodzLPSo6vyhQ1362WCj6Mj5sSomuPH WYqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=Gcyn62y0pjfM6d0whaYTcLi1WnMMMNEpQJpoHYKEgpY=; b=U9lzz48IzQGLfgJKMqpxSSYRsbKWhLSXnqo4xe/7Gz8ew0wdwz9XBSUjUk7m0h5PZR 2IlEhvX54cdy5363SeVz8Epmn+YzTueQmidQ4znJIqIfQuyeXoETY/M770iW6xMmFZpv B/eHnyri1LyEljQ3251+act3lEp0jU61Q16BNf7nzPrqhwT6igxnPS9UdMfDNLu2/IU4 9tCS2lgo8yTNmRrxA1uMuLBro2IlqBI7u07Uol/qAemAKK10fG3igBNS3B1HZNEwxXTJ ZjITs1RptZKsmiAn0h+FjIIGHCc8n+mmH8+at4ES9j0z2aUQcpHhuoGPfjowz0vb+q3+ HwwA== X-Gm-Message-State: AOPr4FV4o4I/K5hOPfeKWKjHDxr4FwPgNVfaohQCrOLuslnmDNeaqWy4ErpUECDwMSxzmer4kiaeRy2Ws7Ms2A== MIME-Version: 1.0 X-Received: by 10.194.115.230 with SMTP id jr6mr5396072wjb.125.1462208813599; Mon, 02 May 2016 10:06:53 -0700 (PDT) Received: by 10.28.170.81 with HTTP; Mon, 2 May 2016 10:06:53 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 May 2016 22:36:53 +0530 Message-ID: Subject: Re: hbase architecture doubts From: Shushant Arora To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=001a1130d27cec144b0531df0481 archived-at: Mon, 02 May 2016 17:06:59 -0000 --001a1130d27cec144b0531df0481 Content-Type: text/plain; charset=UTF-8 Thanks Stack for point 2 : I am concerned with downtime of Hbase for read and write. If write lock is just for the time while we move aside the current MemStore. Then when a write happens to key will it update the memstore only but snapshot does not have that update and when snapshot is dunmped to Hfile won't we loose the update? On Mon, May 2, 2016 at 9:06 PM, Stack wrote: > On Mon, May 2, 2016 at 1:25 AM, Shushant Arora > wrote: > > > Thanks! > > > > Few doubts; > > > > 1.LSM tree comprises two tree-like > > structures, called > > C0 and > > C1 and If the insertion causes the C0 component to exceed a certain size > > threshold, a contiguous segment of entries is removed from C0 and merged > > into C1 on disk > > > > But in Hbase when C0 which is memstore I guess? is exceeded the threshold > > size its dumped on to HDFS as HFIle(c1 I guess?) - and does compaction is > > the process which here means as merging of C0 and C1 ? > > > > > The 'merge' in the quoted high-level description may just mean that the > dumped hfile is 'merged' with the others at read time. Or it may be as > stated, that the 'merge' happens at flush time. Some LSM tree > implementations do it this way -- Bigtable, and it calls the merge of > memstore and a file-on-disk a form of compaction -- but this is not what > HBase does; it just dumps the memstore as a flushed hfile. Later, we'll run > a compaction process to merge hfiles in background. > > > > > 2.Moves current, active Map aside as a snapshot (while a write lock is > held > > for a short period of time), and then creates a new CSLS instances. > > > > In background, the snapshot is then dumped to disk. We get an Iterator on > > CSLS. We write a block at a time. When we exceed configured block size, > we > > start a new one. > > > > -- Does write lock is held till the time complete CSLS is dumpled on > > disk. > > > > No. Just while we move aside the current MemStore. > > What is your concern/objective? Are you studying LSM trees generally or are > you worried that HBase is offline for periods of time for read and write? > > Thanks, > St.Ack > > > > > And read is allowed using snapshot. > > > > > > > > > Thanks! > > > > > > > > On Mon, May 2, 2016 at 11:39 AM, Stack wrote: > > > > > On Sun, May 1, 2016 at 3:36 AM, Shushant Arora < > > shushantarora09@gmail.com> > > > wrote: > > > > > > > 1.Does Hbase uses ConcurrentskipListMap(CSLM) to store data in > > memstore? > > > > > > > > Yes (We use a CSLS but this is implemented over a CSLM). > > > > > > > > > > 2.When mwmstore is flushed to HDFS- does it dump the memstore > > > > Concurrentskiplist as Hfile2? Then How does it calculates blocks out > of > > > > CSLM and dmp them in HDFS. > > > > > > > > > > > Moves current, active Map aside as a snapshot (while a write lock is > held > > > for a short period of time), and then creates a new CSLS instances. > > > > > > In background, the snapshot is then dumped to disk. We get an Iterator > on > > > CSLS. We write a block at a time. When we exceed configured block size, > > we > > > start a new one. > > > > > > > > > > 3.After dumping the inmemory CSLM of memstore to HFILe does memstore > > > > content is discarded > > > > > > > > > Yes > > > > > > > > > > > > > and if while dumping memstore any read request comes > > > > will it be responded by copy of memstore or discard of memstore will > be > > > > blocked until read request is completed? > > > > > > > > We will respond using the snapshot until it has been successfully > > dumped. > > > Once dumped, we'll respond using the hfile. > > > > > > No blocking (other than for the short period during which the snapshot > is > > > made and the file is swapped into the read path). > > > > > > > > > > > > > 4.When a read request comes does it look in inmemory CSLM and then in > > > > HFile? > > > > > > > > > Generally, yes. > > > > > > > > > > > > > And what is LogStructuredMerge tree and its usage in Hbase. > > > > > > > > > > > Suggest you read up on LSM Trees ( > > > https://en.wikipedia.org/wiki/Log-structured_merge-tree) and if you > > still > > > can't see the LSM tree in the HBase forest, ask specific questions and > > > we'll help you out. > > > > > > St.Ack > > > > > > > > > > > > > > > > Thanks! > > > > > > > > > > --001a1130d27cec144b0531df0481--