Package org.apache.nutch.tools.arc
Class ArcSegmentCreator
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.nutch.tools.arc.ArcSegmentCreator
- All Implemented Interfaces:
Configurable,Tool
The ArcSegmentCreator is a replacement for fetcher that will
take arc files as input and produce a nutch segment as output.
Arc files are tars of compressed gzips which are produced by both the internet archive project and the grub distributed crawler project.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor that sets the job configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcreateSegments(Path arcFiles, Path segmentsOutDir) Creates the arc files to segments job.static StringGenerates a random name for the segments.static voidintMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Field Details
-
URL_VERSION
- See Also:
-
-
Constructor Details
-
ArcSegmentCreator
public ArcSegmentCreator() -
ArcSegmentCreator
Constructor that sets the job configuration.- Parameters:
conf- a populatedConfiguration
-
-
Method Details
-
generateSegmentName
Generates a random name for the segments.- Returns:
- The generated segment name.
-
close
public void close() -
createSegments
public void createSegments(Path arcFiles, Path segmentsOutDir) throws IOException, InterruptedException, ClassNotFoundException Creates the arc files to segments job.- Parameters:
arcFiles- The path to the directory holding the arc filessegmentsOutDir- The output directory for writing the segments- Throws:
IOException- If an IO error occurs while running the job.InterruptedException- if thisJobis interruptedClassNotFoundException- if there is an error locating a class during runtime
-
main
- Throws:
Exception
-
run
-