public final class MahoutDriver extends Object
$MAHOUT_HOME/bin/mahout run shortJobName [over-ride ops]Works like this: by default, the file "driver.classes.props" is loaded from the classpath, which defines a mapping between short names like "vectordump" and fully qualified class names. The format of driver.classes.props is like so:
fully.qualified.class.name = shortJobName : descriptive stringThe default properties to be applied to the program run is pulled out of, by default, "
i|input = /path/to/my/input o|output = /path/to/my/output m|jarFile = /path/to/jarFile # etc - each line is shortArg|longArg = valueThe next argument to the Driver is supposed to be the short name of the class to be run (as defined in the driver.classes.props file). Then the class which will be run will have it's main called with
main(new String[] { "--input", "/path/to/my/input", "--output", "/path/to/my/output" });After all the "default" properties are loaded from the file, any further command-line arguments are taken in, and over-ride the defaults. So if your driver.classes.props looks like so:
org.apache.mahout.utils.vectors.VectorDumper = vecDump : dump vectors from a sequence fileand you have a file core/src/main/resources/vecDump.props which looks like
o|output = /tmp/vectorOut s|seqFile = /my/vector/sequenceFileAnd you execute the command-line:
$MAHOUT_HOME/bin/mahout run vecDump -s /my/otherVector/sequenceFileThen org.apache.mahout.utils.vectors.VectorDumper.main() will be called with arguments:
{"--output", "/tmp/vectorOut", "-s", "/my/otherVector/sequenceFile"}
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.