com.sun.labs.minion.classification
Class ClusterMemoryPartition

java.lang.Object
  extended by com.sun.labs.minion.indexer.partition.Partition
      extended by com.sun.labs.minion.indexer.partition.MemoryPartition
          extended by com.sun.labs.minion.classification.ClusterMemoryPartition
All Implemented Interfaces:
com.sun.labs.util.props.Component, com.sun.labs.util.props.Configurable, java.lang.Comparable<Partition>

public class ClusterMemoryPartition
extends MemoryPartition

A memory partition that will hold classifier data.


Field Summary
protected static java.lang.String logTag
          The tag for this module.
protected  int partClusters
          The number of clusters we've indexed into this partition
protected  PartitionManager partitionManager
           
static java.lang.String PROP_PART_MANAGER
           
 
Fields inherited from class com.sun.labs.minion.indexer.partition.MemoryPartition
ddo, del, deleted, docDict, dockey, mainDict, name, nWords, postBytes
 
Fields inherited from class com.sun.labs.minion.indexer.partition.Partition
DICT_OFFSETS_SIZE, docDictFactory, entryClass, entryName, indexConfig, mainDictFactory, mainDictFile, mainPostFiles, manager, maxID, nEntries, partNumber, PROP_DOC_DICT_FACTORY, PROP_INDEX_CONFIG, PROP_MAIN_DICT_FACTORY, PROP_PARTITION_MANAGER, stats
 
Constructor Summary
ClusterMemoryPartition()
          Constructs a ClusterMemoryPartition for general use.
 
Method Summary
protected  void addClusters(FeatureClusterSet clusters)
           
protected  void dumpCustom(Entry[] sorted)
          Dumps the data that is specific to the classifier partition.
protected  void finishedAddingClusters(int numFeaturesAdded)
           
 java.lang.String getName()
           
 int getNDocs()
          Gets the number of documents in this partition.
 void newProperties(com.sun.labs.util.props.PropertySheet ps)
           
 
Methods inherited from class com.sun.labs.minion.indexer.partition.MemoryPartition
dump, dump, getDocumentTerm, shutdown
 
Methods inherited from class com.sun.labs.minion.indexer.partition.Partition
compareTo, getAllFiles, getAllFiles, getDocFiles, getDocFiles, getIndexConfig, getMainFiles, getMainFiles, getManager, getNumPostingsChannels, getPartitionNumber, getQueryConfig, getStats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logTag

protected static java.lang.String logTag
The tag for this module.


partitionManager

protected PartitionManager partitionManager

partClusters

protected int partClusters
The number of clusters we've indexed into this partition


PROP_PART_MANAGER

@ConfigComponent(type=PartitionManager.class)
public static final java.lang.String PROP_PART_MANAGER
See Also:
Constant Field Values
Constructor Detail

ClusterMemoryPartition

public ClusterMemoryPartition()
Constructs a ClusterMemoryPartition for general use.

Method Detail

getNDocs

public int getNDocs()
Description copied from class: Partition
Gets the number of documents in this partition.

Specified by:
getNDocs in class Partition

addClusters

protected void addClusters(FeatureClusterSet clusters)

finishedAddingClusters

protected void finishedAddingClusters(int numFeaturesAdded)

dumpCustom

protected void dumpCustom(Entry[] sorted)
                   throws java.io.IOException
Dumps the data that is specific to the classifier partition. This will be any custom data that the classifier wants to store as well as the set of docs that contributed to training each classifier. This method is called automatically by the dump() method of MemoryPartition and doesn't need to be called directly.

Overrides:
dumpCustom in class MemoryPartition
Parameters:
sorted - a sorted listed of all main dictionary entries
Throws:
java.io.IOException - if there is any error writing data.

newProperties

public void newProperties(com.sun.labs.util.props.PropertySheet ps)
                   throws com.sun.labs.util.props.PropertyException
Specified by:
newProperties in interface com.sun.labs.util.props.Configurable
Overrides:
newProperties in class MemoryPartition
Throws:
com.sun.labs.util.props.PropertyException

getName

public java.lang.String getName()
Overrides:
getName in class Partition