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

Matthew Swift
24.07.2015 748a3df9bb3ea38a49cd4c0fe498496e0da85cb8
OPENDJ-1711 - reduce feature envy between VerifyJob and VLVIndex
2 files modified
17 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
@@ -452,7 +452,7 @@
   * JE database.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  boolean containsValues(ReadableStorage txn, long entryID, ByteString[] values, AttributeType[] types)
  private boolean containsValues(ReadableStorage txn, long entryID, ByteString[] values, AttributeType[] types)
      throws StorageRuntimeException, DirectoryException
  {
    SortValuesSet valuesSet = getSortValuesSet(txn, entryID, values, types);
@@ -465,7 +465,7 @@
   *
   * @return The types of the attribute values to sort on.
   */
  AttributeType[] getSortTypes()
  private AttributeType[] getSortTypes()
  {
    SortKey[] sortKeys = sortOrder.getSortKeys();
    AttributeType[] types = new AttributeType[sortKeys.length];
@@ -962,7 +962,7 @@
   * @param entry The entry to get the values from.
   * @return The attribute values to sort on.
   */
  ByteString[] getSortValues(Entry entry)
  private ByteString[] getSortValues(Entry entry)
  {
    SortKey[] sortKeys = sortOrder.getSortKeys();
    ByteString[] values = new ByteString[sortKeys.length];
@@ -1106,7 +1106,7 @@
   *         otherwise.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  boolean shouldInclude(Entry entry) throws DirectoryException
  private boolean shouldInclude(Entry entry) throws DirectoryException
  {
    DN entryDN = entry.getName();
    return entryDN.matchesBaseAndScope(baseDN, scope)
@@ -1372,4 +1372,9 @@
  {
    return sortOrder;
  }
  boolean verifyEntry(ReadableStorage txn, EntryID entryID, Entry entry) throws DirectoryException
  {
    return shouldInclude(entry) && !containsValues(txn, entryID.longValue(), getSortValues(entry), getSortTypes());
  }
}
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
@@ -1414,9 +1414,7 @@
    {
      try
      {
        if (vlvIndex.shouldInclude(entry)
            && !vlvIndex.containsValues(
                    txn, entryID.longValue(), vlvIndex.getSortValues(entry), vlvIndex.getSortTypes()))
        if (vlvIndex.verifyEntry(txn, entryID, entry))
        {
          if(logger.isTraceEnabled())
          {