HADOOP-12071. conftest is not documented.
Contributed by Kengo Seki.
This commit is contained in:
parent
251f528814
commit
fe649bb305
@ -84,7 +84,7 @@ private static List<NodeInfo> parseConf(InputStream in)
|
|||||||
QName property = new QName("property");
|
QName property = new QName("property");
|
||||||
|
|
||||||
List<NodeInfo> nodes = new ArrayList<NodeInfo>();
|
List<NodeInfo> nodes = new ArrayList<NodeInfo>();
|
||||||
Stack<NodeInfo> parsed = new Stack<NodeInfo>();
|
Stack<NodeInfo> parsed = new Stack<>();
|
||||||
|
|
||||||
XMLInputFactory factory = XMLInputFactory.newInstance();
|
XMLInputFactory factory = XMLInputFactory.newInstance();
|
||||||
XMLEventReader reader = factory.createXMLEventReader(in);
|
XMLEventReader reader = factory.createXMLEventReader(in);
|
||||||
@ -258,9 +258,7 @@ public static void main(String[] args) throws IOException {
|
|||||||
if (confFile.isFile()) {
|
if (confFile.isFile()) {
|
||||||
files.add(confFile);
|
files.add(confFile);
|
||||||
} else if (confFile.isDirectory()) {
|
} else if (confFile.isDirectory()) {
|
||||||
for (File file : listFiles(confFile)) {
|
files.addAll(Arrays.asList(listFiles(confFile)));
|
||||||
files.add(file);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
terminate(1, confFile.getAbsolutePath()
|
terminate(1, confFile.getAbsolutePath()
|
||||||
+ " is neither a file nor directory");
|
+ " is neither a file nor directory");
|
||||||
@ -313,9 +311,9 @@ class NodeInfo {
|
|||||||
private StartElement startElement;
|
private StartElement startElement;
|
||||||
private List<Attribute> attributes = new ArrayList<Attribute>();
|
private List<Attribute> attributes = new ArrayList<Attribute>();
|
||||||
private Map<StartElement, Characters> elements =
|
private Map<StartElement, Characters> elements =
|
||||||
new HashMap<StartElement, Characters>();
|
new HashMap<>();
|
||||||
private Map<QName, List<XMLEvent>> qNameXMLEventsMap =
|
private Map<QName, List<XMLEvent>> qNameXMLEventsMap =
|
||||||
new HashMap<QName, List<XMLEvent>>();
|
new HashMap<>();
|
||||||
|
|
||||||
public NodeInfo(StartElement startElement) {
|
public NodeInfo(StartElement startElement) {
|
||||||
this.startElement = startElement;
|
this.startElement = startElement;
|
||||||
|
@ -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.
|
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`
|
### `credential`
|
||||||
|
|
||||||
Usage: `hadoop credential <subcommand> [options]`
|
Usage: `hadoop credential <subcommand> [options]`
|
||||||
|
Loading…
Reference in New Issue
Block a user