@Test public void inconsistentConf() { String hdfsSite = Paths.get(sTestDir.toPath().toString(), "hdfs-site.xml").toString(); ValidationTestUtils.writeXML(hdfsSite, ImmutableMap.of("key1", "value2")); String coreSite = Paths.get(sTestDir.toPath().toString(), "core-site.xml").toString(); ValidationTestUtils.writeXML(coreSite, ImmutableMap.of("key1", "value1")); sConf.set(PropertyKey.UNDERFS_HDFS_CONFIGURATION, hdfsSite + HdfsConfValidationTask.SEPARATOR + coreSite); HdfsConfValidationTask task = new HdfsConfValidationTask("hdfs: ValidationTaskResult result = task.validateImpl(ImmutableMap.of()); assertEquals(ValidationUtils.State.FAILED, result.getState()); assertThat(result.getResult(), containsString("key1")); assertThat(result.getResult(), containsString("value1 in core-site.xml")); assertThat(result.getResult(), containsString("value2 in hdfs-site.xml")); assertThat(result.getAdvice(), containsString("fix the inconsistency")); }
@Override public ValidationTaskResult validateImpl(Map<String, String> optionsMap) { if (!ValidationUtils.isHdfsScheme(mPath)) { mMsg.append(String.format( "UFS path %s is not HDFS. Skipping validation for HDFS properties.%n", mPath)); return new ValidationTaskResult(ValidationUtils.State.SKIPPED, getName(), mMsg.toString(), mAdvice.toString()); } ValidationTaskResult loadConfig = loadHdfsConfig(); if (loadConfig.getState() != ValidationUtils.State.OK) { return loadConfig; } return checkConflicts(); }
HdfsConfValidationTask extends AbstractValidationTask { @Override public ValidationTaskResult validateImpl(Map<String, String> optionsMap) { if (!ValidationUtils.isHdfsScheme(mPath)) { mMsg.append(String.format( "UFS path %s is not HDFS. Skipping validation for HDFS properties.%n", mPath)); return new ValidationTaskResult(ValidationUtils.State.SKIPPED, getName(), mMsg.toString(), mAdvice.toString()); } ValidationTaskResult loadConfig = loadHdfsConfig(); if (loadConfig.getState() != ValidationUtils.State.OK) { return loadConfig; } return checkConflicts(); } }
HdfsConfValidationTask extends AbstractValidationTask { @Override public ValidationTaskResult validateImpl(Map<String, String> optionsMap) { if (!ValidationUtils.isHdfsScheme(mPath)) { mMsg.append(String.format( "UFS path %s is not HDFS. Skipping validation for HDFS properties.%n", mPath)); return new ValidationTaskResult(ValidationUtils.State.SKIPPED, getName(), mMsg.toString(), mAdvice.toString()); } ValidationTaskResult loadConfig = loadHdfsConfig(); if (loadConfig.getState() != ValidationUtils.State.OK) { return loadConfig; } return checkConflicts(); } HdfsConfValidationTask(String path, AlluxioConfiguration conf); }
HdfsConfValidationTask extends AbstractValidationTask { @Override public ValidationTaskResult validateImpl(Map<String, String> optionsMap) { if (!ValidationUtils.isHdfsScheme(mPath)) { mMsg.append(String.format( "UFS path %s is not HDFS. Skipping validation for HDFS properties.%n", mPath)); return new ValidationTaskResult(ValidationUtils.State.SKIPPED, getName(), mMsg.toString(), mAdvice.toString()); } ValidationTaskResult loadConfig = loadHdfsConfig(); if (loadConfig.getState() != ValidationUtils.State.OK) { return loadConfig; } return checkConflicts(); } HdfsConfValidationTask(String path, AlluxioConfiguration conf); @Override String getName(); @Override ValidationTaskResult validateImpl(Map<String, String> optionsMap); }
HdfsConfValidationTask extends AbstractValidationTask { @Override public ValidationTaskResult validateImpl(Map<String, String> optionsMap) { if (!ValidationUtils.isHdfsScheme(mPath)) { mMsg.append(String.format( "UFS path %s is not HDFS. Skipping validation for HDFS properties.%n", mPath)); return new ValidationTaskResult(ValidationUtils.State.SKIPPED, getName(), mMsg.toString(), mAdvice.toString()); } ValidationTaskResult loadConfig = loadHdfsConfig(); if (loadConfig.getState() != ValidationUtils.State.OK) { return loadConfig; } return checkConflicts(); } HdfsConfValidationTask(String path, AlluxioConfiguration conf); @Override String getName(); @Override ValidationTaskResult validateImpl(Map<String, String> optionsMap); static final String SEPARATOR; }