private static PrepareLogRecord ReadPrepareInternal(TFReaderLease reader, long logPosition) { RecordReadResult result = reader.TryReadAt(logPosition); if (!result.Success) return null; if (result.LogRecord.RecordType != LogRecordType.Prepare) throw new Exception(string.Format("Incorrect type of log record {0}, expected Prepare record.", result.LogRecord.RecordType)); return (PrepareLogRecord)result.LogRecord; }
private static Tuple<string, bool> ReadEntry(TFReaderLease reader, long position) { RecordReadResult result = reader.TryReadAt(position); if (!result.Success) return new Tuple<string, bool>(String.Empty, false); if (result.LogRecord.RecordType != TransactionLog.LogRecords.LogRecordType.Prepare) throw new Exception(string.Format("Incorrect type of log record {0}, expected Prepare record.", result.LogRecord.RecordType)); return new Tuple<string, bool>(((TransactionLog.LogRecords.PrepareLogRecord)result.LogRecord).EventStreamId, true); }