From user-return-56494-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Thu Feb 13 16:53:50 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 615D41802C7 for ; Thu, 13 Feb 2020 17:53:50 +0100 (CET) Received: (qmail 21319 invoked by uid 500); 13 Feb 2020 16:53: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 21267 invoked by uid 99); 13 Feb 2020 16:53:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Feb 2020 16:53:48 +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 7AFA3C2439 for ; Thu, 13 Feb 2020 16:53:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.01 X-Spam-Level: X-Spam-Status: No, score=0.01 tagged_above=-999 required=6.31 tests=[KAM_DMARC_STATUS=0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 7iuR_38HEyRu for ; Thu, 13 Feb 2020 16:53:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=50.205.35.98; helo=newmail.ccri.com; envelope-from=jhughes@ccri.com; receiver= Received: from newmail.ccri.com (50-205-35-98-static.hfc.comcastbusiness.net [50.205.35.98]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTP id 244147E133 for ; Thu, 13 Feb 2020 16:53:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by newmail.ccri.com (Postfix) with ESMTP id 3A99E99023C for ; Thu, 13 Feb 2020 11:53:37 -0500 (EST) X-Virus-Scanned: amavisd-new at ccri.com Received: from newmail.ccri.com ([127.0.0.1]) by localhost (newmail.ccri.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sIgO0MhKIYC0 for ; Thu, 13 Feb 2020 11:53:37 -0500 (EST) Received: from [192.168.2.145] (unknown [192.168.2.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by newmail.ccri.com (Postfix) with ESMTPSA id 104F2149397FE for ; Thu, 13 Feb 2020 11:53:37 -0500 (EST) To: user@hbase.apache.org From: Jim Hughes Subject: Best practices for stopping Coprocessor calls/scans in client code Message-ID: Date: Thu, 13 Feb 2020 11:53:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Hi all, I work on GeoMesa which uses HBase to store geospatial data.  One of our uses patterns to use GeoMesa+HBase client code in a web tier to respond to ad hoc user queries.  Those web requests are translated to HBase coprocessor calls or HBase Scans. For this use case, we want to manage the number of threads and time that those threads can use for any given request. Concretely, we may want a particular deployment to 'time out' requests after 60 seconds. With that in mind, I have two broad questions: 1.  Are there example open source code samples which show ways to the HBase client in this manner?  (For instance, has Apache Phoenix already solved this problem.  I kinda tried to look at that code base for ideas.) 2.  Is there an expected / documented pattern which would let me solve this problem well? In terms of the second question, I have seen that the HTableInterface has a getTable(TableName tableName, ExecutorService pool) method.  One solution is to pass in a new ThreadPool/ExecutorService per GeoMesa request.  When the GeoMesa timeout hits, we can cool shutdownNow. This solution is 'correct' in that it achieves the desired timeout behaviour.  The downside is that it is slower than our previous code which just fired off requests without a timeout capability. Thanks in advance for any links, suggestions, positive feedback, etc! Cheers, Jim