Package com.sleepycat.db
Class CompactConfig
java.lang.Object
com.sleepycat.db.CompactConfig
- All Implemented Interfaces:
Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CompactConfigDefault configuration used if null is passed to methods that create a cursor. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a default configuration object for compact operations. -
Method Summary
Modifier and TypeMethodDescriptionintReturn the the desired fill percentage.booleanReturn true if the whether to skip page compaction.booleanReturn true if the whether to return pages to the filesystem.intReturn the the maximum number of pages to free.intReturn the the lock timeout set for implicit transactions, in microseconds.voidsetFillPercent(int fillpercent) Set the desired fill percentage.voidsetFreeListOnly(boolean freeListOnly) Configure whether to skip page compaction, only returning pages to the filesystem that are already free and at the end of the file.voidsetFreeSpace(boolean freeSpace) Return pages to the filesystem if possible.voidsetMaxPages(int maxPages) Set the maximum number of pages to free.voidsetTimeout(int timeout) Set the lock timeout for implicit transactions.
-
Field Details
-
DEFAULT
Default configuration used if null is passed to methods that create a cursor.
-
-
Constructor Details
-
CompactConfig
public CompactConfig()Construct a default configuration object for compact operations.
-
-
Method Details
-
setFillPercent
public void setFillPercent(int fillpercent) Set the desired fill percentage. If non-zero, the goal for filling pages, specified as a percentage between 1 and 100. Any page in a Btree or Recno databases not at or above this percentage full will be considered for compaction. The default behavior is to consider every page for compaction, regardless of its page fill percentage.- Parameters:
fillpercent- The desired fill percentage.
-
getFillPercent
public int getFillPercent()Return the the desired fill percentage.This method may be called at any time during the life of the application.
- Returns:
- The the desired fill percentage.
-
setFreeListOnly
public void setFreeListOnly(boolean freeListOnly) Configure whether to skip page compaction, only returning pages to the filesystem that are already free and at the end of the file. This flag must be set if the database is a Hash access method database.- Parameters:
freeListOnly- Whether to skip page compaction
-
getFreeListOnly
public boolean getFreeListOnly()Return true if the whether to skip page compaction.This method may be called at any time during the life of the application.
- Returns:
- True if the whether to skip page compaction.
-
setFreeSpace
public void setFreeSpace(boolean freeSpace) Return pages to the filesystem if possible. If this flag is not specified, pages emptied as a result of compaction will be placed on the free list for re-use, but not returned to the filesystem. Note that only pages at the end of the file may be returned. Given the one pass nature of the algorithm if a page near the end of the file is logically near the begining of the btree it will inhibit returning pages to the file system. A second call to the method with a low fillfactor can be used to return pages in such a situation.- Parameters:
freeSpace- Whether to return pages to the filesystem
-
getFreeSpace
public boolean getFreeSpace()Return true if the whether to return pages to the filesystem.This method may be called at any time during the life of the application.
- Returns:
- True if the whether to return pages to the filesystem.
-
setMaxPages
public void setMaxPages(int maxPages) Set the maximum number of pages to free.- Parameters:
maxPages- If non-zero, the call will return after that number of pages have been freed.
-
getMaxPages
public int getMaxPages()Return the the maximum number of pages to free.This method may be called at any time during the life of the application.
- Returns:
- The the maximum number of pages to free.
-
setTimeout
public void setTimeout(int timeout) Set the lock timeout for implicit transactions. If non-zero, and no transaction parameter was specified toDatabase.compact(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.CompactConfig), the lock timeout set for implicit transactions, in microseconds.- Parameters:
timeout- the lock timeout set for implicit transactions, in microseconds.
-
getTimeout
public int getTimeout()Return the the lock timeout set for implicit transactions, in microseconds.This method may be called at any time during the life of the application.
- Returns:
- The the lock timeout set for implicit transactions, in microseconds.
-