com.sun.labs.minion.indexer.partition
Class DiskPartitionFactory

java.lang.Object
  extended by com.sun.labs.minion.indexer.partition.DiskPartitionFactory
All Implemented Interfaces:
com.sun.labs.util.props.Component, com.sun.labs.util.props.Configurable
Direct Known Subclasses:
ClassifierPartitionFactory, ClusterPartitionFactory, InvFilePartitionFactory

public class DiskPartitionFactory
extends java.lang.Object
implements com.sun.labs.util.props.Configurable

A factory class for generating memory partitions and disk partitions during indexing and querying.


Field Summary
protected  boolean cacheVectorLengths
           
protected  DictionaryFactory documentDictFactory
          The document dictionary factory.
protected  DictionaryFactory mainDictFactory
          The main dictionary factory.
protected  int mergeBuffSize
          The size of the merge buffer.
static java.lang.String PROP_CACHE_VECTOR_LENGTHS
           
static java.lang.String PROP_DOCUMENT_DICT_FACTORY
          A property for the factory that we'll use to create the document dictionaries for partitions.
static java.lang.String PROP_MAIN_DICT_FACTORY
          A property for the factory that we'll use to create the main dictionary.
static java.lang.String PROP_MERGE_BUFF_SIZE
          A property for the size of the in-memory buffer to use when merging partitions.
static java.lang.String PROP_TERM_CACHE_SIZE
           
protected  int termCacheSize
           
 
Constructor Summary
DiskPartitionFactory()
          Creates a new instance of DiskPartitionFactory
 
Method Summary
 DiskPartition getDiskPartition(int number, PartitionManager m)
          Gets a disk partition with the given number, managed by the given manager.
 void newProperties(com.sun.labs.util.props.PropertySheet ps)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_MAIN_DICT_FACTORY

@ConfigComponent(type=DictionaryFactory.class)
public static final java.lang.String PROP_MAIN_DICT_FACTORY
A property for the factory that we'll use to create the main dictionary.

See Also:
Constant Field Values

mainDictFactory

protected DictionaryFactory mainDictFactory
The main dictionary factory.


PROP_DOCUMENT_DICT_FACTORY

@ConfigComponent(type=DictionaryFactory.class)
public static final java.lang.String PROP_DOCUMENT_DICT_FACTORY
A property for the factory that we'll use to create the document dictionaries for partitions.

See Also:
Constant Field Values

documentDictFactory

protected DictionaryFactory documentDictFactory
The document dictionary factory.


PROP_MERGE_BUFF_SIZE

@ConfigInteger(defaultValue=1048576)
public static final java.lang.String PROP_MERGE_BUFF_SIZE
A property for the size of the in-memory buffer to use when merging partitions.

See Also:
Constant Field Values

mergeBuffSize

protected int mergeBuffSize
The size of the merge buffer.


PROP_CACHE_VECTOR_LENGTHS

@ConfigBoolean(defaultValue=false)
public static final java.lang.String PROP_CACHE_VECTOR_LENGTHS
See Also:
Constant Field Values

cacheVectorLengths

protected boolean cacheVectorLengths

PROP_TERM_CACHE_SIZE

@ConfigInteger(defaultValue=0)
public static final java.lang.String PROP_TERM_CACHE_SIZE
See Also:
Constant Field Values

termCacheSize

protected int termCacheSize
Constructor Detail

DiskPartitionFactory

public DiskPartitionFactory()
Creates a new instance of DiskPartitionFactory

Method Detail

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
Throws:
com.sun.labs.util.props.PropertyException

getDiskPartition

public DiskPartition getDiskPartition(int number,
                                      PartitionManager m)
                               throws java.io.IOException
Gets a disk partition with the given number, managed by the given manager.

Parameters:
number - the partition number that we want to get
m - the manager that will be managing the partition
Returns:
the partition with the given number
Throws:
java.io.IOException - if there is any error opening the partition