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

Matthew Swift
22.03.2014 8dc42dce4649dd52d4f85b161cd09350fce60920
opendj3-server-dev/src/server/org/opends/server/backends/pluggable/VLVIndex.java
@@ -230,7 +230,7 @@
    {
      while (cursor.next())
      {
        count.getAndAdd(SortValuesSet.getEncodedSize(cursor.getValue()));
        count.getAndAdd(getEncodedSize(cursor.getValue()));
      }
    }
    finally
@@ -239,6 +239,12 @@
    }
  }
  // Matches encoding from SortValuesSet.
  private int getEncodedSize(ByteString bytes)
  {
    return bytes.toInt();
  }
  /**
   * Close the VLV index.
   *
@@ -826,7 +832,7 @@
              }
              else
              {
                targetOffset += SortValuesSet.getEncodedSize(cursor.getValue());
                targetOffset += getEncodedSize(cursor.getValue());
              }
            }
@@ -1090,15 +1096,13 @@
      }
      else
      {
        byte[] valueBytes = new byte[valueLength];
        System.arraycopy(keyBytes, vBytesPos, valueBytes, 0, valueLength);
        attributeValues[i] = ByteString.wrap(valueBytes);
        attributeValues[i] = keyBytes.subSequence(vBytesPos, vBytesPos + valueLength);
      }
      vBytesPos += valueLength;
    }
    final long id = JebFormat.toLong(keyBytes.toByteArray(), vBytesPos, keyBytes.length());
    final long id = keyBytes.subSequence(vBytesPos, keyBytes.length()).toLong();
    return new SortValues(new EntryID(id), attributeValues, sortOrder);
  }