HBASE-3476 HFile -m option need not scan key values (Prakash Khemani via Lars George)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1064034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lars George 2011-01-27 08:54:20 +00:00
parent d1d0924f61
commit df5fcf6445
2 changed files with 39 additions and 35 deletions

View File

@ -28,6 +28,8 @@ Release 0.91.0 - Unreleased
HBASE-3387 Pair does not deep check arrays for equality -- REVERT THIS PATCH HBASE-3387 Pair does not deep check arrays for equality -- REVERT THIS PATCH
HBASE-3449 Server shutdown handlers deadlocked waiting for META HBASE-3449 Server shutdown handlers deadlocked waiting for META
HBASE-3456 Fix hardcoding of 20 second socket timeout down in HBaseClient HBASE-3456 Fix hardcoding of 20 second socket timeout down in HBaseClient
HBASE-3476 HFile -m option need not scan key values
(Prakash Khemani via Lars George)
IMPROVEMENTS IMPROVEMENTS

View File

@ -1951,11 +1951,12 @@ public class HFile {
// create reader and load file info // create reader and load file info
HFile.Reader reader = new HFile.Reader(fs, file, null, false, false); HFile.Reader reader = new HFile.Reader(fs, file, null, false, false);
Map<byte[],byte[]> fileInfo = reader.loadFileInfo(); Map<byte[],byte[]> fileInfo = reader.loadFileInfo();
int count = 0;
if (verbose || printKeyValue || checkRow || checkFamily) {
// scan over file and read key/value's and check if requested // scan over file and read key/value's and check if requested
HFileScanner scanner = reader.getScanner(false, false); HFileScanner scanner = reader.getScanner(false, false);
scanner.seekTo(); scanner.seekTo();
KeyValue pkv = null; KeyValue pkv = null;
int count = 0;
do { do {
KeyValue kv = scanner.getKeyValue(); KeyValue kv = scanner.getKeyValue();
// dump key value // dump key value
@ -1990,6 +1991,7 @@ public class HFile {
pkv = kv; pkv = kv;
count++; count++;
} while (scanner.next()); } while (scanner.next());
}
if (verbose || printKeyValue) { if (verbose || printKeyValue) {
System.out.println("Scanned kv count -> " + count); System.out.println("Scanned kv count -> " + count);
} }