|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.indexer.dictionary.DictionaryFactory
public class DictionaryFactory
Field Summary | |
---|---|
protected int |
cacheSize
|
protected java.lang.Class |
entryClass
|
protected int |
infoBufferSize
|
protected int |
infoOffsetsBufferSize
|
protected static java.lang.String |
logTag
|
protected int |
nameBufferSize
|
protected int |
offsetsBufferSize
|
protected int |
postingsInput
|
static java.lang.String |
PROP_CACHE_SIZE
The size of the entry cache |
static java.lang.String |
PROP_ENTRY_CLASS_NAME
|
static java.lang.String |
PROP_INFO_BUFFER_SIZE
The size of the buffer to use for entry information. |
static java.lang.String |
PROP_INFO_OFFSETS_BUFFER_SIZE
The size of the buffer to use for the offsets to the entry information. |
static java.lang.String |
PROP_NAME_BUFFER_SIZE
The size of the buffer to use for the entry names in the dictionary. |
static java.lang.String |
PROP_OFFSETS_BUFFER_SIZE
The size of the buffer to use for the offsets into the entry names. |
static java.lang.String |
PROP_POSTINGS_INPUT
The type of postings input stream to use when reading postings. |
Constructor Summary | |
---|---|
DictionaryFactory()
Creates a DictionaryFactory |
Method Summary | |
---|---|
DiskBiGramDictionary |
getBiGramDictionary(DiskDictionary mainDict,
java.io.RandomAccessFile dictFile,
java.io.RandomAccessFile postFile,
DiskPartition part)
Gets a bigram dictionary. |
DiskDictionary |
getCachedDiskDictionary(NameDecoder decoder,
java.io.RandomAccessFile dictFile,
java.io.RandomAccessFile[] postFiles,
DiskPartition part)
Gets a cached dictionary that's configured according to the configuration. |
DiskDictionary |
getDiskDictionary(java.lang.Class entryClass,
NameDecoder decoder,
java.io.RandomAccessFile dictFile,
java.io.RandomAccessFile[] postFiles,
DiskPartition part)
Gets a disk dictionary that's configured according to the configuration, except it uses a different entry type. |
DiskDictionary |
getDiskDictionary(NameDecoder decoder,
java.io.RandomAccessFile dictFile,
java.io.RandomAccessFile[] postFiles,
DiskPartition part)
Gets a disk dictionary that's configured according to the configuration. |
java.lang.Class |
getEntryClass()
|
java.lang.String |
getEntryClassName()
|
MemoryDictionary |
getMemoryDictionary(Partition p)
|
int |
getNumPostingsChannels()
|
boolean |
hasCasedEntry()
Indicates whether the entry type used for this dictionary is cased. |
void |
newProperties(com.sun.labs.util.props.PropertySheet ps)
|
void |
setEntryClass(java.lang.Class entryClass)
|
void |
setEntryClassName(java.lang.String entryClassName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String logTag
@ConfigString(defaultValue="com.sun.labs.minion.indexer.entry.IDEntry") public static final java.lang.String PROP_ENTRY_CLASS_NAME
protected java.lang.Class entryClass
@ConfigInteger(defaultValue=256) public static java.lang.String PROP_CACHE_SIZE
protected int cacheSize
@ConfigInteger(defaultValue=1024) public static java.lang.String PROP_INFO_BUFFER_SIZE
protected int infoBufferSize
@ConfigInteger(defaultValue=1024) public static java.lang.String PROP_INFO_OFFSETS_BUFFER_SIZE
protected int infoOffsetsBufferSize
@ConfigInteger(defaultValue=2048) public static java.lang.String PROP_NAME_BUFFER_SIZE
protected int nameBufferSize
@ConfigInteger(defaultValue=1024) public static java.lang.String PROP_OFFSETS_BUFFER_SIZE
protected int offsetsBufferSize
@ConfigInteger(defaultValue=3) public static java.lang.String PROP_POSTINGS_INPUT
protected int postingsInput
Constructor Detail |
---|
public DictionaryFactory()
Method Detail |
---|
public void newProperties(com.sun.labs.util.props.PropertySheet ps) throws com.sun.labs.util.props.PropertyException
newProperties
in interface com.sun.labs.util.props.Configurable
com.sun.labs.util.props.PropertyException
public java.lang.String getEntryClassName()
public void setEntryClassName(java.lang.String entryClassName)
public java.lang.Class getEntryClass()
public void setEntryClass(java.lang.Class entryClass)
public int getNumPostingsChannels()
public boolean hasCasedEntry()
true
if the entry type for this dictionary is a
subclass of CasedEntry
, false
otherwise.public DiskBiGramDictionary getBiGramDictionary(DiskDictionary mainDict, java.io.RandomAccessFile dictFile, java.io.RandomAccessFile postFile, DiskPartition part) throws java.io.IOException
java.io.IOException
public DiskDictionary getDiskDictionary(java.lang.Class entryClass, NameDecoder decoder, java.io.RandomAccessFile dictFile, java.io.RandomAccessFile[] postFiles, DiskPartition part) throws java.io.IOException
entryClass
- the class of entry that the dictionary contains, which
overrides the configured value.decoder
- A decoder for the names in this dictionary.dictFile
- The file containing the dictionary.postFiles
- The files containing the postings associated with
the entries in this dictionary.part
- The partition with which this dictionary is associated.
java.io.IOException
- if there is any error loading the dictionarypublic DiskDictionary getDiskDictionary(NameDecoder decoder, java.io.RandomAccessFile dictFile, java.io.RandomAccessFile[] postFiles, DiskPartition part) throws java.io.IOException
decoder
- A decoder for the names in this dictionary.dictFile
- The file containing the dictionary.postFiles
- The files containing the postings associated with
the entries in this dictionary.part
- The partition with which this dictionary is associated.
java.io.IOException
- if there is any error loading the dictionarypublic DiskDictionary getCachedDiskDictionary(NameDecoder decoder, java.io.RandomAccessFile dictFile, java.io.RandomAccessFile[] postFiles, DiskPartition part) throws java.io.IOException
java.io.IOException
public MemoryDictionary getMemoryDictionary(Partition p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |