@Test public void testGetValueWhenVolumeParameterIsNullAndNotGlobalThenShouldReturnOneSegment() { ConfigProperty configProperty = new ConfigProperty("namenode", "testDirectory", "testPrefix"); String actual = underTest.getValue(true, null, configProperty, "namenode"); Assert.assertEquals("testPrefix/hadoopfs/fs1/namenode/testDirectory", actual); }
public String getValue(boolean global, Integer volumeCount, ConfigProperty property, String serviceName) { String directory = serviceName.toLowerCase() + (property.getDirectory().isEmpty() ? "" : '/' + property.getDirectory()); String value = null; if (volumeCount == null && global) { value = property.getPrefix() + VolumeUtils.getLogVolume(directory); } else if (volumeCount != null && volumeCount > 0) { value = global ? property.getPrefix() + VolumeUtils.getLogVolume(directory) : VolumeUtils.buildVolumePathString(volumeCount, directory); } return value; }
VolumeConfigProvider { public String getValue(boolean global, Integer volumeCount, ConfigProperty property, String serviceName) { String directory = serviceName.toLowerCase() + (property.getDirectory().isEmpty() ? "" : '/' + property.getDirectory()); String value = null; if (volumeCount == null && global) { value = property.getPrefix() + VolumeUtils.getLogVolume(directory); } else if (volumeCount != null && volumeCount > 0) { value = global ? property.getPrefix() + VolumeUtils.getLogVolume(directory) : VolumeUtils.buildVolumePathString(volumeCount, directory); } return value; } }
VolumeConfigProvider { public String getValue(boolean global, Integer volumeCount, ConfigProperty property, String serviceName) { String directory = serviceName.toLowerCase() + (property.getDirectory().isEmpty() ? "" : '/' + property.getDirectory()); String value = null; if (volumeCount == null && global) { value = property.getPrefix() + VolumeUtils.getLogVolume(directory); } else if (volumeCount != null && volumeCount > 0) { value = global ? property.getPrefix() + VolumeUtils.getLogVolume(directory) : VolumeUtils.buildVolumePathString(volumeCount, directory); } return value; }  }
VolumeConfigProvider { public String getValue(boolean global, Integer volumeCount, ConfigProperty property, String serviceName) { String directory = serviceName.toLowerCase() + (property.getDirectory().isEmpty() ? "" : '/' + property.getDirectory()); String value = null; if (volumeCount == null && global) { value = property.getPrefix() + VolumeUtils.getLogVolume(directory); } else if (volumeCount != null && volumeCount > 0) { value = global ? property.getPrefix() + VolumeUtils.getLogVolume(directory) : VolumeUtils.buildVolumePathString(volumeCount, directory); } return value; }  String getValue(boolean global, Integer volumeCount, ConfigProperty property, String serviceName); }
VolumeConfigProvider { public String getValue(boolean global, Integer volumeCount, ConfigProperty property, String serviceName) { String directory = serviceName.toLowerCase() + (property.getDirectory().isEmpty() ? "" : '/' + property.getDirectory()); String value = null; if (volumeCount == null && global) { value = property.getPrefix() + VolumeUtils.getLogVolume(directory); } else if (volumeCount != null && volumeCount > 0) { value = global ? property.getPrefix() + VolumeUtils.getLogVolume(directory) : VolumeUtils.buildVolumePathString(volumeCount, directory); } return value; }  String getValue(boolean global, Integer volumeCount, ConfigProperty property, String serviceName);  }