|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.gdata.storage.lucenestorage.StorageCoreController
public class StorageCoreController
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
StorageCoreController()
Creates a new StoragCoreController |
Method Summary | |
---|---|
protected IndexModifier |
createIndexModifier()
Creates a new IndexModifier on the storage index |
void |
destroy()
will be called when the registry is going down e.g. |
void |
forceWrite()
Forces the StorageModifier to write all buffered changes. |
int |
getBufferSize()
The size of the StorageBuffer. |
protected Directory |
getDirectory()
|
int |
getIndexOptimizeInterval()
|
protected ConcurrentStorageLock |
getLock()
|
int |
getPersistFactor()
An integer value after how many changes to the StorageModifier the buffered changes will be persisted / written to the index |
Storage |
getStorage()
Creates Storage instances to access the underlaying storage component |
protected StorageModifier |
getStorageModifier()
returns the current storage modifier |
protected ReferenceCounter<StorageQuery> |
getStorageQuery()
returns a StorageQuery to query the storage index. |
void |
initialize()
will be call when the component is registered. |
boolean |
isKeepRecoveredFiles()
|
boolean |
isRecover()
|
protected void |
registerNewRecoverWriter()
|
protected void |
registerNewStorageQuery()
Forces the controller to register a new StorageQuery instance. |
String |
releaseId()
Creates a unique ID to store as an id for ServerBaseEntry instances |
protected StorageBuffer |
releaseNewStorageBuffer()
Creates a new StorageBuffer |
void |
setBufferSize(int storageBufferSize)
The size of the StorageBuffer. |
void |
setDirectory(String storageDirectory)
|
void |
setKeepRecoveredFiles(boolean keepRecoveredFiles)
|
void |
setOptimizeInterval(int indexOptimizeInterval)
|
void |
setPersistFactor(int storagePersistFactor)
|
void |
setRecover(boolean recover)
|
void |
setStorageDir(Directory storageDir)
|
protected void |
writeRecoverEntry(StorageEntryWrapper wrapper)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public StorageCoreController()
Method Detail |
---|
public void initialize()
ServerComponent
initialize
in interface ServerComponent
ServerComponent.initialize()
protected StorageModifier getStorageModifier()
protected ReferenceCounter<StorageQuery> getStorageQuery()
if the reference counter has no remaining references the resource e.g. the StorageQuery will be closed. This ensures that a StorageQuery instance will be around as long as needed and the resources will be released. The reference counter should be decremented by clients after finished using the query instance.
ReferenceCounter
instance holding the StorageQuery as a
resource.protected void registerNewStorageQuery() throws IOException
IOException
- -
if an IO exception occursprotected StorageBuffer releaseNewStorageBuffer()
protected IndexModifier createIndexModifier() throws IOException
IOException
- -
if an IO exception occurspublic void forceWrite() throws IOException
IOException
- -
if an IO exception occurspublic String releaseId()
ServerBaseEntry
instances
releaseId
in interface StorageController
StorageException
- -
if no id can be releasedpublic void destroy()
ServerComponent
GDataServerRegistry.destroy()
method is called.
destroy
in interface ServerComponent
destroy
in interface StorageController
StorageController.destroy()
protected Directory getDirectory()
public Storage getStorage() throws StorageException
StorageController
getStorage
in interface StorageController
StorageException
- -
if the storage instance can not be createdStorageController.getStorage()
protected ConcurrentStorageLock getLock()
public int getBufferSize()
public void setBufferSize(int storageBufferSize)
storageBufferSize
- public int getPersistFactor()
public void setPersistFactor(int storagePersistFactor)
storagePersistFactor
- public int getIndexOptimizeInterval()
public void setOptimizeInterval(int indexOptimizeInterval)
indexOptimizeInterval
- The indexOptimizeInterval to set.public boolean isKeepRecoveredFiles()
public void setKeepRecoveredFiles(boolean keepRecoveredFiles)
keepRecoveredFiles
- The keepRecoveredFiles to set.public boolean isRecover()
public void setRecover(boolean recover)
recover
- The recover to set.public void setStorageDir(Directory storageDir)
storageDir
- The storageDir to set.public void setDirectory(String storageDirectory)
storageDirectory
- The storageDirectory to set.protected void writeRecoverEntry(StorageEntryWrapper wrapper) throws RecoverException
RecoverException
protected void registerNewRecoverWriter() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |