code: synchronized NewEpochResponseProto newEpoch(
        NamespaceInfo nsInfo, long epoch) throws IOException {
  
      checkJournalStorageFormatted();
      journalStorage.checkConsistentNamespace(nsInfo);
      
      // if we are storing image too, check consistency as well
      if (imageStorage.isFormatted()) {
        imageStorage.checkConsistentNamespace(nsInfo);
      }
  
      // Check that the new epoch being proposed is in fact newer than
      // any other that we've promised. 
      if (epoch <= getLastPromisedEpoch()) {
        throw new IOException("Proposed epoch " + epoch + " <= last promise " +
            getLastPromisedEpoch());
      }
      
      updateLastPromisedEpoch(epoch);
      abortCurSegment();
      
      NewEpochResponseProto ret = new NewEpochResponseProto();
  
      EditLogFile latestFile = scanStorageForLatestEdits();
  
      if (latestFile != null) {
        ret.setLastSegmentTxId(latestFile.getFirstTxId());
      }
      return ret;
    }
docs: Try to create a new epoch for this journal.
  @param nsInfo the namespace, which is verified for consistency or used to
  format, if the Journal has not yet been written to.
  @param epoch the epoch to start
  @return the status information necessary to begin recovery
  @throws IOException if the node has already made a promise to another
  writer with a higher epoch number, if the namespace is inconsistent,
  or if a disk error occurs.