private long recoverOplogs(long byteCount) {
    OplogEntryIdSet deletedIds = new OplogEntryIdSet(parent.DRF_HASHMAP_OVERFLOW_THRESHOLD);
    TreeSet<Oplog> oplogSet = getSortedOplogs();

    if (!getAlreadyRecoveredOnce().get()) {
      if (getChild() != null && !getChild().hasBeenUsed()) {
        // Then remove the current child since it is empty
        // and does not need to be recovered from
        // and it is important to not call initAfterRecovery on it.
        oplogSet.remove(getChild());
      }
    }

    Set<Oplog> oplogsNeedingValueRecovery = new HashSet<>();

    if (!oplogSet.isEmpty()) {
      long startOpLogRecovery = System.currentTimeMillis();

      // first figure out all entries that have been destroyed
      boolean latestOplog = true;
      for (Oplog oplog : oplogSet) {
        byteCount += oplog.recoverDrf(deletedIds, getAlreadyRecoveredOnce().get(), latestOplog);
        latestOplog = false;
        if (!getAlreadyRecoveredOnce().get()) {
          updateOplogEntryId(oplog.getMaxRecoveredOplogEntryId());
        }
      }

      parent.incDeadRecordCount(deletedIds.size());

      // now figure out live entries
      latestOplog = true;
      for (Oplog oplog : oplogSet) {
        long startOpLogRead = parent.getStats().startOplogRead();
        long bytesRead = oplog.recoverCrf(deletedIds, recoverValues(), recoverValuesSync(),
            getAlreadyRecoveredOnce().get(), oplogsNeedingValueRecovery, latestOplog);
        latestOplog = false;
        if (!getAlreadyRecoveredOnce().get()) {
          updateOplogEntryId(oplog.getMaxRecoveredOplogEntryId());
        }
        byteCount += bytesRead;
        parent.getStats().endOplogRead(startOpLogRead, bytesRead);

        // Callback to the disk regions to indicate the oplog is recovered
        // Used for offline export
        for (DiskRecoveryStore drs : currentRecoveryMap.values()) {
          drs.getDiskRegionView().oplogRecovered(oplog.oplogId);
        }
      }

      long endOpLogRecovery = System.currentTimeMillis();
      long elapsed = endOpLogRecovery - startOpLogRecovery;
      logger.info("recovery oplog load took {} ms", elapsed);
    }

    if (!parent.isOfflineCompacting()) {
      long startRegionInit = System.currentTimeMillis();

      // create the oplogs now so that loadRegionData can have them available
      // Create an array of Oplogs so that we are able to add it in a single shot
      // to the map
      for (DiskRecoveryStore drs : currentRecoveryMap.values()) {
        drs.getDiskRegionView().initRecoveredEntryCount();
      }

      if (!getAlreadyRecoveredOnce().get()) {
        for (Oplog oplog : oplogSet) {
          if (oplog != getChild()) {
            oplog.initAfterRecovery(parent.isOffline());
          }
        }
        if (getChild() == null) {
          setFirstChild(getSortedOplogs(), false);
        }
      }

      if (!parent.isOffline()) {
        if (recoverValues() && !recoverValuesSync()) {
          // value recovery defers compaction because it is using the compactor thread
          parent.scheduleValueRecovery(oplogsNeedingValueRecovery, currentRecoveryMap);
        }

        if (!getAlreadyRecoveredOnce().get()) {
          // Create krfs for oplogs that are missing them
          for (Oplog oplog : oplogSet) {
            if (oplog.needsKrf()) {
              oplog.createKrfAsync();
            }
          }
          parent.scheduleCompaction();
        }

        long endRegionInit = System.currentTimeMillis();
        logger.info("recovery region initialization took {} ms", endRegionInit - startRegionInit);
      }
    }
    return byteCount;
  }
Taking a lock on the LinkedHashMap oplogIdToOplog as it the operation of adding an Oplog to the
Map & notifying the Compactor thread , if not already compaction has to be an atomic operation.
add the oplog to the to be compacted set. if compactor thread is active and recovery is not
going on then the compactor thread is notified of the addition
geode-core/src/main/java/org/apache/geode/internal/cache/PersistentOplogSet.java