HBASE-1887 Update hbase trunk to latests on hadoop 0.21 branch so we can all test sync/append
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@823750 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
620bfe40be
commit
7ffccd0e46
|
@ -105,6 +105,22 @@ public class TestHLog extends HBaseTestCase implements HConstants {
|
|||
reader.close();
|
||||
// Add test that checks to see that an open of a Reader works on a file
|
||||
// that has had a sync done on it.
|
||||
for (int i = 0; i < total; i++) {
|
||||
List<KeyValue> kvs = new ArrayList<KeyValue>();
|
||||
kvs.add(new KeyValue(Bytes.toBytes(i), bytes, bytes));
|
||||
wal.append(bytes, bytes, kvs, false, System.currentTimeMillis());
|
||||
}
|
||||
reader = HLog.getReader(this.fs, walPath, this.conf);
|
||||
count = 0;
|
||||
while(reader.next(key)) count++;
|
||||
assertTrue(count >= total);
|
||||
reader.close();
|
||||
// If I sync, should see double the edits.
|
||||
wal.sync();
|
||||
reader = HLog.getReader(this.fs, walPath, this.conf);
|
||||
count = 0;
|
||||
while(reader.next(key)) count++;
|
||||
assertEquals(total * 2, count);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue