From 5e9e820b1703c54ee7886062174977a90689b503 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 9 Oct 2012 23:44:42 +0000 Subject: Add additional deadlock detection mode. --- .../repo/sleepycat/BDBRepositoryBuilder.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/main/java/com') 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; } } @@ -920,6 +924,21 @@ public final class BDBRepositoryBuilder extends AbstractRepositoryBuilder { return mRunDeadlockDetector; } + /** + * 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, -- cgit v1.2.3