Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-26068 The last assertion in TestHStore.testRefreshStoreFilesNot… #3461

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ public class TestHStore {
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static final String DIR = TEST_UTIL.getDataTestDir("TestStore").toString();


/**
* Setup
* @throws IOException
*/
@Before
public void setUp() throws IOException {
qualifiers.clear();
Expand Down Expand Up @@ -244,7 +239,6 @@ private HStore init(String methodName, Configuration conf, TableDescriptorBuilde
/**
* Test we do not lose data if we fail a flush and then close.
* Part of HBase-10466
* @throws Exception
*/
@Test
public void testFlushSizeSizing() throws Exception {
Expand Down Expand Up @@ -346,7 +340,7 @@ public void testDeleteExpiredStoreFiles() throws Exception {
testDeleteExpiredStoreFiles(1);
}

/*
/**
* @param minVersions the MIN_VERSIONS for the column family
*/
public void testDeleteExpiredStoreFiles(int minVersions) throws Exception {
Expand Down Expand Up @@ -471,9 +465,9 @@ private static long getLowestTimeStampFromFS(FileSystem fs,
//////////////////////////////////////////////////////////////////////////////

private static final int BLOCKSIZE_SMALL = 8192;

/**
* Test for hbase-1686.
* @throws IOException
*/
@Test
public void testEmptyStoreFile() throws IOException {
Expand Down Expand Up @@ -511,7 +505,6 @@ public void testEmptyStoreFile() throws IOException {

/**
* Getting data from memstore only
* @throws IOException
*/
@Test
public void testGet_FromMemStoreOnly() throws IOException {
Expand Down Expand Up @@ -566,7 +559,6 @@ private void testTimeRangeIfSomeCellsAreDroppedInFlush(int maxVersion) throws IO

/**
* Getting data from files only
* @throws IOException
*/
@Test
public void testGet_FromFilesOnly() throws IOException {
Expand Down Expand Up @@ -605,7 +597,6 @@ public void testGet_FromFilesOnly() throws IOException {

/**
* Getting data from memstore and files
* @throws IOException
*/
@Test
public void testGet_FromMemStoreAndFiles() throws IOException {
Expand Down Expand Up @@ -734,7 +725,7 @@ static class FaultyFileSystem extends FilterFileSystem {

public FaultyFileSystem() {
super(new LocalFileSystem());
System.err.println("Creating faulty!");
LOG.info("Creating faulty!");
}

@Override
Expand Down Expand Up @@ -773,7 +764,7 @@ public FaultyOutputStream(FSDataOutputStream out, long faultPos, final AtomicBoo

@Override
public synchronized void write(byte[] buf, int offset, int length) throws IOException {
System.err.println("faulty stream write at pos " + getPos());
LOG.info("faulty stream write at pos " + getPos());
injectFault();
super.write(buf, offset, length);
}
Expand All @@ -794,13 +785,9 @@ private static void flushStore(HStore store, long id) throws IOException {

/**
* Generate a list of KeyValues for testing based on given parameters
* @param timestamps
* @param numRows
* @param qualifier
* @param family
* @return the rows key-value list
*/
List<Cell> getKeyValueSet(long[] timestamps, int numRows,
private List<Cell> getKeyValueSet(long[] timestamps, int numRows,
byte[] qualifier, byte[] family) {
List<Cell> kvList = new ArrayList<>();
for (int i=1;i<=numRows;i++) {
Expand Down Expand Up @@ -1027,7 +1014,7 @@ public void testRefreshStoreFilesNotChanged() throws IOException {
assertEquals(0, this.store.getStorefilesCount());

// add some data, flush
this.store.add(new KeyValue(row, family, qf1, 1, (byte[])null), null);
this.store.add(new KeyValue(row, family, qf1, 1, (byte[]) null), null);
flush(1);
// add one more file
addStoreFile();
Expand All @@ -1042,17 +1029,16 @@ public void testRefreshStoreFilesNotChanged() throws IOException {
// call second time
spiedStore.refreshStoreFiles();

//ensure that replaceStoreFiles is not called if files are not refreshed
verify(spiedStore, times(0)).replaceStoreFiles(null, null);
// ensure that replaceStoreFiles is not called, i.e, the times does not change, if files are not
// refreshed,
verify(spiedStore, times(1)).replaceStoreFiles(any(), any());
}

private long countMemStoreScanner(StoreScanner scanner) {
if (scanner.currentScanners == null) {
return 0;
}
return scanner.currentScanners.stream()
.filter(s -> !s.isFileScanner())
.count();
return scanner.currentScanners.stream().filter(s -> !s.isFileScanner()).count();
}

@Test
Expand Down Expand Up @@ -1468,8 +1454,6 @@ public void testReclaimChunkWhenScaning() throws IOException {
* may change the versionedList. And the first InMemoryFlushRunnable will use the chagned
* versionedList to remove the corresponding segments.
* In short, there will be some segements which isn't in merge are removed.
* @throws IOException
* @throws InterruptedException
*/
@Test
public void testRunDoubleMemStoreCompactors() throws IOException, InterruptedException {
Expand Down