public LogRecordWithDLSN readOp() throws IOException {
  LogRecordWithDLSN nextRecordInStream;
  while (true) {
    if (lastRecordSkipTo != null) {
      nextRecordInStream=lastRecordSkipTo;
      recordStream.advance(1);
      lastRecordSkipTo=null;
      return nextRecordInStream;
    }
    if (recordSetReader != null) {
      nextRecordInStream=recordSetReader.nextRecord();
      if (null != nextRecordInStream) {
        recordStream.advance(1);
        return nextRecordInStream;
      }
 else {
        recordSetReader=null;
      }
    }
    try {
      long metadata=in.readLong();
      nextRecordInStream=new LogRecordWithDLSN(recordStream.getCurrentPosition(),startSequenceId);
      nextRecordInStream.setMetadata(metadata);
      nextRecordInStream.setTransactionId(in.readLong());
      nextRecordInStream.readPayload(in);
      if (LOG.isTraceEnabled()) {
        if (nextRecordInStream.isControl()) {
          LOG.trace("Reading {} Control DLSN {}",recordStream.getName(),nextRecordInStream.getDlsn());
        }
 else {
          LOG.trace("Reading {} Valid DLSN {}",recordStream.getName(),nextRecordInStream.getDlsn());
        }
      }
      int numRecords=1;
      if (!deserializeRecordSet && nextRecordInStream.isRecordSet()) {
        numRecords=LogRecordSet.numRecords(nextRecordInStream);
      }
      if (deserializeRecordSet && nextRecordInStream.isRecordSet()) {
        recordSetReader=LogRecordSet.of(nextRecordInStream);
      }
 else {
        recordStream.advance(numRecords);
        return nextRecordInStream;
      }
    }
 catch (    EOFException eof) {
      break;
    }
  }
  return null;
}

public LogRecordWithDLSN readOp ( ) throws IOException { LogRecordWithDLSN nextRecordInStream ; while ( true ) { if ( lastRecordSkipTo != null ) { nextRecordInStream = lastRecordSkipTo ; recordStream . advance ( 1 ) ; lastRecordSkipTo = null ; return nextRecordInStream ; } if ( recordSetReader != null ) { nextRecordInStream = recordSetReader . nextRecord ( ) ; if ( null != nextRecordInStream ) { recordStream . advance ( 1 ) ; return nextRecordInStream ; } else { recordSetReader = null ; } } try { long metadata = in . readLong ( ) ; nextRecordInStream = new LogRecordWithDLSN ( recordStream . getCurrentPosition ( ) , startSequenceId ) ; nextRecordInStream . setMetadata ( metadata ) ; nextRecordInStream . setTransactionId ( in . readLong ( ) ) ; nextRecordInStream . readPayload ( in ) ; if ( LOG . isTraceEnabled ( ) ) { if ( nextRecordInStream . isControl ( ) ) { LOG . trace ( "Reading {} Control DLSN {}" , recordStream . getName ( ) , nextRecordInStream . getDlsn ( ) ) ; } else { LOG . trace ( "Reading {} Valid DLSN {}" , recordStream . getName ( ) , nextRecordInStream . getDlsn ( ) ) ; } } int numRecords = 1 ; if ( ! deserializeRecordSet && nextRecordInStream . isRecordSet ( ) ) { numRecords = LogRecordSet . numRecords ( nextRecordInStream ) ; } if ( deserializeRecordSet && nextRecordInStream . isRecordSet ( ) ) { recordSetReader = LogRecordSet . of ( nextRecordInStream ) ; } else { recordStream . advance ( numRecords ) ; return nextRecordInStream ; } } catch ( EOFException eof ) { break ; } } return null ; }
read an operation from the input stream . < p / > note that the objects returned from this method may be re - used by future calls to the same method .
