// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include #include #include #include namespace zen { class IoBuffer; /** * @brief Records which keys in the oplog (entry["op"]["key"]) are in the ReferencedSet reported by the client that uploaded the oplog. * * An oplog can contain ops from an earlier incremental cook result that are no longer referenced in the most recent cook; * the OplogReferencedSet allows clients that need to view only referenced-by-head-cook entries to trim the oplog down to * those entries. * * Keys are case-sensitive; client must ensure that capitalization matches between the ReferencedSet and the oplog keys. */ class OplogReferencedSet { public: void Emplace(Oid OplogId); bool Contains(Oid OplogId, std::string_view OplogKey); void Clear(); static std::optional LoadFromChunk(const IoBuffer& ChunkData); static constexpr std::string_view ReferencedSetOplogKey = "ReferencedSet"; private: std::unordered_set Set; }; } // namespace zen