HBASE-2854 broken tests on trunk

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@965736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan Rawson 2010-07-20 06:59:38 +00:00
parent 4cfa381f4d
commit a559c1ea4c
3 changed files with 34 additions and 28 deletions

View File

@ -445,7 +445,7 @@ Release 0.21.0 - Unreleased
HBASE-2851 Remove testDynamicBloom() unit test HBASE-2851 Remove testDynamicBloom() unit test
(Nicolas Spiegelberg via Stack) (Nicolas Spiegelberg via Stack)
HBASE-2853 TestLoadIncrementalHFiles fails on TRUNK HBASE-2853 TestLoadIncrementalHFiles fails on TRUNK
HBASE-2854 broken tests on trunk
IMPROVEMENTS IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable HBASE-1760 Cleanup TODOs in HTable

View File

@ -87,29 +87,30 @@ public class TestQueryMatcher extends HBaseTestCase {
//Expected result //Expected result
List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>(); List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>();
expected.add(ScanQueryMatcher.MatchCode.SKIP); expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
expected.add(ScanQueryMatcher.MatchCode.INCLUDE); expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
expected.add(ScanQueryMatcher.MatchCode.SKIP); expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
expected.add(ScanQueryMatcher.MatchCode.INCLUDE); expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
expected.add(ScanQueryMatcher.MatchCode.INCLUDE); expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
expected.add(ScanQueryMatcher.MatchCode.DONE); expected.add(ScanQueryMatcher.MatchCode.DONE);
// 2,4,5
ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2, ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2,
get.getFamilyMap().get(fam2), ttl, rowComparator, 1); get.getFamilyMap().get(fam2), ttl, rowComparator, 1);
List<KeyValue> memstore = new ArrayList<KeyValue>(); List<KeyValue> memstore = new ArrayList<KeyValue>();
memstore.add(new KeyValue(row1, fam2, col1, data)); memstore.add(new KeyValue(row1, fam2, col1, 1, data));
memstore.add(new KeyValue(row1, fam2, col2, data)); memstore.add(new KeyValue(row1, fam2, col2, 1, data));
memstore.add(new KeyValue(row1, fam2, col3, data)); memstore.add(new KeyValue(row1, fam2, col3, 1, data));
memstore.add(new KeyValue(row1, fam2, col4, data)); memstore.add(new KeyValue(row1, fam2, col4, 1, data));
memstore.add(new KeyValue(row1, fam2, col5, data)); memstore.add(new KeyValue(row1, fam2, col5, 1, data));
memstore.add(new KeyValue(row2, fam1, col1, data)); memstore.add(new KeyValue(row2, fam1, col1, data));
List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>(); List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>();
qm.setRow(memstore.get(0).getRow());
for(KeyValue kv : memstore){ for (KeyValue kv : memstore){
qm.setRow(kv.getRow());
actual.add(qm.match(kv)); actual.add(qm.match(kv));
} }
@ -136,22 +137,23 @@ public class TestQueryMatcher extends HBaseTestCase {
expected.add(ScanQueryMatcher.MatchCode.INCLUDE); expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
expected.add(ScanQueryMatcher.MatchCode.INCLUDE); expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
expected.add(ScanQueryMatcher.MatchCode.INCLUDE); expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
expected.add(ScanQueryMatcher.MatchCode.NEXT); expected.add(ScanQueryMatcher.MatchCode.DONE);
ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2, null, ttl, rowComparator, 1); ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2, null, ttl, rowComparator, 1);
List<KeyValue> memstore = new ArrayList<KeyValue>(); List<KeyValue> memstore = new ArrayList<KeyValue>();
memstore.add(new KeyValue(row1, fam2, col1, data)); memstore.add(new KeyValue(row1, fam2, col1, 1, data));
memstore.add(new KeyValue(row1, fam2, col2, data)); memstore.add(new KeyValue(row1, fam2, col2, 1, data));
memstore.add(new KeyValue(row1, fam2, col3, data)); memstore.add(new KeyValue(row1, fam2, col3, 1, data));
memstore.add(new KeyValue(row1, fam2, col4, data)); memstore.add(new KeyValue(row1, fam2, col4, 1, data));
memstore.add(new KeyValue(row1, fam2, col5, data)); memstore.add(new KeyValue(row1, fam2, col5, 1, data));
memstore.add(new KeyValue(row2, fam1, col1, data)); memstore.add(new KeyValue(row2, fam1, col1, 1, data));
List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>(); List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>();
qm.setRow(memstore.get(0).getRow());
for(KeyValue kv : memstore) { for(KeyValue kv : memstore) {
qm.setRow(kv.getRow());
actual.add(qm.match(kv)); actual.add(qm.match(kv));
} }
@ -179,12 +181,12 @@ public class TestQueryMatcher extends HBaseTestCase {
long testTTL = 1000; long testTTL = 1000;
MatchCode [] expected = new MatchCode[] { MatchCode [] expected = new MatchCode[] {
ScanQueryMatcher.MatchCode.SKIP, ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
ScanQueryMatcher.MatchCode.INCLUDE, ScanQueryMatcher.MatchCode.INCLUDE,
ScanQueryMatcher.MatchCode.SKIP, ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
ScanQueryMatcher.MatchCode.INCLUDE, ScanQueryMatcher.MatchCode.INCLUDE,
ScanQueryMatcher.MatchCode.SKIP, ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
ScanQueryMatcher.MatchCode.NEXT ScanQueryMatcher.MatchCode.DONE
}; };
ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2, ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2,
@ -200,9 +202,10 @@ public class TestQueryMatcher extends HBaseTestCase {
new KeyValue(row2, fam1, col1, now-10, data) new KeyValue(row2, fam1, col1, now-10, data)
}; };
qm.setRow(kvs[0].getRow());
List<MatchCode> actual = new ArrayList<MatchCode>(kvs.length); List<MatchCode> actual = new ArrayList<MatchCode>(kvs.length);
for (KeyValue kv : kvs) { for (KeyValue kv : kvs) {
qm.setRow(kv.getRow());
actual.add( qm.match(kv) ); actual.add( qm.match(kv) );
} }
@ -232,10 +235,10 @@ public class TestQueryMatcher extends HBaseTestCase {
MatchCode [] expected = new MatchCode[] { MatchCode [] expected = new MatchCode[] {
ScanQueryMatcher.MatchCode.INCLUDE, ScanQueryMatcher.MatchCode.INCLUDE,
ScanQueryMatcher.MatchCode.INCLUDE, ScanQueryMatcher.MatchCode.INCLUDE,
ScanQueryMatcher.MatchCode.SKIP, ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
ScanQueryMatcher.MatchCode.INCLUDE, ScanQueryMatcher.MatchCode.INCLUDE,
ScanQueryMatcher.MatchCode.SKIP, ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
ScanQueryMatcher.MatchCode.NEXT ScanQueryMatcher.MatchCode.DONE
}; };
ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2, ScanQueryMatcher qm = new ScanQueryMatcher(scan, fam2,
@ -250,10 +253,10 @@ public class TestQueryMatcher extends HBaseTestCase {
new KeyValue(row1, fam2, col5, now-10000, data), new KeyValue(row1, fam2, col5, now-10000, data),
new KeyValue(row2, fam1, col1, now-10, data) new KeyValue(row2, fam1, col1, now-10, data)
}; };
qm.setRow(kvs[0].getRow());
List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>(kvs.length); List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>(kvs.length);
for (KeyValue kv : kvs) { for (KeyValue kv : kvs) {
qm.setRow(kv.getRow());
actual.add( qm.match(kv) ); actual.add( qm.match(kv) );
} }

View File

@ -286,7 +286,7 @@ public class TestStore extends TestCase {
* test the internal details of how ICV works, especially during a flush scenario. * test the internal details of how ICV works, especially during a flush scenario.
*/ */
public void testIncrementColumnValue_ICVDuringFlush() public void testIncrementColumnValue_ICVDuringFlush()
throws IOException { throws IOException, InterruptedException {
init(this.getName()); init(this.getName());
long oldValue = 1L; long oldValue = 1L;
@ -303,6 +303,9 @@ public class TestStore extends TestCase {
System.currentTimeMillis(), System.currentTimeMillis(),
Bytes.toBytes(oldValue))); Bytes.toBytes(oldValue)));
// sleep 2 ms to space out the increments.
Thread.sleep(2);
// update during the snapshot. // update during the snapshot.
long ret = this.store.updateColumnValue(row, family, qf1, newValue); long ret = this.store.updateColumnValue(row, family, qf1, newValue);