hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tost <nca...@gmail.com>
Subject Re: How to improve the speed of HTable scan
Date Tue, 25 Jan 2011 23:49:59 GMT
Daniel already said.
There's not that many mor

you should use filter and start row parameter.

I recommend RowFilter and ColumnPaginationFilter.

================================
byte[] startRow = Bytes.toBytes("999996");
byte[] endRow = null;
//
//
// filter = rowFilter;
/*
 * String indexId,
 * final byte[] indexStartRow,
 * final byte[] indexStopRow,
         byte[][] indexColumns,
         final Filter indexFilter,
         final byte[][] baseColumns
 */
ResultScanner scanner = table.getIndexedScanner(
cols[0], // index id
*startRow*, // start row
endRow,  // end row

        new byte[][] {  // index columns.
Bytes.toBytes(family[0]+":"+cols[0])
},
filter, // filter
        new byte[][] {  //base columns.
Bytes.toBytes(family[0]+":"+cols[0]),
Bytes.toBytes(family[0]+":"+cols[1]),
Bytes.toBytes(family[0]+":"+cols[2]),
Bytes.toBytes(family[0]+":"+cols[3])
}
);

2011/1/26 Jean-Daniel Cryans <jdcryans@apache.org>

> Caching is the number of rows that will be fetched per RPC, depending
> on how big your rows are you might want to set it larger or smaller.
> Try 10 then do some experiments.
>
> There's not that many more, speed of reading is always improved with
> caching. Make sure your data can fit in the block cache and that it
> stays there.
>
> J-D
>
> On Tue, Jan 25, 2011 at 2:35 AM, 陈加俊 <cjjvictory@gmail.com> wrote:
> >  final Scan scan = new Scan();
> >  scan.setCaching(scannerCaching);
> >  scan.addColumn(family);
> >
> >  table.getScanner(scan);
> >
> > For improving  the speed of scan .
> > How to adjust the parameters ? Is there any more parameters or methods
> that
> > I don't know.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message