org.apache.lucene.store.jdbc
Class JdbcDirectorySettings

java.lang.Object
  extended by org.apache.lucene.store.jdbc.JdbcDirectorySettings

public class JdbcDirectorySettings
extends Object

General directory level settings.

The settings also holds JdbcFileEntrySettings, that can be registered with the directory settings. Note, that when registering them, they are registered under both the complete name and the 3 charecters name suffix.

When creating the settings, it already holds sensible settings, they are: The default JdbcFileEntrySettings uses the file entry settings defaults. The "deletable", ""deleteable.new", and "deletable.new" uses the NoOpFileEntryHandler. The "segments" and "segments.new" uses the ActualDeleteFileEntryHandler, FetchOnOpenJdbcIndexInput, and RAMJdbcIndexOutput. The file suffix "fnm" uses the FetchOnOpenJdbcIndexInput, and RAMJdbcIndexOutput. The file suffix "del" and "tmp" uses the ActualDeleteFileEntryHandler.

Author:
kimchy

Field Summary
static String DEFAULT_FILE_ENTRY
          The default file entry settings name that are registered under.
static long HOUR
          A simple constant having the millisecond value of an hour.
 
Constructor Summary
JdbcDirectorySettings()
          Creates a new instance of the Jdbc directory settings with it's default values initialized.
 
Method Summary
 JdbcFileEntrySettings getDefaultFileEntrySettings()
          Returns the default file entry handler settings.
 String getDeletedColumnName()
          Returns the deleted column name (defaults to deleted_).
 long getDeleteMarkDeletedDelta()
          Returns the delta (in millis) for the delete mark deleted.
 Map getFileEntrySettings()
          Returns the file entries map.
 JdbcFileEntrySettings getFileEntrySettings(String name)
          Returns the file entries according to the name.
 JdbcFileEntrySettings getFileEntrySettingsWithoutDefault(String name)
          Same as getFileEntrySettings(String), only returns null if no match is found (instead of the default file entry handler settings).
 String getLastModifiedColumnName()
          Returns the last modified column name (defaults to lf_).
 Class getLockClass()
          Returns the lock class that will be used for locking.
 int getNameColumnLength()
          Returns the name column length.
 String getNameColumnName()
          Returns the name column name (defaults to name_).
 int getQueryTimeout()
          Query timeout applies to Jdbc queries.
 String getSizeColumnName()
          Returns the size column name (default to size_).
 int getValueColumnLengthInK()
          Returns the value column length (In K).
 String getValueColumnName()
          Returns the value column name (defaults to value_).
 void registerFileEntrySettings(String name, JdbcFileEntrySettings fileEntrySettings)
          Registers a JdbcFileEntrySettings against the given name.
 void setDeletedColumnName(String deletedColumnName)
          Sets the deleted column name.
 void setDeleteMarkDeletedDelta(long deleteMarkDeletedDelta)
          Sets the delta (in millis) for the delete mark deleted.
 void setLastModifiedColumnName(String lastModifiedColumnName)
          Sets the last modified column name.
 void setLockClass(Class lockClass)
          Sets the lock class that will be used for locking.
 void setNameColumnLength(int nameColumnLength)
          Sets the name column length.
 void setNameColumnName(String nameColumnName)
          Sets the name column name.
 void setQueryTimeout(int queryTimeout)
          Query timeout applies to Jdbc queries.
 void setSizeColumnName(String sizeColumnName)
          Sets the size column name.
 void setValueColumnLengthInK(int valueColumnLengthInK)
          Sets the value coumn length (In K).
 void setValueColumnName(String valueColumnName)
          Sets the value column name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILE_ENTRY

public static String DEFAULT_FILE_ENTRY
The default file entry settings name that are registered under.


HOUR

public static final long HOUR
A simple constant having the millisecond value of an hour.

See Also:
Constant Field Values
Constructor Detail

JdbcDirectorySettings

public JdbcDirectorySettings()
Creates a new instance of the Jdbc directory settings with it's default values initialized.

Method Detail

getNameColumnLength

public int getNameColumnLength()
Returns the name column length.


setNameColumnLength

public void setNameColumnLength(int nameColumnLength)
Sets the name column length.


getValueColumnLengthInK

public int getValueColumnLengthInK()
Returns the value column length (In K).


setValueColumnLengthInK

public void setValueColumnLengthInK(int valueColumnLengthInK)
Sets the value coumn length (In K).


getNameColumnName

public String getNameColumnName()
Returns the name column name (defaults to name_).


setNameColumnName

public void setNameColumnName(String nameColumnName)
Sets the name column name.


getValueColumnName

public String getValueColumnName()
Returns the value column name (defaults to value_).


setValueColumnName

public void setValueColumnName(String valueColumnName)
Sets the value column name.


getSizeColumnName

public String getSizeColumnName()
Returns the size column name (default to size_).


setSizeColumnName

public void setSizeColumnName(String sizeColumnName)
Sets the size column name.


getLastModifiedColumnName

public String getLastModifiedColumnName()
Returns the last modified column name (defaults to lf_).


setLastModifiedColumnName

public void setLastModifiedColumnName(String lastModifiedColumnName)
Sets the last modified column name.


getDeletedColumnName

public String getDeletedColumnName()
Returns the deleted column name (defaults to deleted_).


setDeletedColumnName

public void setDeletedColumnName(String deletedColumnName)
Sets the deleted column name.


registerFileEntrySettings

public void registerFileEntrySettings(String name,
                                      JdbcFileEntrySettings fileEntrySettings)
Registers a JdbcFileEntrySettings against the given name. The name can be the full name of the file, or it's 3 charecters suffix.


getFileEntrySettings

public Map getFileEntrySettings()
Returns the file entries map. Please don't change it during runtime.


getFileEntrySettings

public JdbcFileEntrySettings getFileEntrySettings(String name)
Returns the file entries according to the name. If a direct match is found, it's registered JdbcFileEntrySettings is returned. If one is registered against the last 3 charecters, then it is returned. If none is found, the default file entry handler is returned.


getFileEntrySettingsWithoutDefault

public JdbcFileEntrySettings getFileEntrySettingsWithoutDefault(String name)
Same as getFileEntrySettings(String), only returns null if no match is found (instead of the default file entry handler settings).


getDefaultFileEntrySettings

public JdbcFileEntrySettings getDefaultFileEntrySettings()
Returns the default file entry handler settings.


getDeleteMarkDeletedDelta

public long getDeleteMarkDeletedDelta()
Returns the delta (in millis) for the delete mark deleted. File entries marked as being deleted will be deleted from the system (using JdbcDirectory.deleteMarkDeleted() if: current_time - deletelMarkDeletedDelta < Time File Entry Marked as Deleted.


setDeleteMarkDeletedDelta

public void setDeleteMarkDeletedDelta(long deleteMarkDeletedDelta)
Sets the delta (in millis) for the delete mark deleted. File entries marked as being deleted will be deleted from the system (using JdbcDirectory.deleteMarkDeleted() if: current_time - deletelMarkDeletedDelta < Time File Entry Marked as Deleted.


getQueryTimeout

public int getQueryTimeout()
Query timeout applies to Jdbc queries.


setQueryTimeout

public void setQueryTimeout(int queryTimeout)
Query timeout applies to Jdbc queries.


getLockClass

public Class getLockClass()
Returns the lock class that will be used for locking. Defaults to PhantomReadLock.


setLockClass

public void setLockClass(Class lockClass)
Sets the lock class that will be used for locking. Defaults to PhantomReadLock.



Copyright (c) 2004-2009 The Compass Project.