opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/Importer.java
@@ -27,9 +27,9 @@ package org.opends.server.backends.jeb; import static com.sleepycat.je.EnvironmentConfig.*; 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.*; @@ -136,8 +136,6 @@ private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); private static final int TIMER_INTERVAL = 10000; private static final int KB = 1024; private static final int MB = KB * KB; private static final String DEFAULT_TMP_DIR = "import-tmp"; private static final String TMPENV_DIR = "tmp-env"; opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/IndexOutputBuffer.java
@@ -26,7 +26,8 @@ */ package org.opends.server.backends.jeb; import static org.opends.server.backends.jeb.Importer.indexComparator; import static org.opends.server.backends.jeb.Importer.*; import static org.opends.server.util.StaticUtils.*; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; @@ -68,9 +69,6 @@ LT, GT, LE, GE, EQ } /** The size of a Java int. A Java int is 32 bits, i.e. 4 bytes. */ static final int INT_SIZE = 4; /** * The record overhead. In addition to entryID, key length and key bytes, the * record overhead includes the indexID + INS/DEL bit opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
@@ -27,6 +27,7 @@ package org.opends.server.backends.pluggable; import static org.forgerock.util.Reject.*; import static org.opends.server.util.StaticUtils.*; import java.util.Arrays; import java.util.Iterator; @@ -86,10 +87,6 @@ /** Define serialization contract for EntryIDSet. */ interface EntryIDSetCodec { int INT_SIZE = 4; int LONG_SIZE = 8; ByteString encode(EntryIDSet idSet); EntryIDSet decode(ByteSequence key, ByteString value); opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ImportRecord.java
@@ -24,6 +24,8 @@ */ package org.opends.server.backends.pluggable; import static org.opends.server.util.StaticUtils.*; import org.forgerock.opendj.ldap.ByteSequence; import org.forgerock.opendj.ldap.ByteString; @@ -33,16 +35,11 @@ final class ImportRecord implements Comparable<ImportRecord> { /** The number of bytes of a Java int. */ static final int INT_SIZE = 4; /** The number of bytes of a Java long. */ static final int LONG_SIZE = 8; /** * The record overhead. In addition to entryID, key length and key bytes, the record overhead * includes the INS/DEL bit + indexID */ private static final int REC_OVERHEAD = 1 + INT_SIZE; static final int REC_OVERHEAD = 1 + INT_SIZE; static ImportRecord fromBufferAndPosition(byte[] buffer, int position) { opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Importer.java
@@ -29,7 +29,6 @@ import static org.opends.messages.JebMessages.*; import static org.opends.server.admin.std.meta.BackendIndexCfgDefn.IndexType.*; import static org.opends.server.backends.pluggable.EntryIDSet.*; import static org.opends.server.backends.pluggable.IndexOutputBuffer.*; import static org.opends.server.backends.pluggable.SuffixContainer.*; import static org.opends.server.util.DynamicConstants.*; import static org.opends.server.util.ServerConstants.*; @@ -131,8 +130,6 @@ private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); private static final int TIMER_INTERVAL = 10000; private static final int KB = 1024; private static final int MB = KB * KB; private static final String DEFAULT_TMP_DIR = "import-tmp"; private static final String TMPENV_DIR = "tmp-env"; @@ -146,8 +143,7 @@ * size for byte buffers. */ private static final int READER_WRITER_BUFFER_SIZE = 8 * KB; private static final int MIN_DB_CACHE_MEMORY = MAX_DB_CACHE_SIZE + MAX_DB_LOG_SIZE; private static final int MIN_DB_CACHE_MEMORY = MAX_DB_CACHE_SIZE + MAX_DB_LOG_SIZE; /** Max size of phase one buffer. */ private static final int MAX_BUFFER_SIZE = 2 * MB; @@ -161,9 +157,6 @@ /** The DN attribute type. */ private static final AttributeType DN_TYPE; /** The dn2id "index ID". */ private static final String DN2ID = "dn2id"; /** Phase one buffer count. */ private final AtomicInteger bufferCount = new AtomicInteger(0); /** Phase one imported entries count. */ @@ -1517,7 +1510,7 @@ private final Map<IndexKey, IndexOutputBuffer> indexBufferMap = new HashMap<IndexKey, IndexOutputBuffer>(); private final Set<ByteString> insertKeySet = new HashSet<ByteString>(); private final EntryInformation entryInfo = new EntryInformation(); private final IndexKey dnIndexKey = new IndexKey(DN_TYPE, DN2ID, 1); private final IndexKey dnIndexKey = new IndexKey(DN_TYPE, DN2ID_INDEX_NAME, 1); public ImportTask(final Storage storage) { @@ -2616,7 +2609,7 @@ { return; } boolean isDN2ID = DN2ID.equals(indexKey.getIndexID()); boolean isDN2ID = DN2ID_INDEX_NAME.equals(indexKey.getIndexID()); IndexManager indexMgr = new IndexManager(indexKey.getName(), isDN2ID, indexKey.getEntryLimit()); if (isDN2ID) { opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexInputBuffer.java
@@ -27,7 +27,7 @@ package org.opends.server.backends.pluggable; import static org.opends.messages.JebMessages.*; import static org.opends.server.backends.pluggable.IndexOutputBuffer.*; import static org.opends.server.util.StaticUtils.*; import java.io.IOException; import java.nio.ByteBuffer; opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexOutputBuffer.java
@@ -26,6 +26,9 @@ */ package org.opends.server.backends.pluggable; import static org.opends.server.backends.pluggable.ImportRecord.*; import static org.opends.server.util.StaticUtils.*; import java.io.ByteArrayOutputStream; import org.forgerock.opendj.ldap.ByteSequence; @@ -60,17 +63,6 @@ */ final class IndexOutputBuffer implements Comparable<IndexOutputBuffer> { /** The number of bytes of a Java int. */ static final int INT_SIZE = 4; /** The number of bytes of a Java long. */ static final int LONG_SIZE = 8; /** * The record overhead. In addition to entryID, key length and key bytes, the * record overhead includes the INS/DEL bit + indexID */ private static final int REC_OVERHEAD = 1 + INT_SIZE; /** Buffer records are either insert records or delete records. */ private static final byte DEL = 0, INS = 1; opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
@@ -78,9 +78,31 @@ { private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); /** The number of bytes of a Java int. A Java int is 32 bits, i.e. 4 bytes. */ public static final int INT_SIZE = 4; /** The number of bytes of a Java long. A Java int is 64 bits, i.e. 8 bytes. */ public static final int LONG_SIZE = 8; /** * Private constructor to prevent instantiation. * Number of bytes in a Kibibyte. * <p> * Example usage: * <pre> * int _10KB = 10 * KB; * <pre> */ public static final int KB = 1024; /** * Number of bytes in a Mebibyte. * <p> * Example usage: * <pre> * int _10MB = 10 * MB; * <pre> */ public static final int MB = KB * KB; /** Private constructor to prevent instantiation. */ private StaticUtils() { // No implementation required. }