Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 594D6116D0 for ; Wed, 24 Sep 2014 14:30:56 +0000 (UTC) Received: (qmail 83489 invoked by uid 500); 24 Sep 2014 14:30:56 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 83448 invoked by uid 500); 24 Sep 2014 14:30:56 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 83438 invoked by uid 99); 24 Sep 2014 14:30:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2014 14:30:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 209.85.212.169 as permitted sender) Received: from [209.85.212.169] (HELO mail-wi0-f169.google.com) (209.85.212.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2014 14:30:27 +0000 Received: by mail-wi0-f169.google.com with SMTP id fb4so6596865wid.2 for ; Wed, 24 Sep 2014 07:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=pKoeyR8lRuhTF8lNDK5qX36WZXGObAr7iKovbddGuqM=; b=BHUDLzll1o+3HK1ewdJZEGGPDDT1r2XZY2KgJUrB+jL3mYQ4asxFvKtqaB3cIxZHMG 4uOL5R/YkIA/Q6JQMGkUgxEeb8nfh5q6YuV1sy8vuAKanWI8QEY5nZ04V6kW5zdMyP5/ vTdfJOH7yOgYXUARFWwArIfjXhl9p4iOrhAgCTY4lQqR3PWKDpwwOVR2dYOyr0pgLVVi EEJsQ8wm1EPICzU2shmnLRbQqrTu2rxPdBnrneSqLvGr1D/Yvr+iTE8SYpory0pd1IYL IeZ4VuJX3Nxj0CDd8R4NB7+jH/JJeBpGrfEB+6MwWgPOnwVCveJ64Tz7wtBoVzoT7SbT jB1w== X-Received: by 10.194.84.42 with SMTP id v10mr8512307wjy.63.1411569026973; Wed, 24 Sep 2014 07:30:26 -0700 (PDT) Received: from [192.168.50.213] (dan75-7-88-166-187-231.fbx.proxad.net. [88.166.187.231]) by mx.google.com with ESMTPSA id ny6sm5955977wic.22.2014.09.24.07.30.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Sep 2014 07:30:26 -0700 (PDT) Message-ID: <5422D580.70503@gmail.com> Date: Wed, 24 Sep 2014 16:30:24 +0200 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: dev@directory.apache.org Subject: Re: Mavibot bulkloader update References: <54228B9F.4000605@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Le 24/09/14 14:07, Kiran Ayyagari a écrit : > On Wed, Sep 24, 2014 at 2:45 PM, Emmanuel Lécharny > wrote: > >> Hi guys, >> >> a quick update on the bulkloader development...Using what Kiran did in >> the mavibot-partition-bulkloader, I moved the part that specifically >> handle the BTree bulkloading to Mavibot, because there is no reason >> someone could not bulkload any kind of data into a BTree. >> >> I created a BulkLoader class in Mavibot for that purpose. The bulk >> loading is a 2 phases process : >> - sort the data >> - create the btree >> >> We had something working for in-memory data (ie, when you can read >> everything in memory), but when it comes to read huge set of data, you >> have to write sorted data on disk. This was what I was working on >> lately. Basically, we read a chunk of data, and when we reach a given >> number (configurable), we sort what we read and write it back on disk. I >> tested it with 10M elements, written on 100 files. The deal is to merge >> the sorted data when we read them back from the files (as each file is >> sorted, it's just a matter to take the sammlest value from all the files). >> >> All in all, this part is now working. >> >> The second phase was an issue in the current bulkload implementation : >> it left the btree unbalanced (when you fill the leaves completely, the >> last leaf may contain less than N/2 elements : the current >> implementation didn't handle this case). It was quite a challenge to >> balance a btree when you were buildling it, as the pb spread to all the >> upper layers. After a few hours thinking about the best way to do it >> without having to shuffle many already written pages, I realized that we >> actually *know* how many entries we have in the BTree, as we have sorted >> the entries at first ! Knowing the numbe rof elements is the key : you >> can predict how the btree should be balanced. >> >> This is the part I'm working on atm. >> >> There are a few things that need some love still : >> - the entrySerializer has to be moved from JDBM to the Mavibot Partition >> > can we move this to a xdbm-partition module? Sure ! This is the exact place it should go to. > >> - the Mavibot partition builder has to be rewritten using the Mavibot >> bulkloader (but that should be easy, as we just have to call the >> BulkLoader primitive) >> - the In-memory bulk load has to be implemented >> - I'd like to implement a compact() method taht takes an existing BTree >> and compact it on the fly >> > hmm, how about applying this to the entire database level rather than just > an individual BTree? The compact method will be for one single tree, but we can extend it to the partition, but the it will be a partition specific method. Note that compacting a full partition is most certainly problematic, as it will block writes for potentially minutes (or worse...) OTOH, we benefit from the fact that the data are already sorted, so we spare teh first phase. > - we have to deal with the RecordManager, because atm we can't have it >> opened while processing a btree. It could be interesting to be able to >> compact a btree while the RM is up and running (assuming no write >> operation is done in the mean time). >> >> right, this is why I think compacting should be applied to entire database > instead of a single BTree. > > otoh, bulkloader will be quite handy here while compacting, all we need to > do is pass the relevant cursors of the existing BTrees. Yes.