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 3393010BE2 for ; Tue, 16 Jul 2013 23:20:46 +0000 (UTC) Received: (qmail 23190 invoked by uid 500); 16 Jul 2013 23:20:44 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 23146 invoked by uid 500); 16 Jul 2013 23:20:44 -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 23138 invoked by uid 99); 16 Jul 2013 23:20:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 23:20:43 +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 rohitkelkar@gmail.com designates 209.85.223.179 as permitted sender) Received: from [209.85.223.179] (HELO mail-ie0-f179.google.com) (209.85.223.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 23:20:38 +0000 Received: by mail-ie0-f179.google.com with SMTP id c10so2891057ieb.10 for ; Tue, 16 Jul 2013 16:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=1H72ffGrlpGlpez0ubo2XmjJO8Sc/4N+FU5KNVp7as8=; b=XW5AIFplEimYE4irEgooSAdrlWdGLvKYOYkXwbyneA5Hd/TuHyR+Eh0zLXY/4b7+fU piqooPusxFbuWHG6xd3a5rsOhIBo3su8doD5zcRZuXViU97rA/cstjiXINEkHWfhElPK Ast/nzrFstVrv7JABTpY9v5F+xTypASEtREAcWYhKmE8NwjCp3mxYVDJJm2M6ws2rS2y j26MjgzZdVx8O89fFr0neUEIaeNnPHncCGh+NM4IeL7B3jBSDrTKFaCfvfhoKMzoObS2 eNLtRM6Vtd63pUV8eENsVBbwHbCrrfNQ5hi/UomGQ4BwIKRfXGiU88YCDJ00lCxFDLcT 12yQ== MIME-Version: 1.0 X-Received: by 10.42.41.210 with SMTP id q18mr3466211ice.13.1374016817168; Tue, 16 Jul 2013 16:20:17 -0700 (PDT) Received: by 10.42.102.200 with HTTP; Tue, 16 Jul 2013 16:20:17 -0700 (PDT) In-Reply-To: References: <1374014417.49733.YahooMailNeo@web140605.mail.bf1.yahoo.com> Date: Tue, 16 Jul 2013 18:20:17 -0500 Message-ID: Subject: Re: Scanner problem after bulk load hfile From: Rohit Kelkar To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=20cf301d3bda4d88a204e1a93848 X-Virus-Checked: Checked by ClamAV on apache.org --20cf301d3bda4d88a204e1a93848 Content-Type: text/plain; charset=ISO-8859-1 Oh wait. Didn't realise that I had the HbaseAdmin major compact code turned on when I tested :( It is still not working. Following is the code StoreFile.Writer myHfileWriter = new StoreFile.WriterBuilder(hbaseConf, new CacheConfig(hbaseConf), hdfs, HFile.DEFAULT_BLOCKSIZE).withFilePath(myHFilePath).build(); KeyValue kv = new KeyValue(row.getBytes(), cf.getBytes(), keyStr.getBytes(), System.currentTimeMillis(), valueStr.getBytes()); myHfileWriter.close() - R On Tue, Jul 16, 2013 at 6:15 PM, Ted Yu wrote: > Looks like the following should be put in RefGuide. > > Cheers > > On Tue, Jul 16, 2013 at 3:40 PM, lars hofhansl wrote: > > > Hah. Was *just* about to reply with this. The fix in HBASE-8055 is not > > strictly necessary. > > How did you create your HFiles? See this comment: > > > https://issues.apache.org/jira/browse/HBASE-8055?focusedCommentId=13600499&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13600499 > > > > -- Lars > > ________________________________ > > From: Jimmy Xiang > > To: user > > Sent: Tuesday, July 16, 2013 2:41 PM > > Subject: Re: Scanner problem after bulk load hfile > > > > > > HBASE-8055 should have fixed it. > > > > > > On Tue, Jul 16, 2013 at 2:33 PM, Rohit Kelkar > > wrote: > > > > > This ( http://pastebin.com/yhx4apCG ) is the error on the region > server > > > side when execute the following on the shell - > > > get 'mytable', 'myrow', 'cf:q' > > > > > > - R > > > > > > > > > > > > > > > On Tue, Jul 16, 2013 at 3:28 PM, Jimmy Xiang > > wrote: > > > > > > > Do you see any exception/logging in the region server side? > > > > > > > > > > > > On Tue, Jul 16, 2013 at 1:15 PM, Rohit Kelkar > > > > > wrote: > > > > > > > > > Yes. I tried everything from myTable.flushCommits() to > > > > > myTable.clearRegionCache() before and after the > > > > > LoadIncrementalHFiles.doBulkLoad(). But it doesn't seem to work. > This > > > is > > > > > what I am doing right now to get things moving although I think > this > > > may > > > > > not be the recommended approach - > > > > > > > > > > HBaseAdmin hbaseAdmin = new HBaseAdmin(hbaseConf); > > > > > hbaseAdmin.majorCompact(myTableName.getBytes()); > > > > > myTable.close(); > > > > > hbaseAdmin.close(); > > > > > > > > > > - R > > > > > > > > > > > > > > > On Mon, Jul 15, 2013 at 9:14 AM, Amit Sela > > > wrote: > > > > > > > > > > > Well, I know it's kind of voodoo but try it once before pre-split > > and > > > > > once > > > > > > after. Worked for me. > > > > > > > > > > > > > > > > > > On Mon, Jul 15, 2013 at 7:27 AM, Rohit Kelkar < > > rohitkelkar@gmail.com > > > > > > > > > > wrote: > > > > > > > > > > > > > Thanks Amit, I am also using 0.94.2 . I am also pre-splitting > > and I > > > > > tried > > > > > > > the table.clearRegionCache() but still doesn't work. > > > > > > > > > > > > > > - R > > > > > > > > > > > > > > > > > > > > > On Sun, Jul 14, 2013 at 3:45 AM, Amit Sela < > amits@infolinks.com> > > > > > wrote: > > > > > > > > > > > > > > > If new regions are created during the bulk load (are you > > > > > pre-splitting > > > > > > > ?), > > > > > > > > maybe try myTable.clearRegionCache() after the bulk load (or > > even > > > > > after > > > > > > > the > > > > > > > > pre-splitting if you do pre-split). > > > > > > > > This should clear the region cache. I needed to use this > > because > > > I > > > > am > > > > > > > > pre-splitting my tables for bulk load. > > > > > > > > BTW I'm using HBase 0.94.2 > > > > > > > > Good luck! > > > > > > > > > > > > > > > > > > > > > > > > On Fri, Jul 12, 2013 at 6:50 PM, Rohit Kelkar < > > > > rohitkelkar@gmail.com > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > I am having problems while scanning a table created using > > > HFile. > > > > > > > > > This is what I am doing - > > > > > > > > > Once Hfile is created I use following code to bulk load > > > > > > > > > > > > > > > > > > LoadIncrementalHFiles loadTool = new > > > LoadIncrementalHFiles(conf); > > > > > > > > > HTable myTable = new HTable(conf, mytablename.getBytes()); > > > > > > > > > loadTool.doBulkLoad(new Path(outputHFileBaseDir + "/" + > > > > > mytablename), > > > > > > > > > mytableTable); > > > > > > > > > > > > > > > > > > Then scan the table using- > > > > > > > > > > > > > > > > > > HTable table = new HTable(conf, mytable); > > > > > > > > > Scan scan = new Scan(); > > > > > > > > > scan.addColumn("cf".getBytes(), "q".getBytes()); > > > > > > > > > ResultScanner scanner = table.getScanner(scan); > > > > > > > > > for (Result rr = scanner.next(); rr != null; rr = > > > > scanner.next()) { > > > > > > > > > numRowsScanned += 1; > > > > > > > > > } > > > > > > > > > > > > > > > > > > This code crashes with following error - > > > > > > http://pastebin.com/SeKAeAST > > > > > > > > > If I remove the scan.addColumn from the code then the code > > > works. > > > > > > > > > > > > > > > > > > Similarly on the hbase shell - > > > > > > > > > - A simple count 'mytable' in hbase shell gives the correct > > > > count. > > > > > > > > > - A scan 'mytable' gives correct results. > > > > > > > > > - get 'mytable', 'myrow', 'cf:q' crashes > > > > > > > > > > > > > > > > > > The hadoop dfs -ls /hbase/mytable shows the .tableinfo, > .tmp, > > > the > > > > > > > > directory > > > > > > > > > for region etc. > > > > > > > > > > > > > > > > > > Now if I do a major_compact 'mytable' and then execute my > > code > > > > with > > > > > > the > > > > > > > > > scan.addColumn statement then it works. Also the get > > 'mytable', > > > > > > > 'myrow', > > > > > > > > > 'cf:q' works. > > > > > > > > > > > > > > > > > > My question is > > > > > > > > > What is major_compact doing to enable the scanner that the > > > > > > > > > LoadIncrementalFiles tool is not? I am sure I am missing a > > step > > > > > after > > > > > > > the > > > > > > > > > LoadIncrementalFiles. > > > > > > > > > > > > > > > > > > - R > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --20cf301d3bda4d88a204e1a93848--