From 97c2fb52d5c90b82970d1c43d9adbc5aca241d74 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 08 Dec 2011 11:29:01 +0000
Subject: [PATCH] Fix for OPENDJ-372: Enhance rebuild-index and verify-index tools to use JE 5.x disk ordered cursoring The performances gain will vary depending on the DB size and state, but I got consistent faster index rebuilding with 1M entry DB with the new cursoring API. Changes also include some tidy up around use of the database container, using getters rather than public fields directly.

---
 opendj-sdk/opends/src/server/org/opends/server/backends/jeb/DatabaseContainer.java |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/DatabaseContainer.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/DatabaseContainer.java
index 106f97a..9bdc03f 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/DatabaseContainer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/DatabaseContainer.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
+ *      Portions Copyright 2011 ForgeRock AS
  */
 package org.opends.server.backends.jeb;
 
@@ -250,7 +251,8 @@
   }
 
   /**
-   * Open a JE cursor on the DN database.
+   * Open a JE cursor on the JE database.  This is a simple wrapper around
+   * the JE Database.openCursor method.
    * @param txn A JE database transaction to be used by the cursor,
    * or null if none.
    * @param cursorConfig The JE cursor configuration.
@@ -265,6 +267,21 @@
   }
 
   /**
+   * Open a JE disk ordered cursor on the JE database.  This is a
+   * simple wrapper around the JE Database.openCursor method.
+   * @param cursorConfig The JE disk ordered cursor configuration.
+   * @return A JE disk ordered cursor.
+   * @throws DatabaseException If an error occurs while attempting to open
+   * the cursor.
+   */
+  public DiskOrderedCursor openCursor(DiskOrderedCursorConfig cursorConfig)
+      throws DatabaseException
+  {
+    return database.openCursor(cursorConfig);
+
+  }
+
+  /**
    * Get the count of key/data pairs in the database in a JE database.
    * This is a simple wrapper around the JE Database.count method.
    * @return The count of key/data pairs in the database.

--
Gitblit v1.10.0