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 D0570E017 for ; Thu, 6 Dec 2012 08:06:30 +0000 (UTC) Received: (qmail 72830 invoked by uid 500); 6 Dec 2012 08:06:29 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 72644 invoked by uid 500); 6 Dec 2012 08:06:28 -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 72611 invoked by uid 99); 6 Dec 2012 08:06:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 08:06:27 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of amits@infolinks.com designates 207.126.144.137 as permitted sender) Received: from [207.126.144.137] (HELO eu1sys200aog114.obsmtp.com) (207.126.144.137) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 06 Dec 2012 08:06:20 +0000 Received: from mail-la0-f69.google.com ([209.85.215.69]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKUMBR54gDfkakvGQ4GQkkIgvPLHib2YH7@postini.com; Thu, 06 Dec 2012 08:06:00 UTC Received: by mail-la0-f69.google.com with SMTP id w12so5295742lag.8 for ; Thu, 06 Dec 2012 00:05:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=vshFFTNNFV9wxnZi0vXUehIevl+MQjcG1y6ZhDqdHno=; b=DMF0Zc58DrYXNFYy/ergk6U7LIXz5JhRr7n4BFHCXAg8EE0WZ/4hhwxHQydPgXLPY+ LoUi3E5bWc7jkEqRvTwNzsxZYvV10VgEt6cGNcGRCD7zUyAHgQehL17BcCj+hNsIU2wv VLn9rebRoCN6GIYi6+LR+OfrJ8FJTz7DBNmyy+2dkETqRpFlHN9LFTGuaghuRFkZfv9G L/2sZwSeiORRxDbB9ZAjLi86yc1Et3RdeJeOXNvIUBDtaSqyfJ4QiQjVdKCY6xhYIgEj lWwbJqQK9/juPhdMrGmMPCUIqG2P8XKX7pw+O4TozXZbcNfNopRSQXtjlb1Tr70Hiw6E /usQ== Received: by 10.112.26.233 with SMTP id o9mr514283lbg.101.1354781159564; Thu, 06 Dec 2012 00:05:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.26.233 with SMTP id o9mr514278lbg.101.1354781159367; Thu, 06 Dec 2012 00:05:59 -0800 (PST) Received: by 10.114.38.204 with HTTP; Thu, 6 Dec 2012 00:05:59 -0800 (PST) In-Reply-To: References: <18B64CB4-94DB-40F1-B9D3-D6949FB6E7FD@gmail.com> Date: Thu, 6 Dec 2012 10:05:59 +0200 Message-ID: Subject: Re: Can a RegionObserver coprocessor increment counter of a row key that may not belong to the region ? From: Amit Sela To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=bcaec554dbcac0a57804d02a91bd X-Gm-Message-State: ALoCoQkaj901TEMOtUMlaJc2851nswALssn3JoTyV2cLrb6WIr5yjCFQXq7zDSKHFrsH8o01fqyZhbo1Lj1aXmDIqGUpGccRKeht8raH8bbInoau4d5OJD1PLVF3l2t+td37psOAbM8bGWAP5beyHb8+X+0NgSmNGQ== X-Virus-Checked: Checked by ClamAV on apache.org --bcaec554dbcac0a57804d02a91bd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable If I'm aggregating over the same Increment Object that triggered the Observer (the same key, same CFs but aggregating into different qualifiers), do I go outside the Region ? I know that for the cases I mentioned earlier I do but in the case I describe here don't I stay in the region ? On Thu, Dec 6, 2012 at 9:40 AM, Andrew Purtell wrote: > Summing/aggregating with a Coprocessor seems like a fine use, but it > should act upon only the data within the region to which it is > associated. > > However if it seems your Coprocessor must unavoidably update or access > data outside of its region, then either your schema design should > change (such that all data the coprocessor will operate on is > contained within the keyspace of the region); or, you should exclude > all possible client side options. For example maybe Datacube will work > for you here? See http://github.com/urbanairship/datacube > > On 12/6/12, Amit Sela wrote: > > I asked because I thought exactly what you all said but wanted to be > sure. > > My case is incrementing counters per URL where the families are time > > periods (hourly, daily...) and the qualifiers are > > impressions_criteria1,impressions_criteria2... I am going to use > > coprocessors in order to sum all impressions counters (all criteria > > segments) and then increment another counter (general count) that belon= gs > > to the same URL. > > Is that a good practice for Coprocessors (Observer) ? > > > > Thanks. > > > > > > On Wed, Dec 5, 2012 at 8:56 PM, Asaf Mesika > wrote: > > > >> Why not simply send Increment objects from the client side to HBase, t= o > >> the URL row key and to the domain row key? > >> > >> On 5 =D7=91=D7=93=D7=A6=D7=9E 2012, at 14:35, Amit Sela wrote: > >> > >> > Hi all, > >> > > >> > I have to count the occurrence of URLs in our system using the URL a= s > >> > row > >> > key and using Increment. > >> > I also want to count domains, so I was thinking of using > RegionObserver > >> > coprocessor on postIncrement() and Increment using the domain as key= . > >> > > >> > Will that work ? Is there a problem if the url key starts with 'www.= ' > >> > and > >> > the domain starts with 'aaaa' ? > >> > > >> > Thanks, > >> > > >> > Amit. > >> > >> > > > --bcaec554dbcac0a57804d02a91bd--