From 700dffb800fea545d109919f59d168f09b37c05e Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 10 Oct 2013 14:31:02 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB
---
opends/src/server/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java | 64 --------------------------------
1 files changed, 0 insertions(+), 64 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java b/opends/src/server/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java
index acf81f5..6fb9407 100644
--- a/opends/src/server/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java
+++ b/opends/src/server/org/opends/server/replication/server/changelog/je/JEChangeNumberIndexDB.java
@@ -32,7 +32,6 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.locks.ReentrantLock;
import org.opends.messages.MessageBuilder;
import org.opends.server.admin.std.server.MonitorProviderCfg;
@@ -220,24 +219,6 @@
return getNewestRecord() == null;
}
- /**
- * Get a read cursor on the database from a provided key. The cursor MUST be
- * closed after use.
- * <p>
- * This method is only used by unit tests.
- *
- * @param startChangeNumber
- * The change number from where to start.
- * @return the new cursor.
- * @throws ChangelogException
- * if a database problem occurs.
- */
- DraftCNDBCursor getReadCursor(long startChangeNumber)
- throws ChangelogException
- {
- return db.openReadCursor(startChangeNumber);
- }
-
/** {@inheritDoc} */
@Override
public DBCursor<CNIndexRecord> getCursorFrom(long startChangeNumber)
@@ -564,49 +545,4 @@
newestChangeNumber = getChangeNumber(db.readLastRecord());
}
- private ReentrantLock lock = new ReentrantLock();
-
- /**
- * Tests if the current thread has the lock on this object.
- * @return True if the current thread has the lock.
- */
- public boolean hasLock()
- {
- return lock.getHoldCount() > 0;
- }
-
- /**
- * Takes the lock on this object (blocking until lock can be acquired).
- * @throws InterruptedException If interrupted.
- */
- public void lock() throws InterruptedException
- {
- lock.lockInterruptibly();
- }
-
- /**
- * Releases the lock on this object.
- */
- public void release()
- {
- lock.unlock();
- }
-
- /** {@inheritDoc} */
- @Override
- public CNIndexRecord getRecord(long changeNumber)
- throws ChangelogException
- {
- DraftCNDBCursor cursor = null;
- try
- {
- cursor = db.openReadCursor(changeNumber);
- return cursor.currentRecord();
- }
- finally
- {
- close(cursor);
- }
- }
-
}
--
Gitblit v1.10.0