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 A0A8A17606 for ; Tue, 3 Feb 2015 14:50:18 +0000 (UTC) Received: (qmail 16046 invoked by uid 500); 3 Feb 2015 14:50:17 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 15981 invoked by uid 500); 3 Feb 2015 14:50:17 -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 15957 invoked by uid 99); 3 Feb 2015 14:50:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 14:50:14 +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 (athena.apache.org: domain of jneidi.sleiman@gmail.com designates 209.85.212.182 as permitted sender) Received: from [209.85.212.182] (HELO mail-wi0-f182.google.com) (209.85.212.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 14:50:08 +0000 Received: by mail-wi0-f182.google.com with SMTP id n3so22202369wiv.3 for ; Tue, 03 Feb 2015 06:47:32 -0800 (PST) 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; bh=amcVB9a9H21hvrdFDf4HeXEJB4nJvxywQpIA7IWf7ig=; b=P9TqqTCdikiaNO4+xiCuC8ecl2TIgRiZM9bL9YUR6D8dnEE7M7V+cL9wXwwZM3+O7F La5SjZv2jCk+9yusPeZr+ADGpvVnnAkbT9oScmfjtkn/XbAfZABcxdSZ5fI5NSfU222d fJMzyTzfJTdI40fxLi99IKgCSUSBhveBzOmJc1zgL1opLRJ2/p/M7XYaotdsLgIogEaB kjWjMqc/G+0sLUCxMoQEYqoY6cq80MCfit7p5PCkJtME5hdy1C2HSep3QT1xbe6aqu8u c3LMDjlCUYM97k7VbIz0yq7Zb7s2CJ4kerZMkUanTInbOUhemYrexeQwXnbS6hV7k1ZP REZg== X-Received: by 10.194.187.235 with SMTP id fv11mr54946047wjc.16.1422974852307; Tue, 03 Feb 2015 06:47:32 -0800 (PST) Received: from [10.0.0.20] (host31-49-212-186.range31-49.btcentralplus.com. [31.49.212.186]) by mx.google.com with ESMTPSA id z6sm24911574wix.20.2015.02.03.06.47.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 06:47:31 -0800 (PST) From: sleimanjneidi Content-Type: multipart/alternative; boundary="Apple-Mail=_E975D1E4-607F-4122-BB47-A63C0B3C725E" Subject: managing HConnection Message-Id: Date: Tue, 3 Feb 2015 14:47:29 +0000 To: user@hbase.apache.org Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_E975D1E4-607F-4122-BB47-A63C0B3C725E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi all, I am using hbase-0.98.1-cdh5.1.4 client and I am a bit confused by the = documentation of HConnection. The document says the following: HConnection instances can be shared. Sharing is usually what you want = because rather than each HConnection instance having to do its own = discovery of regions out on the cluster, instead, all clients get to = share the one cache of locations. HConnectionManager does the sharing = for you if you go by it getting connections. Sharing makes cleanup of = HConnections awkward. . So now I have a simple question: Can I share the same HConnection = instance in my entire application? And write some magic code to know when to close or never close at all? Or I have to create an instance and close it every time I do a CRUD = operation ? Many thanks --Apple-Mail=_E975D1E4-607F-4122-BB47-A63C0B3C725E--