From 919ad22e29ed2229d4af6092f5e0ddecdeac779e Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 12 Mar 2015 15:00:22 +0000
Subject: [PATCH] Get rid of too much ByteBuffer to ByteString conversions.

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java
index 2968293..5389ff8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java
@@ -134,7 +134,7 @@
     this.indexEntryLimit = indexEntryLimit;
     this.cursorEntryLimit = cursorEntryLimit;
     this.maintainCount = maintainCount;
-    this.newImportIDSet = new ImportIDSet(indexEntryLimit, indexEntryLimit, maintainCount);
+    this.newImportIDSet = new ImportIDSet(null, indexEntryLimit, indexEntryLimit, maintainCount);
 
     this.state = state;
     this.trusted = state.getIndexTrustState(txn, this);
@@ -160,13 +160,12 @@
    * Delete the specified import ID set from the import ID set associated with the key.
    *
    * @param txn The database transaction
-   * @param key The key to delete the set from.
    * @param importIdSet The import ID set to delete.
    * @throws StorageRuntimeException If a database error occurs.
    */
-  final void delete(WriteableStorage txn, ByteSequence key, ImportIDSet importIdSet)
-      throws StorageRuntimeException
+  final void delete(WriteableStorage txn, ImportIDSet importIdSet) throws StorageRuntimeException
   {
+    ByteSequence key = importIdSet.getKey();
     ByteString value = txn.read(getName(), key);
     if (value != null) {
       newImportIDSet.clear();
@@ -190,13 +189,12 @@
    * Insert the specified import ID set into this index. Creates a DB cursor if needed.
    *
    * @param txn The database transaction
-   * @param key The key to add the set to.
    * @param importIdSet The set of import IDs.
    * @throws StorageRuntimeException If a database error occurs.
    */
-  final void insert(WriteableStorage txn, ByteSequence key, ImportIDSet importIdSet)
-      throws StorageRuntimeException
+  final void insert(WriteableStorage txn, ImportIDSet importIdSet) throws StorageRuntimeException
   {
+    ByteSequence key = importIdSet.getKey();
     ByteString value = txn.read(getName(), key);
     if(value != null) {
       newImportIDSet.clear();

--
Gitblit v1.10.0