HADOOP-12071. conftest is not documented.

Contributed by Kengo Seki.
This commit is contained in:
Steve Loughran 2018-05-02 13:33:56 +01:00
parent 251f528814
commit fe649bb305
2 changed files with 21 additions and 6 deletions

View File

@ -84,7 +84,7 @@ public final class ConfTest {
QName property = new QName("property");
List<NodeInfo> nodes = new ArrayList<NodeInfo>();
Stack<NodeInfo> parsed = new Stack<NodeInfo>();
Stack<NodeInfo> parsed = new Stack<>();
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLEventReader reader = factory.createXMLEventReader(in);
@ -258,9 +258,7 @@ public final class ConfTest {
if (confFile.isFile()) {
files.add(confFile);
} else if (confFile.isDirectory()) {
for (File file : listFiles(confFile)) {
files.add(file);
}
files.addAll(Arrays.asList(listFiles(confFile)));
} else {
terminate(1, confFile.getAbsolutePath()
+ " is neither a file nor directory");
@ -313,9 +311,9 @@ class NodeInfo {
private StartElement startElement;
private List<Attribute> attributes = new ArrayList<Attribute>();
private Map<StartElement, Characters> elements =
new HashMap<StartElement, Characters>();
new HashMap<>();
private Map<QName, List<XMLEvent>> qNameXMLEventsMap =
new HashMap<QName, List<XMLEvent>>();
new HashMap<>();
public NodeInfo(StartElement startElement) {
this.startElement = startElement;

View File

@ -99,6 +99,23 @@ Usage: `hadoop classpath [--glob |--jar <path> |-h |--help]`
Prints the class path needed to get the Hadoop jar and the required libraries. If called without arguments, then prints the classpath set up by the command scripts, which is likely to contain wildcards in the classpath entries. Additional options print the classpath after wildcard expansion or write the classpath into the manifest of a jar file. The latter is useful in environments where wildcards cannot be used and the expanded classpath exceeds the maximum supported command line length.
### `conftest`
Usage: `hadoop conftest [-conffile <path>]...`
| COMMAND\_OPTION | Description |
|:---- |:---- |
| `-conffile` | Path of a configuration file or directory to validate |
| `-h`, `--help` | print help |
Validates configuration XML files.
If the `-conffile` option is not specified, the files in `${HADOOP_CONF_DIR}` whose name end with .xml will be verified. If specified, that path will be verified. You can specify either a file or directory, and if a directory specified, the files in that directory whose name end with `.xml` will be verified.
You can specify `-conffile` option multiple times.
The validation is fairly minimal: the XML is parsed and duplicate and empty
property names are checked for. The command does not support XInclude; if you
using that to pull in configuration items, it will declare the XML file invalid.
### `credential`
Usage: `hadoop credential <subcommand> [options]`