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

Matthew Swift
27.46.2015 71c4a6fc6193e12063fa3582ae78f9f0c52e53bf
OPENDJ-1848: Remove Storage getRMW and putIfAbsent methods

Add some comments in Index.updateKey(...) explaining the current implementation. This methods looks like it makes too many assumptions about the underlying storage.
1 files modified
10 ■■■■ changed files
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java
@@ -233,20 +233,24 @@
      return;
    }
    if(maintainCount)
    if (maintainCount)
    {
      updateKeyWithRMW(txn, key, deletedIDs, addedIDs);
    }
    else
    {
      /*
       * Avoid taking a write lock on a record which has hit all IDs because it is likely to be a
       * point of contention.
       */
      ByteString value = read(txn, key, false);
      if(value != null)
      if (value != null)
      {
        EntryIDSet entryIDList = new EntryIDSet(key, value);
        if (entryIDList.isDefined())
        {
          updateKeyWithRMW(txn, key, deletedIDs, addedIDs);
        }
        } // else the record exists but we've hit all IDs.
      }
      else
      {