Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DC2C5200D16 for ; Tue, 10 Oct 2017 20:50:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DAAA2160BE0; Tue, 10 Oct 2017 18:50:54 +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 2B5F61609CB for ; Tue, 10 Oct 2017 20:50:54 +0200 (CEST) Received: (qmail 28992 invoked by uid 500); 10 Oct 2017 18:50:53 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 28977 invoked by uid 99); 10 Oct 2017 18:50:52 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2017 18:50:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id BE1361841CD for ; Tue, 10 Oct 2017 18:50:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id g1xYbf0tVl5K for ; Tue, 10 Oct 2017 18:50:50 +0000 (UTC) Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com [209.85.216.172]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 79DED5F569 for ; Tue, 10 Oct 2017 18:50:50 +0000 (UTC) Received: by mail-qt0-f172.google.com with SMTP id f15so54332993qtf.7 for ; Tue, 10 Oct 2017 11:50:50 -0700 (PDT) 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=I2FonUu3xCeq7wrQTzZfcsBcKN6PYqTD/QfxBJcuHFg=; b=iilJId4f5GXk+mQRh10vOCXR+uQNqLYeWgZnmoDpOa7XP7ZS+HG7HHg5WNQcoItTa8 6iiZzSWr+WQXI2YiGOqwa3u30F73RAm1eumd83YAtHTGTJuQh674EYdr6FG8f8jzs+M8 pq3Gt2sRsqWL+l8Y9Ufn/wAZBtxcNYd/1VQVI498nyuWoLW40rZ75CkjiT63PKFjOd3C u6NhJLM9mULwH1/LMw4Xn8wxgNUAremR7CT5e3C8HAnp3DHbhzxAuQdV02kojuAHo9lP 5NVoM4vkIyjPYvKTpEhNPqHe98Yth9I4jnOhQI6mg2zC73Ppe+JmQH7C2urQy/62jaFf puzQ== 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=I2FonUu3xCeq7wrQTzZfcsBcKN6PYqTD/QfxBJcuHFg=; b=SDn5FSQkyr9u6ckXVYXFd551EcPcNrqCu3Ll6fohkDdg9cJdlkBrasCAK/m8FWXcEt 23S5NT3JgLM5KX9DtSZP86Hq4bbITAJVnbwezrcqC1IFgG3LG+2zb74GQTgrRePO61C9 j957/t8FLRx/uZp0JocVMPAetfM9yHYU6C6TkSNn2M8J2Mgig5rULU8uwdQ0f3J5YpYp oqdlD4y7N9rZAxSwRzk9g2xG83el42S1qrRa06DvLOSUIeTcQ+MT+eil6d9Uy5fuSMlC 8yPgpY3nXid56n5MzyrcDQJLmT9wqrtXcZSfFkSu6hSzSk/SIfC0OfuRh3NY3JKip/EC uidA== X-Gm-Message-State: AMCzsaXSa+Vex0qxSGs9R8gCR52OasHahvSHxiSpAY1OHZPHRW6bQ9P0 AaX/7UU70KydXeKMoUoX5mU+Ii6fZVi6+MH528Q= X-Google-Smtp-Source: AOwi7QBLv9zdN2wO9gNYxkMeN2Ke9Ul/pD7Bw7+NAS5tK1U5Gvtm3EpmCnioyTKmv1IaFBtql7F70hUA6V4VU3sHXj4= X-Received: by 10.37.175.204 with SMTP id d12mr2800854ybj.46.1507661449968; Tue, 10 Oct 2017 11:50:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.62.33 with HTTP; Tue, 10 Oct 2017 11:50:49 -0700 (PDT) In-Reply-To: References: From: Anoop John Date: Wed, 11 Oct 2017 00:20:49 +0530 Message-ID: Subject: Re: [DISCUSSION] Removing the bypass semantic from the Coprocessor APIs To: "dev@hbase.apache.org" Content-Type: text/plain; charset="UTF-8" archived-at: Tue, 10 Oct 2017 18:50:55 -0000 When we say bypass the core code, it can be done today not only by calling bypass but by returning a not null object for some of the pre hooks. Like preScannerOpen() if it return a scanner object, we will avoid the remaining core code execution for creation of the scanner(s). So this proposal include this aspect also and remove any possible way of bypassing the core code by the CP hook code execution ? Am +1. -Anoop- On Tue, Oct 10, 2017 at 11:40 PM, Andrew Purtell wrote: > The coprocessor API provides an environment method, bypass(), that when > called from a preXXX hook will cause the core code to skip all remaining > processing. This capability was introduced on HBASE-3348. Since this time I > think we are more enlightened about the complications of this feature. (Or, > anyway, speaking for myself:) > > Not all hooks provide the bypass semantic. Where this is the case the > javadoc for the hook says so, but it can be missed. If you call bypass() in > a hook where it is not supported it is a no-op. This can lead to a poor > developer experience. > > Where bypass is supported what is being bypassed is all of the core code > implementing the remainder of the operation. In order to understand what > calling bypass() will skip, a coprocessor implementer should read and > understand all of the remaining code and its nuances. Although I think this > is good practice for coprocessor developers in general, it demands a lot. I > think it would provide a much better developer experience if we didn't > allow bypass, even though it means - in theory - a coprocessor would be a > lot more limited in some ways than before. What is skipped is extremely > version dependent. That core code will vary, perhaps significantly, even > between point releases. We do not provide the promise of consistent > behavior even between point releases for the bypass semantic. To achieve > that we could not change any code between hook points. Therefore the > coprocessor implementer becomes an HBase core developer in practice as soon > as they rely on bypass(). Every release of HBase may break the assumption > that the replacement for the bypassed code takes care of all necessary > skipped concerns. Because those concerns can change at any point, such an > assumption is never safe. > > I say "in theory" because I would be surprised if anyone is relying on the > bypass for the above reason. I seem to recall that Phoenix might use it in > one place to promote a normal mutation into an atomic operation, by > substituting one for the other, but if so that objective could be > reimplemented using their new locking manager. > > -- > Best regards, > Andrew