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

Jean-Noel Rouvignac
12.16.2014 c24f62f57922da62b47d9da3e59cc80328408242
Cleanup work before committing a new version of the pluggable storage backend.


PluggableStorageBackend.java: REMOVED (it will be replaced)

SuffixContainer.java:
Removed getEntry(EntryID) in prevision of duplicating this class in the "backends.pluggable" package.

EntryContainer.java, EntryIDSetSorter.java:
Consequence of the change to SuffixContainer.

VLVKeyComparator.java:
Extracted method compare().
1 files deleted
4 files modified
451 ■■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/backends/jeb/EntryContainer.java 11 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/jeb/EntryIDSetSorter.java 3 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/jeb/VLVKeyComparator.java 51 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/pluggable/PluggableStorageBackend.java 374 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/pluggable/SuffixContainer.java 12 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -1218,8 +1218,15 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  /**
   * Returns the entry corresponding to the provided entryID.
   *
   * @param entryID
   *          the id of the entry to retrieve
   * @return the entry corresponding to the provided entryID
   * @throws DirectoryException
   *           If an error occurs retrieving the entry
   */
  public Entry getEntry(EntryID entryID) throws DirectoryException
  {
    // Try the entry cache first.
opendj3-server-dev/src/server/org/opends/server/backends/jeb/EntryIDSetSorter.java
@@ -35,7 +35,6 @@
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.ldap.SearchScope;
import org.opends.server.backends.pluggable.SuffixContainer;
import org.opends.server.controls.VLVRequestControl;
import org.opends.server.controls.VLVResponseControl;
import org.opends.server.core.DirectoryServer;
@@ -68,7 +67,7 @@
   *
   * @throws  DirectoryException  If an error occurs while performing the sort.
   */
  public static EntryIDSet sort(SuffixContainer suffixContainer,
  public static EntryIDSet sort(EntryContainer suffixContainer,
                                EntryIDSet entryIDSet,
                                SearchOperation searchOperation,
                                SortOrder sortOrder,
opendj3-server-dev/src/server/org/opends/server/backends/jeb/VLVKeyComparator.java
@@ -67,7 +67,7 @@
  private boolean[] ascending;
  /**
   * Construst a new VLV Key Comparator object.
   * Construct a new VLV Key Comparator object.
   *
   * @param orderingRules The array of ordering rules to use when comparing
   *                      the decoded values in the key.
@@ -219,20 +219,7 @@
    {
      long b1ID = JebFormat.toLong(b1, b1Pos, b1Pos + 8);
      long b2ID = JebFormat.toLong(b2, b2Pos, b2Pos + 8);
      long idDifference = (b1ID - b2ID);
      if (idDifference < 0)
      {
        return -1;
      }
      else if (idDifference > 0)
      {
        return 1;
      }
      else
      {
        return 0;
      }
      return compare(b1ID, b2ID);
    }
    // If we've gotten here, then we can't tell the difference between the sets
@@ -248,7 +235,7 @@
   *
   * If the given attribute values array does not contain all the values in the
   * sort order, any missing values will be considered as a unknown or
   * wildcard value instead of a nonexistant value. When comparing partial
   * wildcard value instead of a non existent value. When comparing partial
   * information, only values available in both the values set and the
   * given values will be used to determine the ordering. If all available
   * information is the same, 0 will be returned.
@@ -325,20 +312,7 @@
    {
      // If we've gotten here, then we can't tell a difference between the sets
      // of values, so sort based on entry ID.
      long idDifference = (set.getEntryIDs()[index] - entryID);
      if (idDifference < 0)
      {
        return -1;
      }
      else if (idDifference > 0)
      {
        return 1;
      }
      else
      {
        return 0;
      }
      return compare(set.getEntryIDs()[index], entryID);
    }
    // If we've gotten here, then we can't tell the difference between the sets
@@ -346,6 +320,23 @@
    return 0;
  }
  private int compare(long l1, long l2)
  {
    final long difference = l1 - l2;
    if (difference < 0)
    {
      return -1;
    }
    else if (difference > 0)
    {
      return 1;
    }
    else
    {
      return 0;
    }
  }
  /** {@inheritDoc} */
  @Override
  public void initialize(ClassLoader loader)
opendj3-server-dev/src/server/org/opends/server/backends/pluggable/PluggableStorageBackend.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/backends/pluggable/SuffixContainer.java
@@ -26,7 +26,6 @@
import java.io.Closeable;
import org.opends.server.backends.jeb.EntryID;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
@@ -86,15 +85,4 @@
   *         count not be determined
   */
  long getEntryCount();
  /**
   * Returns the entry corresponding to the provided entryID.
   *
   * @param entryID
   *          the id of the entry to retrieve
   * @return the entry corresponding to the provided entryID
   * @throws DirectoryException
   *           If an error occurs retrieving the entry
   */
  Entry getEntry(EntryID entryID) throws DirectoryException;
}