mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Ludovic Poitou
08.29.2011 97c2fb52d5c90b82970d1c43d9adbc5aca241d74
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.server.backends.jeb.importLDIF;
@@ -422,7 +423,8 @@
    final long usableMemory = availableMemory
        - (indexCount * READER_WRITER_BUFFER_SIZE);
    if (!skipDNValidation)
    // We need caching when doing DN validation or rebuilding indexes.
    if (!skipDNValidation || (rebuildManager != null))
    {
      // No DN validation: calculate memory for DB cache, DN2ID temporary cache,
      // and buffers.
@@ -3306,15 +3308,12 @@
    public Void call() throws Exception
    {
      ID2Entry id2entry = entryContainer.getID2Entry();
      Cursor cursor = id2entry.openCursor(null, CursorConfig.READ_COMMITTED);
      DiskOrderedCursor cursor =
          id2entry.openCursor(DiskOrderedCursorConfig.DEFAULT);
      DatabaseEntry key = new DatabaseEntry();
      DatabaseEntry data = new DatabaseEntry();
      LockMode lockMode = LockMode.DEFAULT;
      OperationStatus status;
      try {
        for (status = cursor.getFirst(key, data, lockMode);
             status == OperationStatus.SUCCESS;
             status = cursor.getNext(key, data, lockMode))
        while (cursor.getNext(key, data, null) == OperationStatus.SUCCESS)
        {
          if(isCanceled)
          {