public void prepareForClose() {
    Collection<Oplog> oplogsToPrepare = new ArrayList<>();
    synchronized (getOplogIdToOplog()) {
      oplogsToPrepare.addAll(getOplogIdToOplog().values());
      oplogsToPrepare.addAll(inactiveOplogs.values());
    }

    boolean childPreparedForClose = false;
    long childOplogId = getChild() == null ? -1 : getChild().oplogId;

    for (Oplog oplog : oplogsToPrepare) {
      oplog.prepareForClose();
      if (childOplogId != -1 && oplog.oplogId == childOplogId) {
        childPreparedForClose = true;
      }
    }

    if (!childPreparedForClose && getChild() != null) {
      getChild().prepareForClose();
    }
  }
Removes the oplog from the map given the oplogId

@param id id of the oplog to be removed from the list
@return oplog Oplog which has been removed
geode-core/src/main/java/org/apache/geode/internal/cache/PersistentOplogSet.java