Factored out the database cleaner.

This commit is contained in:
akwizgran
2011-07-04 18:11:27 +01:00
parent 390b316724
commit eb752ada62
9 changed files with 242 additions and 49 deletions

View File

@@ -21,9 +21,16 @@ public interface DatabaseComponent {
static final long MAX_BYTES_BETWEEN_SPACE_CHECKS = 5L * MEGABYTES;
static final long MAX_MS_BETWEEN_SPACE_CHECKS = 60L * 1000L; // 1 min
static final long BYTES_PER_SWEEP = 5L * MEGABYTES;
static final int CLEANER_SLEEP_MS = 1000; // 1 sec
static final int MS_BETWEEN_SWEEPS = 1000; // 1 sec
static final int RETRANSMIT_THRESHOLD = 3;
/**
* Opens the database.
* @param resume True to reopen an existing database or false to create a
* new one.
*/
void open(boolean resume) throws DbException;
/** Waits for any open transactions to finish and closes the database. */
void close() throws DbException;