From e3a3030cd14ba12631b8c50d955ec800b247fb72 Mon Sep 17 00:00:00 2001
From: Yannick Lecaillez <yannick.lecaillez@forgerock.com>
Date: Thu, 10 Mar 2016 13:24:01 +0000
Subject: [PATCH] OPENDJ-2727: Low performance during import with large index-entry-limit

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
index 6a40020..62f7ff1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
@@ -12,7 +12,7 @@
  * information: "Portions Copyright [year] [name of copyright owner]".
  *
  * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2014-2015 ForgeRock AS.
+ * Portions Copyright 2014-2016 ForgeRock AS.
  */
 package org.opends.server.backends.pluggable;
 
@@ -696,6 +696,30 @@
   }
 
   /**
+   * Copy the list of IDs contained in this {@link EntryIDSet} into the given
+   * array. This function does nothing if this {@link EntryIDSet} is not
+   * defined.
+   *
+   * @param array
+   *          Array where to copy this {@link EntryIDSet} entries id.
+   * @param offset
+   *          The offset within the array of the first byte to be written; must
+   *          be non-negative and no larger than array.length.
+   * @return The number of elements copied or -1 if this {@link EntryIDSet} is
+   *         not defined.
+   */
+  public int copyTo(long[] array, int offset)
+  {
+    if (isDefined())
+    {
+      final long[] ids = concreteImpl.getIDs();
+      System.arraycopy(ids, 0, array, offset, ids.length);
+      return ids.length;
+    }
+    return -1;
+  }
+
+  /**
    * Returns this {@link EntryIDSet} as a long array holding all the entryIDs.
    *
    * @return a new long array containing all the entryIDs included in this {@link EntryIDSet}.

--
Gitblit v1.10.0