| 769 | |
| 770 | template <class T> |
| 771 | void TLogQueue::push(T const& qe, Reference<LogData> logData) { |
| 772 | BinaryWriter wr(Unversioned()); // outer framing is not versioned |
| 773 | wr << uint32_t(0); |
| 774 | IncludeVersion(ProtocolVersion::withTLogQueueEntryRef()).write(wr); // payload is versioned |
| 775 | wr << qe; |
| 776 | wr << uint8_t(1); |
| 777 | *(uint32_t*)wr.getData() = wr.getLength() - sizeof(uint32_t) - sizeof(uint8_t); |
| 778 | const IDiskQueue::location startloc = queue->getNextPushLocation(); |
| 779 | // FIXME: push shouldn't return anything. We should call getNextPushLocation() again. |
| 780 | const IDiskQueue::location endloc = queue->push(wr.toValue()); |
| 781 | //TraceEvent("TLogQueueVersionWritten", dbgid).detail("Size", wr.getLength() - sizeof(uint32_t) - sizeof(uint8_t)).detail("Loc", loc); |
| 782 | logData->versionLocation[qe.version] = std::make_pair(startloc, endloc); |
| 783 | } |
| 784 | |
| 785 | void TLogQueue::forgetBefore(Version upToVersion, Reference<LogData> logData) { |
| 786 | // Keep only the given and all subsequent version numbers |
no test coverage detected