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

Jean-Noël Rouvignac
29.03.2015 7a0b4fed1cfa0934091355444cc4bc2fb48997ac
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Count.java
@@ -66,7 +66,7 @@
          @Override
          public EntryID apply(ByteString value) throws Exception
          {
            return new EntryID(value.asReader().getCompactUnsigned());
            return new EntryID(value.asReader().readCompactUnsigned());
          }
        }, new CursorTransformer.ValueTransformer<ByteString, ByteString, Long, NeverThrowsException>()
        {
@@ -114,7 +114,7 @@
      @Override
      public ByteSequence computeNewValue(ByteSequence oldValue)
      {
        final long currentValue = oldValue == null ? 0 : oldValue.asReader().getLong();
        final long currentValue = oldValue == null ? 0 : oldValue.asReader().readLong();
        final long newValue = currentValue + delta;
        return newValue == 0 ? null : toValue(newValue);
      }
@@ -164,8 +164,8 @@
  public String keyToString(ByteString key)
  {
    ByteSequenceReader keyReader = key.asReader();
    long keyID = keyReader.getCompactUnsigned();
    long shardBucket = keyReader.getCompactUnsigned();
    long keyID = keyReader.readCompactUnsigned();
    long shardBucket = keyReader.readCompactUnsigned();
    return (keyID == TOTAL_COUNT_ENTRY_ID.longValue() ? "Total Children Count" : keyID) + "#" + shardBucket;
  }
@@ -235,7 +235,7 @@
      if (cursor.positionToKeyOrNext(encodedEntryID)) {
        // Iterate over and remove all the thread local shards
        while (cursor.isDefined() && cursor.getKey().startsWith(encodedEntryID)) {
          counterValue += cursor.getValue().asReader().getLong();
          counterValue += cursor.getValue().asReader().readLong();
          cursor.delete();
          cursor.next();
        }