HBASE-27039 Some methods of MasterRegion should be annotated for testing only (#4433)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 15002fccb4
)
This commit is contained in:
parent
b5dcb7d3a1
commit
a93b7cd654
|
@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.master.region;
|
||||||
|
|
||||||
import static org.apache.hadoop.hbase.HConstants.HREGION_LOGDIR_NAME;
|
import static org.apache.hadoop.hbase.HConstants.HREGION_LOGDIR_NAME;
|
||||||
|
|
||||||
|
import com.google.errorprone.annotations.RestrictedApi;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
@ -142,6 +143,12 @@ public final class MasterRegion {
|
||||||
flusherAndCompactor.onUpdate();
|
flusherAndCompactor.onUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The design for master region is to only load all the data to memory at once when starting, so
|
||||||
|
* typically you should not use the get method to get a single row of data at runtime.
|
||||||
|
*/
|
||||||
|
@RestrictedApi(explanation = "Should only be called in tests", link = "",
|
||||||
|
allowedOnPath = ".*/src/test/.*")
|
||||||
public Result get(Get get) throws IOException {
|
public Result get(Get get) throws IOException {
|
||||||
return region.get(get);
|
return region.get(get);
|
||||||
}
|
}
|
||||||
|
@ -154,14 +161,20 @@ public final class MasterRegion {
|
||||||
return region.getScanner(scan);
|
return region.getScanner(scan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RestrictedApi(explanation = "Should only be called in tests", link = "",
|
||||||
|
allowedOnPath = ".*/src/test/.*")
|
||||||
public FlushResult flush(boolean force) throws IOException {
|
public FlushResult flush(boolean force) throws IOException {
|
||||||
return region.flush(force);
|
return region.flush(force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RestrictedApi(explanation = "Should only be called in tests", link = "",
|
||||||
|
allowedOnPath = ".*/src/test/.*")
|
||||||
public void requestRollAll() {
|
public void requestRollAll() {
|
||||||
walRoller.requestRollAll();
|
walRoller.requestRollAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RestrictedApi(explanation = "Should only be called in tests", link = "",
|
||||||
|
allowedOnPath = ".*/src/test/.*")
|
||||||
public void waitUntilWalRollFinished() throws InterruptedException {
|
public void waitUntilWalRollFinished() throws InterruptedException {
|
||||||
walRoller.waitUntilWalRollFinished();
|
walRoller.waitUntilWalRollFinished();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue