From user-return-54825-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Tue Jan 23 06:01:52 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id CF643180609 for ; Tue, 23 Jan 2018 06:01:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BF8E5160C4C; Tue, 23 Jan 2018 05:01:52 +0000 (UTC) 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 112C2160C4B for ; Tue, 23 Jan 2018 06:01:51 +0100 (CET) Received: (qmail 1940 invoked by uid 500); 23 Jan 2018 05:01:48 -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 1525 invoked by uid 99); 23 Jan 2018 05:01:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2018 05:01:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 683AF1A07C2 for ; Tue, 23 Jan 2018 05:01:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.629 X-Spam-Level: ** X-Spam-Status: No, score=2.629 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8QRoTwRZ6Gu3 for ; Tue, 23 Jan 2018 05:01:46 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 72F415F613 for ; Tue, 23 Jan 2018 05:01:45 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id a204so13445925lfa.2 for ; Mon, 22 Jan 2018 21:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=dZJYocOLiRvvMaqszvXsw2EpPeMTF1b97QCsIpMIx9k=; b=OwFyoOlGpbGc/MHlPkiEbZENdhuXQ2xKTApYygdRWC/Gv3f2xMhZHtnwn1EqjNR/B1 N3G/QsBbECqyMPKUK+aoysK1fRZq53Xhz+7LjNYnWUdzsknZ7xolTk3IdGTKVW8scAl7 VU3A/zH0n+UMSQGzI1A42mLOkr/O+BfSj3BJePbUI5aKscL4PbFU492Vu1S2vx43BNxg GAEYvsvMpsr5vP4f9bFScpKbWdEG23WpOL4e9L9uhiVVKya1iPgBwywudeIqJR8acILl 1ACHNUCjbsrTYFB0gA1UDrTCWMiDm+mUp0rZlfLS0iV2Ly8AaWEPV25MXZ7G7dV/vFHO GYpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=dZJYocOLiRvvMaqszvXsw2EpPeMTF1b97QCsIpMIx9k=; b=BvArWifypVuI6m7pkAfUIUlIWjDIlC1hB9bl4UZ4bQIITuxYA5PQrj6vdDW62HVQdE wW9mNE8lCbT/1YsomZrgl/V21mpV+nPVZSQc8zWXPS0cwhtPaRu0qBMBGgmRfaRcsfMW v99pR6aeUG7VmYUiDPr2jQaaQdVsu6CY5LKLJJH0BiK6s7WtJG2baVCej9nHkm2uvXOH pr4DeC1HLNeNVNexT9KPtSH6HRPu0Je7BHlBchuB1DR7/fwdl85NbNNGbzeXVZsCDRcI DbjPU7x+8AzKycn3dlFmozCxgiGZtV684mvzfDeulnnuplcK8/w8zebbcnd0+gIN5Gw0 t5LA== X-Gm-Message-State: AKwxytfGbhRzGVYEFooT3pdemooyW2B7+STVqbnKcG8qcnKvS6TCxARH zgyK1G+9hCQn1bUlQSJneb4nLTDRGYAM3X5t9D8vTA== X-Google-Smtp-Source: AH8x225iT1xPIlCZ5u+HGVybOn5ASF0yFObaTWKcIjxZkxlApklsF/m0/kCmr9EV3H239XncfA16GOWjt0gBxjFh3qY= X-Received: by 10.46.64.211 with SMTP id r80mr581126lje.149.1516683698466; Mon, 22 Jan 2018 21:01:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.211.1 with HTTP; Mon, 22 Jan 2018 21:01:37 -0800 (PST) In-Reply-To: References: From: Ted Yu Date: Mon, 22 Jan 2018 21:01:37 -0800 Message-ID: Subject: Re: Coprocessor prePut To: user@hbase.apache.org Content-Type: multipart/alternative; boundary="94eb2c1c06b815770105636a71d7" --94eb2c1c06b815770105636a71d7 Content-Type: text/plain; charset="UTF-8" Your prePut would write to a different column in the table, right ? Otherwise do you prevent normal writes from getting into the same column(s) ? If your prePut writes to dedicated column(s), you can check the presence of such column(s) so that the call is not infinite. Cheers On Mon, Jan 22, 2018 at 8:56 PM, Yang Zhang wrote: > Yes, It is the same table. > > 2018-01-23 1:46 GMT+08:00 Ted Yu : > > > Can you clarify your use case ? > > > > bq. put a data into table > > > > Does your coprocessor write to the same table which receives user data ? > > > > Cheers > > > > On Mon, Jan 22, 2018 at 4:24 AM, Yang Zhang > > wrote: > > > > > Hello Everyone > > > > > > I am using the coprocessor and want to put another data when > > > someone put a data into table. So I try prePut(), but when you call > > > HRegion.put(), this will call my coprocessor's prePut function again, > and > > > it will cause an dead loop. > > > > > > My code looks like below, If anyone know how to make HBase > call > > my > > > coprocessor just for the first time? > > > > > > @Override > > > public void prePut(ObserverContext > > > context, Put put, WALEdit edit, > > > Durability durability) throws IOException { > > > logger.info("==== Coprocessor shouldComplete : > > > "+context.shouldComplete()+"===="); > > > context.bypass(); > > > > > > Put myPut = new Put(new RowKey(1).toBytes()); > > > > > > //this call will caused an dead loop > > > context.getEnvironment().getRegion().put(put); > > > > > > } > > > > > > Thanks anyway > > > > > > --94eb2c1c06b815770105636a71d7--