MCPcopy Create free account
hub / github.com/apple/foundationdb / push

Method push

fdbserver/TLogServer.actor.cpp:771–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769
770template <class T>
771void 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
785void TLogQueue::forgetBefore(Version upToVersion, Reference<LogData> logData) {
786 // Keep only the given and all subsequent version numbers

Callers 15

ifMethod · 0.45
Future<Void> commitQueueFunction · 0.45
Future<Void> tLogStartFunction · 0.45
log_opMethod · 0.45
recoverMethod · 0.45

Calls 7

UnversionedFunction · 0.85
IncludeVersionFunction · 0.85
getLengthMethod · 0.80
writeMethod · 0.45
getDataMethod · 0.45
getNextPushLocationMethod · 0.45
toValueMethod · 0.45

Tested by

no test coverage detected