Package org.apache.nutch.hostdb
Class UpdateHostDbReducer
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<Text,NutchWritable,Text,HostDatum>
org.apache.nutch.hostdb.UpdateHostDbReducer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
Reducer.Context -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static booleanprotected static booleanprotected static booleanprotected static booleanprotected static CrawlDatumProcessor[]protected ThreadPoolExecutorprotected static booleanprotected static longprotected static String[]protected static Text[]protected Integerprotected static int[]protected static Integerprotected BlockingQueue<Runnable>protected static Integerprotected ResolverThreadprotected Counterprotected static String[]protected static Text[]protected Counterprotected static longprotected Counter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidShut down all running threads and wait for completion.protected booleanisEligibleForCheck(HostDatum datum) Determines whether a record is eligible for recheck.voidreduce(Text key, Iterable<NutchWritable> values, Reducer<Text, NutchWritable, Text, HostDatum>.Context context) voidConfigures the thread pool and prestarts all resolver threads.protected booleanshouldCheck(HostDatum datum) Determines whether a record should be checked.
-
Field Details
-
resolverThread
-
numResolverThreads
-
purgeFailedHostsThreshold
-
recheckInterval
-
checkFailed
protected static boolean checkFailed -
checkNew
protected static boolean checkNew -
checkKnown
protected static boolean checkKnown -
checkAny
protected static boolean checkAny -
force
protected static boolean force -
urlLimit
protected static long urlLimit -
now
protected static long now -
numericFields
-
stringFields
-
percentiles
protected static int[] percentiles -
numericFieldWritables
-
stringFieldWritables
-
crawlDatumProcessors
-
queue
-
executor
-
urlLimitNotReachedCounter
-
totalHostsCounter
-
skippedNotEligibleCounter
-
-
Constructor Details
-
UpdateHostDbReducer
public UpdateHostDbReducer()
-
-
Method Details
-
setup
Configures the thread pool and prestarts all resolver threads. -
reduce
public void reduce(Text key, Iterable<NutchWritable> values, Reducer<Text, NutchWritable, throws IOException, InterruptedExceptionText, HostDatum>.Context context) - Overrides:
reducein classReducer<Text,NutchWritable, Text, HostDatum> - Throws:
IOExceptionInterruptedException
-
shouldCheck
Determines whether a record should be checked.- Parameters:
datum- aHostDatumto check for eligibility- Returns:
- true if it should be checked, false otherwise
-
isEligibleForCheck
Determines whether a record is eligible for recheck.- Parameters:
datum- aHostDatumto check for eligibility- Returns:
- true if eligible for recheck, false otherwise
-
cleanup
Shut down all running threads and wait for completion.
-