Package org.apache.hadoop.hbase
Class ResourceChecker
java.lang.Object
org.apache.hadoop.hbase.ResourceChecker
Utility class to check the resources: - log them before and after each test method - check them
against a minimum or maximum - check that they don't leak during the test
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static enum
(package private) static class
Class to implement for each type of resource. -
Field Summary
Modifier and TypeFieldDescriptionprivate int[]
private int[]
private static final org.slf4j.Logger
private List<ResourceChecker.ResourceAnalyzer>
private String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a resource analyzer to the resources checked.private void
check
(int[] vals) private void
void
void
end()
To be called as the end of a test method: - measure the resources - check vs.private void
fill
(ResourceChecker.Phase phase, int[] vals) private void
private void
fillInit()
private void
private void
logInit()
void
start()
To be called as the beginning of a test method: - measure the resources - check vs.
-
Field Details
-
LOG
-
tagLine
-
ras
-
initialValues
-
endingValues
-
-
Constructor Details
-
ResourceChecker
Constructor- Parameters:
tagLine
- The tagLine is added to the logs. Must not be null.
-
-
Method Details
-
fillInit
-
fillEndings
-
fill
-
checkInit
-
checkEndings
-
check
-
logInit
-
logEndings
-
start
To be called as the beginning of a test method: - measure the resources - check vs. the limits. - logs them. -
end
To be called as the end of a test method: - measure the resources - check vs. the limits. - check vs. the initial state - logs them. -
addResourceAnalyzer
Adds a resource analyzer to the resources checked.
-