Package org.apache.nutch.collection
Class Subcollection
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.nutch.collection.Subcollection
- All Implemented Interfaces:
Configurable,URLFilter,Pluggable
SubCollection represents a subset of index, you can define url patterns that
will indicate that particular page (url) is part of SubCollection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.apache.nutch.net.URLFilter
X_POINT_ID -
Constructor Summary
ConstructorsConstructorDescriptionSubcollection(String id, String name, String key, Configuration conf) public ConstructorSubcollection(String id, String name, Configuration conf) public ConstructorSubcollection(Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionSimple "indexOf" currentFilter for matching patterns.Returns blacklist StringgetId()getKey()getName()Returns whitelistReturns whitelist Stringvoidinitialize(Element collection) Initialize Subcollection from dom elementprotected voidCreate a list of patterns from a chunk of text, patterns are separated with a newlinevoidsetBlackList(String list) Set contents of blacklist from StringvoidsetWhiteList(String list) Set contents of whitelist from StringvoidsetWhiteList(ArrayList<String> whiteList) Methods 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
-
TAG_COLLECTIONS
- See Also:
-
TAG_COLLECTION
- See Also:
-
TAG_WHITELIST
- See Also:
-
TAG_BLACKLIST
- See Also:
-
TAG_NAME
- See Also:
-
TAG_KEY
- See Also:
-
TAG_ID
- See Also:
-
-
Constructor Details
-
Subcollection
public Constructor- Parameters:
id- Id of SubCollectionname- Name of SubCollectionconf- A populatedConfiguration
-
Subcollection
public Constructor- Parameters:
id- Id of SubCollectionname- Name of SubCollectionkey- SubCollection keyconf- A populatedConfiguration
-
Subcollection
-
-
Method Details
-
getName
- Returns:
- Returns the name
-
getKey
- Returns:
- Returns the key
-
getId
- Returns:
- Returns the id
-
getWhiteList
Returns whitelist- Returns:
- Whitelist entries
-
getWhiteListString
Returns whitelist String- Returns:
- Whitelist String
-
getBlackListString
Returns blacklist String- Returns:
- Blacklist String
-
setWhiteList
- Parameters:
whiteList- The whiteList to set.
-
filter
Simple "indexOf" currentFilter for matching patterns.rules for evaluation are as follows: 1. if pattern matches in blacklist then url is rejected 2. if pattern matches in whitelist then url is allowed 3. url is rejected
-
initialize
Initialize Subcollection from dom element- Parameters:
collection- A DOMElementfor use in creating theSubcollection
-
parseList
Create a list of patterns from a chunk of text, patterns are separated with a newline- Parameters:
list- An initializedListto insert String patterns.text- A chunkl fo text (hopefully) containing patterns.
-
setBlackList
Set contents of blacklist from String- Parameters:
list- the blacklist contents
-
setWhiteList
Set contents of whitelist from String- Parameters:
list- the whitelist contents
-