Enum Class MaintenanceType

java.lang.Object
java.lang.Enum<MaintenanceType>
com.couchbase.lite.MaintenanceType
All Implemented Interfaces:
Serializable, Comparable<MaintenanceType>, java.lang.constant.Constable

public enum MaintenanceType extends Enum<MaintenanceType>
  • Enum Constant Details

    • REINDEX

      @Volatile public static final MaintenanceType REINDEX
      Use only in collaboration with Couchbase Support. (Runs SQLite `REINDEX`.)
    • COMPACT

      public static final MaintenanceType COMPACT
      Shrinks the database file by removing any empty pages, and deletes blobs that are no longer referenced by any documents. (Runs SQLite `PRAGMA incremental_vacuum; PRAGMA wal_checkpoint(TRUNCATE)`.)
    • INTEGRITY_CHECK

      public static final MaintenanceType INTEGRITY_CHECK
      Checks for database corruption, as might be caused by a damaged filesystem, or memory corruption. (Runs SQLite `PRAGMA integrity_check`.)
    • OPTIMIZE

      public static final MaintenanceType OPTIMIZE
      Quickly updates database statistics that may help optimize queries that have been run by this Database since it was opened. The more queries that have been run, the more effective this will be, but it tries to do its work quickly by scanning only portions of indexes. (Runs SQLite `PRAGMA analysis_limit=400; PRAGMA optimize`.)

      This operation is also performed automatically when a Database is closed.

    • FULL_OPTIMIZE

      public static final MaintenanceType FULL_OPTIMIZE
      Fully scans all indexes to gather database statistics that help optimize queries. This may take some time, depending on the size of the indexes, but it doesn't have to be redone unless the database changes drastically, or new indexes are created. (Runs SQLite `PRAGMA analysis_limit=0; ANALYZE`.)
  • Method Details

    • values

      public static MaintenanceType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MaintenanceType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null