public class LinkDbMerger extends Configured implements Tool, Reducer<Text,Inlinks,Text,Inlinks>
It's possible to use this tool just for filtering - in that case only one LinkDb should be specified in arguments.
If more than one LinkDb contains information about the same URL, all inlinks
are accumulated, but only at most linkdb.max.inlinks inlinks will
ever be added.
If activated, URLFilters will be applied to both the target URLs and to any incoming link URL. If a target URL is prohibited, all inlinks to that target will be removed, including the target URL. If some of incoming links are prohibited, only they will be removed, and they won't count when checking the above-mentioned maximum limit.
| Constructor and Description |
|---|
LinkDbMerger() |
LinkDbMerger(Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(JobConf job) |
static JobConf |
createMergeJob(Configuration config,
Path linkDb,
boolean normalize,
boolean filter) |
static void |
main(java.lang.String[] args) |
void |
merge(Path output,
Path[] dbs,
boolean normalize,
boolean filter) |
void |
reduce(Text key,
java.util.Iterator<Inlinks> values,
OutputCollector<Text,Inlinks> output,
Reporter reporter) |
int |
run(java.lang.String[] args) |
getConf, setConfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConf, setConfpublic LinkDbMerger()
public LinkDbMerger(Configuration conf)
public void reduce(Text key, java.util.Iterator<Inlinks> values, OutputCollector<Text,Inlinks> output, Reporter reporter) throws java.io.IOException
public void configure(JobConf job)
configure in interface JobConfigurablepublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void merge(Path output, Path[] dbs, boolean normalize, boolean filter) throws java.lang.Exception
java.lang.Exceptionpublic static JobConf createMergeJob(Configuration config, Path linkDb, boolean normalize, boolean filter)
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - java.lang.ExceptionCopyright © 2017 The Apache Software Foundation