Package org.apache.nutch.crawl
Class Injector.InjectReducer
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<Text,CrawlDatum,Text,CrawlDatum>
org.apache.nutch.crawl.Injector.InjectReducer
- Enclosing class:
- Injector
Combine multiple new entries for a url.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
Reducer.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreduce(Text key, Iterable<CrawlDatum> values, Reducer<Text, CrawlDatum, Text, CrawlDatum>.Context context) Merge the input records of one URL as per rules below :voidsetup(Reducer<Text, CrawlDatum, Text, CrawlDatum>.Context context)
-
Constructor Details
-
InjectReducer
public InjectReducer()
-
-
Method Details
-
setup
- Overrides:
setupin classReducer<Text,CrawlDatum, Text, CrawlDatum>
-
reduce
public void reduce(Text key, Iterable<CrawlDatum> values, Reducer<Text, CrawlDatum, throws IOException, InterruptedExceptionText, CrawlDatum>.Context context) Merge the input records of one URL as per rules below :1. If there is ONLY new injected record ==> emit injected record 2. If there is ONLY old record ==> emit existing record 3. If BOTH new and old records are present: (a) If 'overwrite' is true ==> emit injected record (b) If 'overwrite' is false : (i) If 'update' is false ==> emit existing record (ii) If 'update' is true ==> update existing record and emit itFor more details @see NUTCH-1405- Overrides:
reducein classReducer<Text,CrawlDatum, Text, CrawlDatum> - Throws:
IOExceptionInterruptedException
-