diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2012-10-09 23:44:42 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2012-10-09 23:44:42 +0000 |
commit | 5e9e820b1703c54ee7886062174977a90689b503 (patch) | |
tree | f51c14b3be21500606cd1b3395abcc82695c4a7e | |
parent | a257625c81ab5f535ddebeb98ebee3d8eeab0ec8 (diff) |
Add additional deadlock detection mode.
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java index e0cd87a..7b2b31d 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java @@ -116,6 +116,7 @@ public final class BDBRepositoryBuilder extends AbstractRepositoryBuilder { private int mCheckpointThresholdMinutes = 1; private boolean mKeepOldLogFiles; private boolean mRunDeadlockDetector = true; + private boolean mLockConflictDeadlockDetect = false; private Boolean mChecksumEnabled; private Object mInitialEnvConfig = null; private Object mInitialDBConfig = null; @@ -191,6 +192,7 @@ public final class BDBRepositoryBuilder extends AbstractRepositoryBuilder { final boolean readOnly = mReadOnly; final boolean runCheckpointer = mRunCheckpointer; final boolean runDeadlockDetector = mRunDeadlockDetector; + final boolean lockConflictDeadlockDetect = mLockConflictDeadlockDetect; final boolean isPrivate = mPrivate; if (mName == null) { @@ -205,6 +207,7 @@ public final class BDBRepositoryBuilder extends AbstractRepositoryBuilder { mReadOnly = true; mRunCheckpointer = false; mRunDeadlockDetector = false; + mLockConflictDeadlockDetect = false; try { assertReady(); @@ -241,6 +244,7 @@ public final class BDBRepositoryBuilder extends AbstractRepositoryBuilder { mReadOnly = readOnly; mRunCheckpointer = runCheckpointer; mRunDeadlockDetector = runDeadlockDetector; + mLockConflictDeadlockDetect = lockConflictDeadlockDetect; } } @@ -921,6 +925,21 @@ public final class BDBRepositoryBuilder extends AbstractRepositoryBuilder { } /** + * Enable deadlock detection whenever a lock conflict occurs. Default is + * off, and it has no effect for BDB-JE. + */ + public void setLockConflictDeadlockDetectMode(boolean b) { + mLockConflictDeadlockDetect = b; + } + + /** + * Returns true if deadlock detection is run whenever a lock conflict occurs. + */ + public boolean getLockConflictDeadlockDetectMode() { + return mLockConflictDeadlockDetect; + } + + /** * When true, enable checksum verification of pages read into the cache * from the backing filestore. By default checksum is enabled for BDB-JE, * and disabled for BDB-C. |