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 CAD52EA3B for ; Sun, 13 Jan 2013 03:59:14 +0000 (UTC) Received: (qmail 86790 invoked by uid 500); 13 Jan 2013 03:59:12 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 86490 invoked by uid 500); 13 Jan 2013 03:59:07 -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 86392 invoked by uid 99); 13 Jan 2013 03:59:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jan 2013 03:59:03 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of andrew.purtell@gmail.com designates 209.85.220.47 as permitted sender) Received: from [209.85.220.47] (HELO mail-pa0-f47.google.com) (209.85.220.47) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jan 2013 03:58:55 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa10so1661673pad.34 for ; Sat, 12 Jan 2013 19:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=FbSvyBDQcPi03v+fiy43brY2qaXOLD/u1PkhW+n93L0=; b=dmfVvz9sOWgPN4NlnB2YzQb2F/LyguYSKdohB2e7cZzAJ5Jt/NaCuDhHTXWdegpOsM gh79tpWO+VzdkiK6TzzBalyRPS2/1lao5hvIqfEJDGxHX+UYO8xzEmkmgDSBiIHJzapS sqb7WZU61RLjWXGfpCxCmaBDnbzcKIpig5yk2UPAmRNhdO9HU+qFnglmYwYO0Hvl7oZE ZPnlEUjfveflEaQukC5MZpaBaiiZUQiN1gdjOPOKFVtUR5HhDYmS6LaJCuRNlOiBTitH YK5KJ6AzTC1fd6BYihzLEGPJgwPUfdFT7h+3bQux62Skrqa4G8NyIOsohRL7+xhZ0cLa yYow== X-Received: by 10.68.239.194 with SMTP id vu2mr14685227pbc.34.1358049514433; Sat, 12 Jan 2013 19:58:34 -0800 (PST) Received: from [192.168.1.12] (adsl-69-231-23-71.dsl.irvnca.pacbell.net. [69.231.23.71]) by mx.google.com with ESMTPS id ir4sm5636531pbc.41.2013.01.12.19.58.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Jan 2013 19:58:33 -0800 (PST) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Cc: "user@hbase.apache.org" X-Mailer: iPhone Mail (10A523) From: Andrew Purtell Subject: Re: Coprocessor / threading model Date: Sat, 12 Jan 2013 19:58:30 -0800 To: "user@hbase.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org Yes, especially if the cross region communication is in process. On Jan 12, 2013, at 6:48 PM, Ted Yu wrote: > bq. Coprocessors are meant to operate on the region to which they are > associated. >=20 > For Anoop's case, the secondary table(s) have their regions aligned with > the corresponding region from primary table. Meaning, related regions are > served by the same region server. > Would writes to such regions of secondary table(s) be acceptable ? >=20 > Thanks >=20 > On Sat, Jan 12, 2013 at 6:39 PM, Andrew Purtell wrot= e: >=20 >>> In pre-put, I trigger another Put() in an external table (to build the >> secondary index). >>=20 >> We should probably call this a Coprocessor anti-pattern. >>=20 >> Coprocessors are meant to operate on the region to which they are >> associated. They are a way you can extend HBase function while it operate= s >> in region on data for the region. Think of them as loadable kernel module= s. >> They are not a general purpose server side platform for programming as if= >> you are building a HBase client (with HTable, etc.). Just because you can= >> do this doesn't mean you should. >>=20 >>=20 >> On Sat, Jan 12, 2013 at 4:06 PM, Adrien Mogenet >> wrote: >>=20 >>> Hi there, >>>=20 >>> I'm experiencing some issues with CP. I'm trying to implement an indexin= g >>> solution (inspired by Annop's slides). In pre-put, I trigger another >> Put() >>> in an external table (to build the secondary index). It works perfect fo= r >>> one client, but when I'm inserting data from 2 separate clients, I met >>> issues with HTable object (the one used in pre-Put()), because it's not >>> thread-safe. I decided to move on TablePool and that fixed my issue. >>>=20 >>> But if I increase the write-load (and concurrency) HBase is throwing a >> OOM >>> exception because it can't create new native threads. Looking at HBase >>> metrics "threads count", I see that roughly 3500 threads are created. >>>=20 >>> I'm looking for documentation about how CPs are working with threads : >>> what/when should I protect against concurrency issues ? How may I solve >> my >>> issue ? >>>=20 >>> Help is welcome :-) >>>=20 >>> -- >>> Adrien Mogenet >>> 06.59.16.64.22 >>> http://www.mogenet.me >>=20 >>=20 >>=20 >> -- >> Best regards, >>=20 >> - Andy >>=20 >> Problems worthy of attack prove their worth by hitting back. - Piet Hein >> (via Tom White) >>=20