hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning Blohm <henning.bl...@zfabrik.de>
Subject Advice on how to delete range of rows / key-only scanning
Date Tue, 02 Nov 2010 10:14:20 GMT
Hi,

  I need to delete a range of rows from an HBase table. A time-to-live
setting as proposed in 

http://www.mail-archive.com/hbase-user@hadoop.apache.org/msg09492.html

will not do as there will be no clear point in time when that clean up
will be required / adviced.

The way it is implemented now essentially looks like this:

			HTable c = _table(<table>);
			Scan s = new Scan("".getBytes(),endKey.getBytes());
			s.addColumn(<family>.getBytes());
			ResultScanner rs = c.getScanner(s);
			try {
				Result r;
				while ((r=rs.next())!=null) {
					c.delete(new Delete(r.getRow()));
				}
			} finally {
				rs.close();
			}
			c.flushCommits();

While that works, it is suboptimal as it seems to require to define a
column or column family 
to retrieve data for. Worse: It seems that a column is required that is
always present to 
really hit all relevant rows.

However, all that is required is the keys!

I found https://issues.apache.org/jira/browse/HBASE-1481 and was
wondering whether
there has been any progress on that. 

What is the best way to accomplish something like key-only scanning?

Thanks,
  Henning

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