Re: Can anyone show me how to construct the HFileReaderV2 object to read the HFile content.
On Fri, Mar 16, 2012 at 10:12 AM, yonghu wrote: > I noticed the problem is that somehow I lost the data from hdfs. The > code is ok. > > Regards! > Why write code? The hfile tool, http://hbase.apache.org/book.html#hfile_tool2, gives a pretty rich summary on file content (or you can ask it dump it for you). St.Ack
Re: Can anyone show me how to construct the HFileReaderV2 object to read the HFile content.
I noticed the problem is that somehow I lost the data from hdfs. The code is ok. Regards! Yong On Fri, Mar 16, 2012 at 5:59 PM, yonghu wrote: > I implemented the code like this way. My Hbase version is 0.92.0. > > Configuration conf = new Configuration(); > CacheConfig cconf = new CacheConfig(conf); > FileSystem fs = FileSystem.get(conf); > Path path = new > Path("hdfs://localhost:8020/hbase/test/97366a27a98e0f43dfcecf9b63abd630/Course/33b6235defe44f69bda69c04e87fc7a9"); > HFile.Reader reader = HFile.createReader(fs, path, cconf); > HFileScanner hscanner = reader.getScanner(false, false, false); > hscanner.seekTo(); > KeyValue kv = hscanner.getKeyValue(); > System.out.println(kv.toString() + "+" + > kv.getValue().toString()); > while(hscanner.next()){ > kv = hscanner.getKeyValue(); > System.out.println(kv.toString() + "+" + > kv.getValue().toString()); > } > > I have already flush the data from the memstore into the disk. But I > got the error information, Exception in thread "main" > java.io.IOException: Cannot open filename > /hbase/test/97366a27a98e0f43dfcecf9b63abd630/Course/33b6235defe44f69bda69c04e87fc7a9. > > I can see the results from the command line. I want to know that why > its code dose not work? > > Regards! > > Yong > > On Fri, Mar 16, 2012 at 5:50 PM, yonghu wrote: >> Thanks for your information. >> >> Regards! >> >> Yong >> >> On Fri, Mar 16, 2012 at 5:39 PM, Stack wrote: >>> On Fri, Mar 16, 2012 at 9:01 AM, yonghu wrote: Hello, Can anyone give me a example to construct the HFileReaderV2 object to read the HFile content. Thanks! >>> >>> See >>> http://hbase.apache.org/xref/org/apache/hadoop/hbase/io/hfile/HFile.html#499 >>> >>> St.Ack
Re: Can anyone show me how to construct the HFileReaderV2 object to read the HFile content.
I implemented the code like this way. My Hbase version is 0.92.0. Configuration conf = new Configuration(); CacheConfig cconf = new CacheConfig(conf); FileSystem fs = FileSystem.get(conf); Path path = new Path("hdfs://localhost:8020/hbase/test/97366a27a98e0f43dfcecf9b63abd630/Course/33b6235defe44f69bda69c04e87fc7a9"); HFile.Reader reader = HFile.createReader(fs, path, cconf); HFileScanner hscanner = reader.getScanner(false, false, false); hscanner.seekTo(); KeyValue kv = hscanner.getKeyValue(); System.out.println(kv.toString() + "+" + kv.getValue().toString()); while(hscanner.next()){ kv = hscanner.getKeyValue(); System.out.println(kv.toString() + "+" + kv.getValue().toString()); } I have already flush the data from the memstore into the disk. But I got the error information, Exception in thread "main" java.io.IOException: Cannot open filename /hbase/test/97366a27a98e0f43dfcecf9b63abd630/Course/33b6235defe44f69bda69c04e87fc7a9. I can see the results from the command line. I want to know that why its code dose not work? Regards! Yong On Fri, Mar 16, 2012 at 5:50 PM, yonghu wrote: > Thanks for your information. > > Regards! > > Yong > > On Fri, Mar 16, 2012 at 5:39 PM, Stack wrote: >> On Fri, Mar 16, 2012 at 9:01 AM, yonghu wrote: >>> Hello, >>> >>> Can anyone give me a example to construct the HFileReaderV2 object to >>> read the HFile content. >>> >>> Thanks! >>> >> >> See >> http://hbase.apache.org/xref/org/apache/hadoop/hbase/io/hfile/HFile.html#499 >> >> St.Ack
Re: Can anyone show me how to construct the HFileReaderV2 object to read the HFile content.
Thanks for your information. Regards! Yong On Fri, Mar 16, 2012 at 5:39 PM, Stack wrote: > On Fri, Mar 16, 2012 at 9:01 AM, yonghu wrote: >> Hello, >> >> Can anyone give me a example to construct the HFileReaderV2 object to >> read the HFile content. >> >> Thanks! >> > > See > http://hbase.apache.org/xref/org/apache/hadoop/hbase/io/hfile/HFile.html#499 > > St.Ack
Re: Can anyone show me how to construct the HFileReaderV2 object to read the HFile content.
On Fri, Mar 16, 2012 at 9:01 AM, yonghu wrote: > Hello, > > Can anyone give me a example to construct the HFileReaderV2 object to > read the HFile content. > > Thanks! > See http://hbase.apache.org/xref/org/apache/hadoop/hbase/io/hfile/HFile.html#499 St.Ack