Redundancy implements StorDistributionConfig.Producer, ProtonConfig.Producer { public boolean isEffectivelyGloballyDistributed() { return totalNodes == effectiveFinalRedundancy(); } Redundancy(int initialRedundancy, int finalRedundancy, int readyCopies, int groups, int totalNodes); int finalRedundancy(); int readyCopies(); int groups(); int totalNodes(); int effectiveInitialRedundancy(); int effectiveFinalRedundancy(); int effectiveReadyCopies(); boolean isEffectivelyGloballyDistributed(); @Override void getConfig(StorDistributionConfig.Builder builder); @Override void getConfig(ProtonConfig.Builder builder);  }
@Test public void effectively_globally_distributed_is_correct() { assertFalse(createRedundancy(4, 2, 10).isEffectivelyGloballyDistributed()); assertFalse(createRedundancy(5, 1, 10).isEffectivelyGloballyDistributed()); assertFalse(createRedundancy(5, 2, 12).isEffectivelyGloballyDistributed()); assertTrue(createRedundancy(5, 2, 10).isEffectivelyGloballyDistributed()); assertTrue(createRedundancy(5, 3, 10).isEffectivelyGloballyDistributed()); assertTrue(createRedundancy(1, 1, 1).isEffectivelyGloballyDistributed()); }