Skip to content

Commit 3a94b45

Browse files
committed
chore: fix comments
1 parent cfb76da commit 3a94b45

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,12 @@ public void testMagicCompaction3Buckets() throws IOException {
845845
memstore.clearSnapshot(snapshot.getId());
846846
}
847847

848+
@Test
849+
@Override
850+
public void testScan() throws IOException {
851+
scanMemStore(memstore, 6635);
852+
}
853+
848854
protected int addRowsByKeys(final AbstractMemStore hmc, String[] keys) {
849855
byte[] fam = Bytes.toBytes("testfamily");
850856
byte[] qf = Bytes.toBytes("testqualifier");

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,12 @@ public void testBigCellSizeAfterInMemoryCompaction() throws IOException {
920920
}
921921
}
922922

923+
@Test
924+
@Override
925+
public void testScan() throws IOException {
926+
scanMemStore(memstore, 915);
927+
}
928+
923929
private long addRowsByKeysDataSize(final AbstractMemStore hmc, String[] keys) {
924930
byte[] fam = Bytes.toBytes("testfamily");
925931
byte[] qf = Bytes.toBytes("testqualifier");

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public class TestDefaultMemStore {
9191
public TestName name = new TestName();
9292
protected AbstractMemStore memstore;
9393
protected static final int ROW_COUNT = 10;
94+
protected static final int SCAN_ROW_COUNT = 25000;
9495
protected static final int QUALIFIER_COUNT = ROW_COUNT;
9596
protected static final byte[] FAMILY = Bytes.toBytes("column");
9697
protected MultiVersionConcurrencyControl mvcc;
@@ -1135,15 +1136,19 @@ private static int doScan(MemStore ms, int iteration) throws IOException {
11351136
return cnt;
11361137
}
11371138

1138-
@Test
1139-
public void testScan() throws IOException {
1139+
protected void scanMemStore(MemStore ms, int expectedCount) throws IOException {
11401140
long n1 = System.nanoTime();
1141-
addRows(25000, memstore);
1141+
addRows(SCAN_ROW_COUNT, ms);
11421142
LOG.info("Took for insert: {}", (System.nanoTime() - n1) / 1000);
11431143

11441144
for (int i = 0; i < 50; i++) {
1145-
int cnt = doScan(memstore, i);
1146-
assertEquals(memstore.getActive().getCellsCount(), cnt);
1145+
int cnt = doScan(ms, i);
1146+
assertEquals(expectedCount, cnt);
11471147
}
11481148
}
1149+
1150+
@Test
1151+
public void testScan() throws IOException {
1152+
scanMemStore(memstore, SCAN_ROW_COUNT * QUALIFIER_COUNT);
1153+
}
11491154
}

0 commit comments

Comments
 (0)