HDDS-1848. Fix TestOzoneManagerHA and TestOzoneManagerSnapShotProvider. (#1148)

This commit is contained in:
Bharat Viswanadham 2019-07-23 20:23:06 -07:00 committed by GitHub
parent a1251addff
commit cf9ff08f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -234,6 +234,7 @@ public interface MiniOzoneCluster {
protected static final int DEFAULT_HB_INTERVAL_MS = 1000;
protected static final int DEFAULT_HB_PROCESSOR_INTERVAL_MS = 100;
protected static final int ACTIVE_OMS_NOT_SET = -1;
protected final OzoneConfiguration conf;
protected final String path;
@ -241,7 +242,7 @@ public interface MiniOzoneCluster {
protected String clusterId;
protected String omServiceId;
protected int numOfOMs;
protected int numOfActiveOMs;
protected int numOfActiveOMs = ACTIVE_OMS_NOT_SET;
protected Optional<Boolean> enableTrace = Optional.of(false);
protected Optional<Integer> hbInterval = Optional.empty();

View File

@ -169,6 +169,11 @@ public final class MiniOzoneHAClusterImpl extends MiniOzoneClusterImpl {
throw new IllegalArgumentException("Number of active OMs cannot be " +
"more than the total number of OMs");
}
// If num of ActiveOMs is not set, set it to numOfOMs.
if (numOfActiveOMs == ACTIVE_OMS_NOT_SET) {
numOfActiveOMs = numOfOMs;
}
DefaultMetricsSystem.setMiniClusterMode(true);
initializeConfiguration();
StorageContainerManager scm;