org.apache.nutch.util
Class NutchTool
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.nutch.util.NutchTool
- All Implemented Interfaces:
- Configurable
- Direct Known Subclasses:
- Crawler, DbUpdaterJob, FetcherJob, GeneratorJob, IndexerJob, InjectorJob, ParserJob, WebTableReader
public abstract class NutchTool
- extends Configured
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
results
protected HashMap<String,Object> results
status
protected Map<String,Object> status
currentJob
protected Job currentJob
numJobs
protected int numJobs
currentJobNum
protected int currentJobNum
NutchTool
public NutchTool()
run
public abstract Map<String,Object> run(Map<String,Object> args)
throws Exception
- Runs the tool, using a map of arguments.
May return results, or null.
- Throws:
Exception
getProgress
public float getProgress()
- Returns relative progress of the tool, a float in range [0,1].
getStatus
public Map<String,Object> getStatus()
- Returns current status of the running tool.
stopJob
public boolean stopJob()
throws Exception
- Stop the job with the possibility to resume. Subclasses should
override this, since by default it calls
killJob()
.
- Returns:
- true if succeeded, false otherwise
- Throws:
Exception
killJob
public boolean killJob()
throws Exception
- Kill the job immediately. Clients should assume that any results
that the job produced so far are in inconsistent state or missing.
- Returns:
- true if succeeded, false otherwise.
- Throws:
Exception
Copyright © 2012 The Apache Software Foundation