operatorstd::string(){returnformat("%lld.%lld",hi,lo);}// FIXME: Return a 'HumanReadableDescription' instead of std::string, make TraceEvent::detail accept that (for safety)
booloperator<(locationconst&r)const{
if(hi<r.hi)returntrue;
if(hi>r.hi)returnfalse;
returnlo<r.lo;
}
};
// Before calling push or commit, the caller *must* perform recovery by calling readNext() until it returns less than the requested number of bytes.
// Thereafter it may not be called again.
virtualFuture<Standalone<StringRef>>readNext(intbytes)=0;// Return the next bytes in the queue (beginning, the first time called, with the first unpopped byte)
virtuallocationgetNextReadLocation()=0;// Returns a location >= the location of all bytes previously returned by readNext(), and <= the location of all bytes subsequently returned
virtuallocationpush(StringRefcontents)=0;// Appends the given bytes to the byte stream. Returns a location token representing the *end* of the contents.
virtualvoidpop(locationupTo)=0;// Removes all bytes before the given location token from the byte stream.
virtualFuture<Void>commit()=0;// returns when all prior pushes and pops are durable. If commit does not return (due to close or a crash), any prefix of the pushed bytes and any prefix of the popped bytes may be durable.
virtualintgetCommitOverhead()=0;// returns the amount of unused space that would be written by a commit that immediately followed this call