org.compass.core.lucene.engine.indexdeletionpolicy
Class ExpirationTimeDeletionPolicy

java.lang.Object
  extended by 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

Constructor Summary
ExpirationTimeDeletionPolicy()
           
 
Method Summary
 void configure(CompassSettings settings)
          Configures the expiration time of the deletion policy.
 void onCommit(List commits)
           
 void onInit(List commits)
           
 void setDirectory(Directory directory)
          IndexDeletionPolicy that implement this interface will be injected with a Directory implementation to be used.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpirationTimeDeletionPolicy

public ExpirationTimeDeletionPolicy()
Method Detail

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-2009 The Compass Project.