Berkeley DB version 4.5.20

## com.sleepycat.db
Class CompactConfig

    java.lang.Object
      com.sleepycat.db.CompactConfig

All Implemented Interfaces:
  Cloneable

    public class CompactConfig

extends Object
implements Cloneable

Configuration for `Database.compact(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.CompactConfig)` operations.

Field Summary
`static CompactConfig` `DEFAULT` Default configuration used if null is passed to methods that create a cursor.

Constructor Summary
`CompactConfig()` Construct a default configuration object for compact operations.

Method Summary
`int` `getFillPercent()` Return the the desired fill percentage.
`boolean` `getFreeListOnly()` Return true if the whether to skip page compaction.
`boolean` `getFreeSpace()` Return true if the whether to return pages to the filesystem.
`int` `getMaxPages()` For internal use only.
`int` `getTimeout()` Return the the lock timeout set for implicit transactions, in microseconds.
`void` `setFillPercent(int fillpercent)` Set the desired fill percentage.
`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.
`void` `setFreeSpace(boolean freeSpace)` Return pages to the filesystem if possible.
`void` `setMaxPages(int maxPages)` For internal use only.
`void` `setTimeout(int timeout)` Set the lock timeout for implicit transactions.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT

    public static final CompactConfig DEFAULT

  Default configuration used if null is passed to methods that create a cursor.

Constructor Detail

### CompactConfig

    public CompactConfig()

  Construct a default configuration object for compact operations.

Method Detail

### 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.

  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)

  For internal use only.

### getMaxPages

    public int getMaxPages()

  For internal use only.

### setTimeout

    public void setTimeout(int timeout)

  Set the lock timeout for implicit transactions. If non-zero, and no transaction parameter was specified to `Database.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.

Berkeley DB version 4.5.20

Copyright(c) 1996-2006 Oracle Corporation - All rights reserved.