void initAfterRecovery(boolean offline) {
    isRecovering = false;
    closed = false;
    deleted.set(false);
    String n = getParent().getName();
    // crf might not exist; but drf always will
    diskFile =
        new File(drf.f.getParentFile(), oplogSet.getPrefix() + n + "_" + oplogId);
    try {
      // This is a recovered oplog and we only read from its crf.
      // No need to open the drf.
      doneAppending = true;
      if (crf.f != null && !hasNoLiveValues()) {
        closed = false;
        // truncate crf/drf if their actual size is less than their pre-blow
        // size
        crf.raf = new UninterruptibleRandomAccessFile(crf.f, "rw");
        crf.RAFClosed = false;
        crf.channel = crf.raf.getChannel();
        unpreblow(crf, getMaxCrfSize());
        crf.raf.close();
        // make crf read only
        crf.raf = new UninterruptibleRandomAccessFile(crf.f, "r");
        crf.channel = crf.raf.getChannel();
        stats.incOpenOplogs();

        // drf.raf is null at this point. create one and close it to retain
        // existing behavior
        try {
          drf.raf = new UninterruptibleRandomAccessFile(drf.f, "rw");
          drf.RAFClosed = false;
          drf.channel = drf.raf.getChannel();
          unpreblow(drf, getMaxDrfSize());
        } finally {
          drf.raf.close();
          drf.raf = null;
          drf.RAFClosed = true;
        }
        // no need to seek to the end; we will not be writing to a recovered
        // oplog; only reading
        // this.crf.raf.seek(this.crf.currSize);
      } else if (!offline) {
        // drf exists but crf has been deleted (because it was empty).
        // I don't think the drf needs to be opened. It is only used during recovery.
        // At some point the compacter may identify that it can be deleted.
        crf.RAFClosed = true;
        deleteCRF();
        closed = true;
        deleted.set(true);
      }

      drf.RAFClosed = true; // since we never open it on a recovered oplog
    } catch (IOException ex) {
      getParent().getCancelCriterion().checkCancelInProgress(ex);
      throw new DiskAccessException(
          String.format("Failed creating operation log because: %s", ex),
          getParent());
    }
    if (hasNoLiveValues() && !offline) {
      getOplogSet().removeOplog(getOplogId(), true, getHasDeletes() ? this : null);
      if (!getHasDeletes()) {
        getOplogSet().drfDelete(oplogId);
        deleteFile(drf);
      }
    } else if (needsCompaction()) {
      // just leave it in the list it is already in
    } else {
      // remove it from the compactable list
      getOplogSet().removeOplog(getOplogId(),
          true/*
               * say we are deleting so that undeletedOplogSize is not inced
               */, null);
      // add it to the inactive list
      getOplogSet().addInactive(this);
    }
  }
Returns true if added file was crf; false if drf
geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java