aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/projectstore/projectstore.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/projectstore/projectstore.h')
-rw-r--r--src/zenserver/projectstore/projectstore.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/zenserver/projectstore/projectstore.h b/src/zenserver/projectstore/projectstore.h
index 028ad0c6d..9f7de82b6 100644
--- a/src/zenserver/projectstore/projectstore.h
+++ b/src/zenserver/projectstore/projectstore.h
@@ -41,8 +41,8 @@ struct OplogEntry
struct OplogEntryAddress
{
- uint64_t Offset;
- uint64_t Size;
+ uint32_t Offset; // note: Multiple of m_OpsAlign!
+ uint32_t Size;
};
static_assert(IsPow2(sizeof(OplogEntry)));
@@ -80,25 +80,25 @@ public:
struct Oplog : public RefCounted
{
+ enum class EMode
+ {
+ kBasicReadOnly,
+ kFull
+ };
+
Oplog(const LoggerRef& Log,
std::string_view ProjectIdentifier,
std::string_view Id,
CidStore& Store,
const std::filesystem::path& BasePath,
- const std::filesystem::path& MarkerPath);
+ const std::filesystem::path& MarkerPath,
+ EMode State);
~Oplog();
[[nodiscard]] static bool ExistsAt(const std::filesystem::path& BasePath);
bool Exists() const;
- enum class EState
- {
- kUnread,
- kBasicNoLookups,
- kFull
- };
-
- void Read(EState State);
+ void Read();
void Write();
void Update(const std::filesystem::path& MarkerPath);
bool Reset();
@@ -250,10 +250,10 @@ public:
CidStore& m_CidStore;
const std::filesystem::path m_BasePath;
std::filesystem::path m_MarkerPath;
- std::filesystem::path m_TempPath;
- std::filesystem::path m_MetaPath;
+ const std::filesystem::path m_TempPath;
+ const std::filesystem::path m_MetaPath;
- EState m_State = EState::kUnread;
+ const EMode m_Mode;
mutable RwLock m_OplogLock;
OidMap<IoHash> m_ChunkMap; // output data chunk id -> CAS address
@@ -279,7 +279,7 @@ public:
*/
uint32_t GetUnusedSpacePercentLocked() const;
void WriteIndexSnapshot();
- void ReadIndexSnapshot(EState ReadMode);
+ void ReadIndexSnapshot();
struct OplogEntryMapping
{
@@ -323,6 +323,7 @@ public:
Ref<Oplog> NewOplog(std::string_view OplogId, const std::filesystem::path& MarkerPath);
Ref<Oplog> OpenOplog(std::string_view OplogId, bool AllowCompact, bool VerifyPathOnDisk);
+ Ref<Oplog> ReadOplog(std::string_view OplogId);
bool TryUnloadOplog(std::string_view OplogId);
bool DeleteOplog(std::string_view OplogId);
bool RemoveOplog(std::string_view OplogId, std::filesystem::path& OutDeletePath);