com.sun.labs.minion.engine
Class MetaDataStoreImpl
java.lang.Object
com.sun.labs.minion.engine.MetaDataStoreImpl
- All Implemented Interfaces:
- MetaDataStore
public class MetaDataStoreImpl
- extends java.lang.Object
- implements MetaDataStore
The MetaDataStore provides a mechanism to store name/value pairs
in associate with an index. The search engine does not store any
data of its own in the MetaDataStore. This service exists to allow
applications that use the search engine to store a few values
in the index directory in a safe way for the engine. Changes are
persisted at the same time that the engine dumps in-memory data
to disk.
Field Summary |
protected java.io.File |
metaDataFile
|
protected java.util.Properties |
prop
|
Method Summary |
java.lang.String |
getProperty(java.lang.String name)
Gets the value of the named property. |
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Gets the value of the named property, or the default value
if no value exists. |
void |
purge()
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a propery in the meta data store. |
void |
store()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
metaDataFile
protected java.io.File metaDataFile
prop
protected java.util.Properties prop
MetaDataStoreImpl
public MetaDataStoreImpl(java.lang.String indexDir)
throws java.io.IOException
- Throws:
java.io.IOException
setProperty
public void setProperty(java.lang.String name,
java.lang.String value)
- Description copied from interface:
MetaDataStore
- Sets a propery in the meta data store. Changes are made
consistent when the
SearchEngine.flush()
method is
called.
- Specified by:
setProperty
in interface MetaDataStore
- Parameters:
name
- the name of the property to setvalue
- the value of the named property
getProperty
public java.lang.String getProperty(java.lang.String name)
- Description copied from interface:
MetaDataStore
- Gets the value of the named property.
- Specified by:
getProperty
in interface MetaDataStore
- Parameters:
name
- the property to retrieve
- Returns:
- the property value
getProperty
public java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
- Description copied from interface:
MetaDataStore
- Gets the value of the named property, or the default value
if no value exists.
- Specified by:
getProperty
in interface MetaDataStore
- Parameters:
name
- the property to retrievedefaultValue
- the default value to return if the
property is not found
- Returns:
- the stored value or the default value
purge
public void purge()
throws java.io.IOException
- Throws:
java.io.IOException
store
public void store()
throws java.io.IOException
- Throws:
java.io.IOException