Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A0A710E88 for ; Mon, 15 Jul 2013 08:02:58 +0000 (UTC) Received: (qmail 76045 invoked by uid 500); 15 Jul 2013 08:02:56 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 75693 invoked by uid 500); 15 Jul 2013 08:02: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 75048 invoked by uid 99); 15 Jul 2013 08:02:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 08:02:51 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lars.george@gmail.com designates 209.85.220.51 as permitted sender) Received: from [209.85.220.51] (HELO mail-pa0-f51.google.com) (209.85.220.51) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 08:02:43 +0000 Received: by mail-pa0-f51.google.com with SMTP id lf11so10877648pab.38 for ; Mon, 15 Jul 2013 01:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:subject:message-id:date:to:mime-version:x-mailer; bh=NTrKCQw1/w2r12yXVL2Ufd93Y8sYVlhX0hf9b77UM6w=; b=FX+3Sm5sG1U2mODU631YE6VEMVeXFl//0RrNvcbdl5Im6/heMCCxsgpaacQp2JOkaL r0RAzctxlOxJ0Sk02ghn5/ehSXm45uogEkBHQjO9yCkLaLJkJoJRM/r5gPOPNlDidGWU mupNiN0jECusax5Ombsz6k2h83IGfDA/ZJ3SNl62l9hrNWM5B6YAYy7SuSgkw9jMhCnO oBk65Ud3iL2o4MkOL903VbpBqQM+OIa47CL9GxleKMYGEQ66LU7r4VPozQszJph02TBj u4jwRrjvBqD0iYjQ1N8WxJEp6chHBadrjKR8icCNxGaocHSY/5ul/6lRJImySOEviGf2 Gemg== X-Received: by 10.68.143.199 with SMTP id sg7mr1941385pbb.13.1373875342212; Mon, 15 Jul 2013 01:02:22 -0700 (PDT) Received: from [10.0.0.56] (p508F7B2A.dip0.t-ipconnect.de. [80.143.123.42]) by mx.google.com with ESMTPSA id jb2sm59530506pbc.8.2013.07.15.01.02.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 01:02:20 -0700 (PDT) From: Lars George Content-Type: multipart/alternative; boundary="Apple-Mail=_77A077DB-708B-4197-9D1E-8C3894455C2C" Subject: HTable thread safe for scans? Message-Id: <88552E7E-5486-4185-8FDA-0C9438C5EAB6@gmail.com> Date: Mon, 15 Jul 2013 10:02:16 +0200 To: "dev@hbase.apache.org" Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_77A077DB-708B-4197-9D1E-8C3894455C2C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, Please see = https://issues.apache.org/jira/browse/HBASE-7035#comment-13708295 for = context. We added a while ago some wording around why HTable is not = thread safe and how you should use HTablePool instead. I do get the = point about the local write buffer, and also maybe if you do Get's or = any Batch/Multi operation. But what about scans? I mean, looking at the = code, it does not seem to be interfering with HTable at all, it gets = handed in the connection reference (the ClientScanner) and since after = that it has its own ID based counterpart on the server side, it seems = that the thread which created the scan is safe to release the table = instance to the pool again. In other words, if a thread (#1) creates a scanner, then another thread = (#2) is allowed to use the table instance used by the first thread, = would thread #1 have any issues with using the already created scanner? = I'd say no, reading the code.=20 If that is the case, we should fix the JavaDoc. Lars= --Apple-Mail=_77A077DB-708B-4197-9D1E-8C3894455C2C--