org.apache.nutch.collection
Class CollectionManager

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.nutch.collection.CollectionManager
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable

public class CollectionManager
extends org.apache.hadoop.conf.Configured


Field Summary
static String DEFAULT_FILE_NAME
           
 
Constructor Summary
protected CollectionManager()
          Used for testing
  CollectionManager(org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
 Subcollection createSubCollection(String id, String name)
          Create a new subcollection.
 void deleteSubCollection(String id)
          Delete named subcollection
 Collection<Subcollection> getAll()
          Returns all collections
static CollectionManager getCollectionManager(org.apache.hadoop.conf.Configuration conf)
           
 Subcollection getSubColection(String id)
          Returns named subcollection
 List<String> getSubCollections(String url)
          Return names of collections url is part of
protected  void init()
           
protected  void parse(InputStream input)
           
 void save()
          Save collections into file
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILE_NAME

public static final String DEFAULT_FILE_NAME
See Also:
Constant Field Values
Constructor Detail

CollectionManager

public CollectionManager(org.apache.hadoop.conf.Configuration conf)

CollectionManager

protected CollectionManager()
Used for testing

Method Detail

init

protected void init()

parse

protected void parse(InputStream input)

getCollectionManager

public static CollectionManager getCollectionManager(org.apache.hadoop.conf.Configuration conf)

getSubColection

public Subcollection getSubColection(String id)
Returns named subcollection

Parameters:
id -
Returns:
Named SubCollection (or null if not existing)

deleteSubCollection

public void deleteSubCollection(String id)
                         throws IOException
Delete named subcollection

Parameters:
id - Id of SubCollection to delete
Throws:
IOException

createSubCollection

public Subcollection createSubCollection(String id,
                                         String name)
Create a new subcollection.

Parameters:
name - Name of SubCollection to create
Returns:
Created SubCollection or null if allready existed

getSubCollections

public List<String> getSubCollections(String url)
Return names of collections url is part of

Parameters:
url - The url to test against Collections
Returns:
Space delimited string of collection names url is part of

getAll

public Collection<Subcollection> getAll()
Returns all collections

Returns:
All collections CollectionManager knows about

save

public void save()
          throws IOException
Save collections into file

Throws:
Exception
IOException


Copyright © 2013 The Apache Software Foundation