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

Jean-Noel Rouvignac
24.14.2015 7b44fa6b33c5441b25e900fb906e280641ce3737
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/Importer.java
@@ -30,6 +30,7 @@
import static org.opends.messages.JebMessages.*;
import static org.opends.server.admin.std.meta.LocalDBIndexCfgDefn.IndexType.*;
import static org.opends.server.backends.jeb.IndexOutputBuffer.*;
import static org.opends.server.backends.pluggable.SuffixContainer.*;
import static org.opends.server.util.DynamicConstants.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -2417,7 +2418,8 @@
   */
  private final class ScratchFileWriterTask implements Callable<Void>
  {
    private final int DRAIN_TO = 3;
    private static final int DRAIN_TO = 3;
    private final IndexManager indexMgr;
    private final BlockingQueue<IndexOutputBuffer> queue;
    private final ByteArrayOutputStream insertByteStream = new ByteArrayOutputStream(2 * bufferSize);
@@ -2642,9 +2644,10 @@
    {
      if (insertKeyCount > indexMgr.getLimit())
      {
        // special handling when index entry limit has been exceeded
        insertKeyCount = 1;
        insertByteStream.reset();
        writePackedInt(insertByteStream, -1);
        writePackedLong(insertByteStream, IndexInputBuffer.UNDEFINED_SIZE);
      }
      int insertSize = writePackedInt(bufferStream, insertKeyCount);
@@ -2693,6 +2696,14 @@
      return writeSize;
    }
    private int writePackedLong(OutputStream stream, long value) throws IOException
    {
      int writeSize = PackedInteger.getWriteLongLength(value);
      PackedInteger.writeLong(tmpArray, 0, value);
      stream.write(tmpArray, 0, writeSize);
      return writeSize;
    }
    /** {@inheritDoc} */
    @Override
    public String toString()
@@ -3404,11 +3415,11 @@
      for (String index : rebuildList)
      {
        final String lowerName = index.toLowerCase();
        if ("dn2id".equals(lowerName))
        if (DN2ID_INDEX_NAME.equals(lowerName))
        {
          indexCount += 3;
        }
        else if ("dn2uri".equals(lowerName))
        else if (DN2URI_INDEX_NAME.equals(lowerName))
        {
          indexCount++;
        }
@@ -3420,8 +3431,8 @@
          }
          indexCount++;
        }
        else if ("id2subtree".equals(lowerName)
            || "id2children".equals(lowerName))
        else if (ID2SUBTREE_INDEX_NAME.equals(lowerName)
            || ID2CHILDREN_INDEX_NAME.equals(lowerName))
        {
          throw attributeIndexNotConfigured(index);
        }
@@ -4148,8 +4159,7 @@
    public String toString()
    {
      return getClass().getSimpleName()
          + "(attributeType=" + attributeType
          + ", indexType=" + indexType
          + "(index=" + attributeType.getNameOrOID() + "." + indexType
          + ", entryLimit=" + entryLimit
          + ")";
    }