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 9DB20EC72 for ; Sat, 2 Mar 2013 17:45:16 +0000 (UTC) Received: (qmail 49178 invoked by uid 500); 2 Mar 2013 17:45:13 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 49111 invoked by uid 500); 2 Mar 2013 17:45:13 -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 49097 invoked by uid 99); 2 Mar 2013 17:45:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Mar 2013 17:45:13 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anoop.hbase@gmail.com designates 209.85.128.43 as permitted sender) Received: from [209.85.128.43] (HELO mail-qe0-f43.google.com) (209.85.128.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Mar 2013 17:45:07 +0000 Received: by mail-qe0-f43.google.com with SMTP id 1so2860454qee.2 for ; Sat, 02 Mar 2013 09:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=g15BTBj4FiECqg6C7wpt7GjeDzEirBxVbGPjfQCeFcM=; b=DvjqGa/a2clgn6REqSqs7alCQ+gHGHxAnJ+OrjkqP3SFtfulBDmzNeNzVI2/aYC75K D8pKcjbMlrJpA5z5gaY5P2UHDmsZvMOrKEYNIdatcVZ90TaG+/AKEl9+YwkCxbD+EU09 Qye/KJVjFHowLSl3VgGG/P4WknISmrPstpqgWjlKhJTi3qGmp1Up3xK3sQmUz3vX9+U7 Zpa12kmYUuPfCBnW5yeqKVqdshBFFz4T2/1IR2DCvsTIuPclCicaQ+KB14dK0xBuYxhB ZibnHcnYsqvlYJC2iCaiv+GY4nIzPbi1zrlgaCr9HHU36rfFncjucQIVnnNQ8J+A2eqY b6Kw== MIME-Version: 1.0 X-Received: by 10.229.196.12 with SMTP id ee12mr5276285qcb.62.1362246286258; Sat, 02 Mar 2013 09:44:46 -0800 (PST) Received: by 10.49.49.6 with HTTP; Sat, 2 Mar 2013 09:44:46 -0800 (PST) In-Reply-To: References: Date: Sat, 2 Mar 2013 23:14:46 +0530 Message-ID: Subject: Re: Concurrently Reading Still Got Exceptions From: Anoop John To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=00504502c133fd3dc604d6f4addc X-Virus-Checked: Checked by ClamAV on apache.org --00504502c133fd3dc604d6f4addc Content-Type: text/plain; charset=ISO-8859-1 Is this really related to concurrent reads? I think some thing else.. Will dig into code tomorrow. Can you attach a junit test case which will produce NPE. -Anoop- On Sat, Mar 2, 2013 at 9:29 PM, Ted Yu wrote: > Looks like the issue might be related to HTable: > > at org.apache.hadoop.hbase.client.HTable$ClientScanner. > nextScanner(HTable.java:1167) > at org.apache.hadoop.hbase.client.HTable$ClientScanner. > next(HTable.java:1296) > at org.apache.hadoop.hbase.client.HTable$ClientScanner$1. > hasNext(HTable.java:1356) > > In newer version of HBase (0.94), you can pass executor to HTable ctor so > that you don't need to use HTablePool: > > public HTable(Configuration conf, final byte[] tableName, > finalExecutorService pool) > > Cheers > > On Wed, Feb 6, 2013 at 2:27 AM, Bing Li wrote: > > > Dear all, > > > > Some exceptions are raised when I concurrently read data from HBase. > > The version of HBase I used is 0.92.0. > > > > I cannot fix the problem. Could you please help me? > > > > Thanks so much! > > > > Best wishes, > > Bing > > > > Feb 6, 2013 12:21:31 AM > > org.apache.hadoop.hbase.ipc.HBaseClient$Connection run > > WARNING: Unexpected exception receiving call responses > > java.lang.NullPointerException > > at > > > org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:521) > > at > > > org.apache.hadoop.hbase.io.HbaseObjectWritable.readFields(HbaseObjectWritable.java:297) > > at > > > org.apache.hadoop.hbase.ipc.HBaseClient$Connection.receiveResponse(HBaseClient.java:593) > > at > > > org.apache.hadoop.hbase.ipc.HBaseClient$Connection.run(HBaseClient.java:505) > > Feb 6, 2013 12:21:31 AM > > org.apache.hadoop.hbase.client.ScannerCallable close > > WARNING: Ignore, probably already closed > > java.io.IOException: Call to greatfreeweb/127.0.1.1:60020 > > failed on local exception: java.io.IOException: Unexpected exception > > receiving call responses > > at > > > org.apache.hadoop.hbase.ipc.HBaseClient.wrapException(HBaseClient.java:934) > > at > > org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:903) > > at > > > org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:150) > > at $Proxy6.close(Unknown Source) > > at > > > org.apache.hadoop.hbase.client.ScannerCallable.close(ScannerCallable.java:112) > > at > > > org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:74) > > at > > > org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:39) > > at > > > org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getRegionServerWithRetries(HConnectionManager.java:1325) > > at > > > org.apache.hadoop.hbase.client.HTable$ClientScanner.nextScanner(HTable.java:1167) > > at > > > org.apache.hadoop.hbase.client.HTable$ClientScanner.next(HTable.java:1296) > > at > > > org.apache.hadoop.hbase.client.HTable$ClientScanner$1.hasNext(HTable.java:1356) > > at > > > com.greatfree.hbase.rank.NodeRankRetriever.loadNodeGroupNodeRankRowKeys(NodeRankRetriever.java:348) > > at > > > com.greatfree.ranking.PersistNodeGroupNodeRanksThread.run(PersistNodeGroupNodeRanksThread.java:29) > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > > at java.lang.Thread.run(Thread.java:662) Caused by: > > java.io.IOException: Unexpected exception receiving call responses > > at > > > org.apache.hadoop.hbase.ipc.HBaseClient$Connection.run(HBaseClient.java:509) > > Caused by: java.lang.NullPointerException > > at > > > org.apache.hadoop.hbase.io.HbaseObjectWritable.readObject(HbaseObjectWritable.java:521) > > at > > > org.apache.hadoop.hbase.io.HbaseObjectWritable.readFields(HbaseObjectWritable.java:297) > > at > > > org.apache.hadoop.hbase.ipc.HBaseClient$Connection.receiveResponse(HBaseClient.java:593) > > at > > > org.apache.hadoop.hbase.ipc.HBaseClient$Connection.run(HBaseClient.java:505) > > > > I read data from HBase concurrently with the following code. > > > > ... > > ExecutorService threadPool = > > Executors.newFixedThreadPool(100); > > LoadNodeGroupNodeRankRowKeyThread thread; > > Set groupKeys; > > for (String nodeKey : nodeKeys) > > { > > groupKeys = > NodeCache.WWW().getGroupKeys(nodeKey); > > for (String groupKey : groupKeys) > > { > > // Threads are initialized and executed > > here. > > thread = new > > LoadNodeGroupNodeRankRowKeyThread(nodeKey, groupKey, > > TimingScale.PERMANENTLY); > > threadPool.execute(thread); > > } > > } > > Scanner in = new Scanner(System.in); > > in.nextLine(); > > threadPool.shutdownNow(); > > ... > > > > The code of LoadNodeGroupNodeRankRowKeyThread is as follows, > > > > ... > > public void run() > > { > > NodeRankRetriever retriever = new NodeRankRetriever(); > > Set rowKeys = > > retriever.loadNodeGroupNodeRankRowKeys(this.hostNodeKey, > > this.groupKey, this.timingScale); > > if (rowKeys.size() > 0) > > { > > for (String rowKey : rowKeys) > > { > > System.out.println(rowKey); > > } > > } > > else > > { > > System.out.println("No data loaded"); > > } > > retriever.dispose(); > > } > > ... > > > > The constructor of NodeRankRetriever() just got an instance of HTable > > from HTablePool from the following method. > > > > ... > > public HTableInterface getTable(String tableName) > > { > > return this.hTablePool.getTable(tableName); > > } > > ... > > > > The method dispose() of NodeRankRetriever() just close the > > HTableInterface created by HTablePool. > > > > ... > > public void dispose() > > { > > try > > { > > this.rankTable.close(); > > } > > catch (IOException e) > > { > > e.printStackTrace(); > > } > > } > > ... > > > --00504502c133fd3dc604d6f4addc--