org.compass.core.lucene.engine.indexdeletionpolicy
Class ExpirationTimeDeletionPolicy
java.lang.Object
org.compass.core.lucene.engine.indexdeletionpolicy.ExpirationTimeDeletionPolicy
- All Implemented Interfaces:
- IndexDeletionPolicy, CompassConfigurable, DirectoryConfigurable
public class ExpirationTimeDeletionPolicy
- extends Object
- implements IndexDeletionPolicy, DirectoryConfigurable, CompassConfigurable
An index deletion policy that keeps all commits that have not expired. Expiration time (in seconds)
can be set using LuceneEnvironment.IndexDeletionPolicy.ExpirationTime
settings.
- Author:
- kimchy
- See Also:
IndexDeletionPolicyFactory
ExpirationTimeDeletionPolicy
public ExpirationTimeDeletionPolicy()
setDirectory
public void setDirectory(Directory directory)
- Description copied from interface:
DirectoryConfigurable
IndexDeletionPolicy that implement this interface will be
injected with a Directory implementation to be used.
The directory will be injected just after construction and before any of
IndexDeletionPolicy methods will be called.
- Specified by:
setDirectory in interface DirectoryConfigurable
configure
public void configure(CompassSettings settings)
throws CompassException
- Configures the expiration time of the deletion policy. Can be controlled using
LuceneEnvironment.IndexDeletionPolicy.ExpirationTime#EXPIRATION_TIME_IN_SECONDS.
Defaults to the cache invalidation time * 3.
- Specified by:
configure in interface CompassConfigurable
- Parameters:
settings - The settings for the configured object
- Throws:
CompassException
onInit
public void onInit(List commits)
throws IOException
- Specified by:
onInit in interface IndexDeletionPolicy
- Throws:
IOException
onCommit
public void onCommit(List commits)
throws IOException
- Specified by:
onCommit in interface IndexDeletionPolicy
- Throws:
IOException
toString
public String toString()
- Overrides:
toString in class Object
Copyright (c) 2004-2008 The Compass Project.