Return-Path: X-Original-To: apmail-apex-dev-archive@minotaur.apache.org Delivered-To: apmail-apex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 09D2018C46 for ; Wed, 11 Nov 2015 02:18:34 +0000 (UTC) Received: (qmail 19221 invoked by uid 500); 11 Nov 2015 02:18:33 -0000 Delivered-To: apmail-apex-dev-archive@apex.apache.org Received: (qmail 19153 invoked by uid 500); 11 Nov 2015 02:18:33 -0000 Mailing-List: contact dev-help@apex.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.incubator.apache.org Delivered-To: mailing list dev@apex.incubator.apache.org Received: (qmail 19141 invoked by uid 99); 11 Nov 2015 02:18:33 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2015 02:18:33 +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 2B440C0473 for ; Wed, 11 Nov 2015 02:18:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3 X-Spam-Level: *** X-Spam-Status: No, score=3 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=datatorrent_com.20150623.gappssmtp.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Oj4XtV_dcYoj for ; Wed, 11 Nov 2015 02:18:24 +0000 (UTC) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 7E5A620DB9 for ; Wed, 11 Nov 2015 02:18:23 +0000 (UTC) Received: by wmww144 with SMTP id w144so142319960wmw.1 for ; Tue, 10 Nov 2015 18:18:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datatorrent_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=8pShsvrTR8klrMjTnlYGcshxfqG/QnPc4bdAwWl5HtY=; b=ozmMcLoLCTmb4yMUF3GJkQKXxOrAOc0zTr79EJZbUu/eUzZ5lkBnOrkoFCY4/jcDnY ZclJYqEyhiB2BHpC+BBS8iZJ3r4zIAqssFUJcWhz5WxfI2X+N8AOT52hwT0bz6P1vnuJ CFdES2BAVoPyOAjt0ryscru21VzUNsGVhaMcQbuKVxTnh91UUqG9dLk9+qV1OoksAmWy PGeYeGYXcRyORrN5Y8b16h/P6HuyT5HCzxdrIDQi9e3h4zSoASHQaD4nnV6s+boMNqNT swqhQr0SFeB7RU+d5kA7X0LqqSzOz1sPbuH80K7vYF8bQkfIcih/ZD4fyMqGuY9Gj3vn e9iw== 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:content-type; bh=8pShsvrTR8klrMjTnlYGcshxfqG/QnPc4bdAwWl5HtY=; b=ik9HumInA0IalGiHIU/2BCRUMxYY0MN1s9mb8UW/8CckYZ3R/l/S6+lAwoEJwo9cna rLqucgJ5PoGhtyFc45yga25A8OT95DHrWiKwNReYttqOjkXmZ3Y+Qo2COy0akbXEvukf 87NGUhTdGJHMk36vI+h61z/1AB/aIHW9CYcR6+TukCKlVvDhl2zA+VpBLTT5/CPuV08u uRdg2VeDfvmXKPR20yr3+w09IoCyNZcRaB59YAy44XwvQ9pCFFvNC8mzqDHyz8+nETiw vT8dM5MGbrFq1y+t28hx1CTm1sMNBbce/q/dLtU0hbgWwsrBPmno8RZJrCJuzdXHTsfd HbTQ== X-Gm-Message-State: ALoCoQlX/LjiQSKX9ZM/vwDBYrqu1Pa2LwDXHPkd0+F7nkIrNNSfbS5IDdfmOx+nRANX8n23t57d MIME-Version: 1.0 X-Received: by 10.28.21.17 with SMTP id 17mr37026962wmv.82.1447208302937; Tue, 10 Nov 2015 18:18:22 -0800 (PST) Received: by 10.28.220.70 with HTTP; Tue, 10 Nov 2015 18:18:22 -0800 (PST) In-Reply-To: References: Date: Tue, 10 Nov 2015 18:18:22 -0800 Message-ID: Subject: Re: Fault-tolerant cache backed by a store From: Chandni Singh To: dev@apex.incubator.apache.org Content-Type: multipart/alternative; boundary=001a1145b13cd01c1505243a70fe --001a1145b13cd01c1505243a70fe Content-Type: text/plain; charset=UTF-8 Have added some more details about a Bucket in the document. Have a look. On Sun, Nov 8, 2015 at 10:37 PM, Chandni Singh wrote: > Forgot to attach the link. > > https://docs.google.com/document/d/1gRWN9ufKSZSZD0N-pthlhpC9TZ8KwJ6hJlAX6nxl5f8/edit#heading=h.wlc0p58uzygb > > > On Sun, Nov 8, 2015 at 10:36 PM, Chandni Singh > wrote: > >> Hi, >> This contains the overview of large state management. >> Some parts need more description which I am working on but please free to >> go through it and any feedback is appreciated. >> >> Thanks, >> Chandni >> >> >> On Tue, Oct 20, 2015 at 8:31 AM, Pramod Immaneni >> wrote: >> >>> This is a much needed component Chandni. >>> >>> The API for the cache will be important as users will be able to plugin >>> different implementations in future like those based off of popular >>> distributed in-memory caches. Ehcache is a popular cache mechanism and >>> API >>> that comes to bind. It comes bundled with a non-distributed >>> implementation >>> but there are commercial distributed implementations of it as well like >>> BigMemory. >>> >>> Given our needs for fault tolerance we may not be able to adopt the >>> ehcache >>> API as is but an extension of it might work. We would still provide a >>> default implementation but going off of a well recognized API will >>> facilitate development of other implementations in future based off of >>> popular implementations already available. We will need to investigate if >>> we can use the API as is or with relatively straightforward extensions >>> which will be a positive for using it. But if the API turns out to be >>> significantly deviating from what we need then that would be a negative. >>> >>> Also it would be great if we could support an iterator to scan all the >>> keys, lazy loading as needed, since this need comes up from time to time >>> in >>> different scenarios such as change data capture calculations. >>> >>> Thanks. >>> >>> On Mon, Oct 19, 2015 at 9:10 PM, Chandni Singh >>> wrote: >>> >>> > Hi All, >>> > >>> > While working on making the Join operator fault-tolerant, we realized >>> the >>> > need of a fault-tolerant Cache in Malhar library. >>> > >>> > This cache is useful for any operator which is state-full and stores >>> > key/values for a very long period (more than an hour). >>> > >>> > The problem with just having a non-transient HashMap for the cache is >>> that >>> > over a period of time this state will become so large that >>> checkpointing it >>> > will be very costly and will cause bigger issues. >>> > >>> > In order to address this we need to checkpoint the state iteratively, >>> i.e., >>> > save the difference in state at every application window. >>> > >>> > This brings forward the following broad requirements for the cache: >>> > 1. The cache needs to have a max size and is backed by a filesystem. >>> > >>> > 2. When this threshold is reached, then adding more data to it should >>> evict >>> > older entries from memory. >>> > >>> > 3. To minimize cache misses, a block of data is loaded in memory. >>> > >>> > 4. A block or bucket to which a key belongs is provided by the user >>> > (operator in this case) as the information about closeness in keys >>> (that >>> > can potentially reduce future misses) is not known to the cache but to >>> the >>> > user. >>> > >>> > 5. lazy load the keys in case of operator failure >>> > >>> > 6. To offset the cost of loading a block of keys when there is a miss, >>> > loading can be done asynchronously with a callback that indicates when >>> the >>> > key is available. This allows the operator to process other keys which >>> are >>> > in memory. >>> > >>> > 7. data that is spilled over needs to be purged when it is not needed >>> > anymore. >>> > >>> > >>> > In past we solved this problem with BucketManager which is not in open >>> > source now and also there were some limitations with the bucket api - >>> the >>> > biggest one is that it doesn't allow to save multiple values for a key. >>> > >>> > My plan is to create a similar solution as BucketManager in Malhar with >>> > improved api. >>> > Also save the data on hdfs in TFile which provides better performance >>> when >>> > saving key/values. >>> > >>> > Thanks, >>> > Chandni >>> > >>> >> >> > --001a1145b13cd01c1505243a70fe--