Package org.apache.nutch.collection
Class CollectionManager
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.nutch.collection.CollectionManager
- All Implemented Interfaces:
Configurable
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUsed for testing -
Method Summary
Modifier and TypeMethodDescriptioncreateSubCollection(String id, String name) Create a new subcollection.voidDelete named subcollectiongetAll()Returns all collectionsstatic CollectionManagerGet the named subcollectiongetSubCollections(String url) Return names of collections url is part ofprotected voidinit()protected voidparse(InputStream input) voidsave()Save collections into fileMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Field Details
-
DEFAULT_FILE_NAME
- See Also:
-
-
Constructor Details
-
CollectionManager
-
CollectionManager
protected CollectionManager()Used for testing
-
-
Method Details
-
init
protected void init() -
parse
-
getCollectionManager
-
getSubColection
Get the named subcollection- Parameters:
id- the id of a subcollection ot retrieve- Returns:
- Named SubCollection (or null if not existing)
-
deleteSubCollection
Delete named subcollection- Parameters:
id- Id of SubCollection to delete- Throws:
IOException- If there is an error retrieving and deleting the subcollection from the collection.
-
createSubCollection
Create a new subcollection.- Parameters:
id- Id of SubCollection to createname- Name of SubCollection to create- Returns:
- Created SubCollection or null if allready existed
-
getSubCollections
Return names of collections url is part of- Parameters:
url- The url to test against Collections- Returns:
- A
ListofSubcollection's
-
getAll
Returns all collections- Returns:
- All collections CollectionManager knows about
-
save
Save collections into file- Throws:
IOException- If there is a fatal error flushing or closing theFileOutputStreamassociated with the save process.
-