mirror of
https://github.com/XTXMarkets/ternfs.git
synced 2025-12-16 16:26:47 -06:00
Fix compilation: Add LogsDBTypes.hpp and RocksDBUtils.hpp include
- Created logsdb/LogsDBTypes.hpp to contain LogsDBLogEntry, LogsDBRequest, and LogsDBResponse definitions - Helper classes using std::array<LogsDBLogEntry> now include full definition via LogsDBTypes.hpp - Added RocksDBUtils.hpp include to LogsDBCommon.hpp for ROCKS_DB_CHECKED macro - Updated Appender.hpp, LeaderElection.hpp, and BatchWriter.hpp to include LogsDBTypes.hpp - Removed duplicate type definitions from LogsDB.hpp Co-authored-by: mcrnic <11664456+mcrnic@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "SharedRocksDB.hpp"
|
||||
#include "Time.hpp"
|
||||
#include "logsdb/LogsDBCommon.hpp"
|
||||
#include "logsdb/LogsDBTypes.hpp"
|
||||
|
||||
// Forward declarations for logsdb components
|
||||
class DataPartitions;
|
||||
@@ -54,31 +55,7 @@ class Appender;
|
||||
// Since they were not part of the leader election they know their records after last released point have not been taken into
|
||||
// account and could have been overwriten. They at this point drop these records and catch up from lastReleased point.
|
||||
|
||||
|
||||
struct LogsDBLogEntry {
|
||||
LogIdx idx;
|
||||
std::vector<uint8_t> value;
|
||||
bool operator==(const LogsDBLogEntry& oth) const {
|
||||
return idx == oth.idx && value == oth.value;
|
||||
}
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const LogsDBLogEntry& entry);
|
||||
|
||||
struct LogsDBRequest {
|
||||
ReplicaId replicaId;
|
||||
TernTime sentTime;
|
||||
LogReqMsg msg;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const LogsDBRequest& entry);
|
||||
|
||||
struct LogsDBResponse {
|
||||
ReplicaId replicaId;
|
||||
LogRespMsg msg;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const LogsDBResponse& entry);
|
||||
// LogsDBLogEntry, LogsDBRequest, and LogsDBResponse are now defined in logsdb/LogsDBTypes.hpp
|
||||
|
||||
struct LogsDBStats {
|
||||
std::atomic<Duration> idleTime{0};
|
||||
|
||||
@@ -12,14 +12,13 @@
|
||||
#include "LeaderElection.hpp"
|
||||
#include "LogMetadata.hpp"
|
||||
#include "LogsDBCommon.hpp"
|
||||
#include "LogsDBTypes.hpp"
|
||||
#include "ReqResp.hpp"
|
||||
|
||||
// Forward declarations
|
||||
struct LogsDBLogEntry;
|
||||
struct LogsDBRequest;
|
||||
struct LogsDBStats;
|
||||
struct LogWriteResp;
|
||||
class LogsDB;
|
||||
|
||||
class Appender {
|
||||
static constexpr size_t IN_FLIGHT_MASK = LogsDBConsts::IN_FLIGHT_APPEND_WINDOW - 1;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
#include "../Env.hpp"
|
||||
#include "../Protocol.hpp"
|
||||
#include "LeaderElection.hpp"
|
||||
#include "LogsDBTypes.hpp"
|
||||
#include "ReqResp.hpp"
|
||||
|
||||
// Forward declarations
|
||||
struct LogsDBLogEntry;
|
||||
struct LogsDBRequest;
|
||||
struct ReleaseReq;
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
#include "DataPartitions.hpp"
|
||||
#include "LogMetadata.hpp"
|
||||
#include "LogsDBCommon.hpp"
|
||||
#include "LogsDBTypes.hpp"
|
||||
#include "ReqResp.hpp"
|
||||
|
||||
// Forward declarations
|
||||
struct LogsDBLogEntry;
|
||||
struct LogsDBRequest;
|
||||
struct LogsDBStats;
|
||||
struct NewLeaderReq;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "../Bincode.hpp"
|
||||
#include "../RocksDBUtils.hpp"
|
||||
#include "../Time.hpp"
|
||||
|
||||
// LogsDB constants - moved here to avoid circular dependencies
|
||||
|
||||
39
cpp/core/logsdb/LogsDBTypes.hpp
Normal file
39
cpp/core/logsdb/LogsDBTypes.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright 2025 XTX Markets Technologies Limited
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <vector>
|
||||
|
||||
#include "../Protocol.hpp"
|
||||
#include "../Time.hpp"
|
||||
|
||||
// Core LogsDB types that need to be fully defined for helper classes
|
||||
|
||||
struct LogsDBLogEntry {
|
||||
LogIdx idx;
|
||||
std::vector<uint8_t> value;
|
||||
bool operator==(const LogsDBLogEntry& oth) const {
|
||||
return idx == oth.idx && value == oth.value;
|
||||
}
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const LogsDBLogEntry& entry);
|
||||
|
||||
struct LogsDBRequest {
|
||||
ReplicaId replicaId;
|
||||
TernTime sentTime;
|
||||
LogReqMsg msg;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const LogsDBRequest& entry);
|
||||
|
||||
struct LogsDBResponse {
|
||||
ReplicaId replicaId;
|
||||
LogRespMsg msg;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const LogsDBResponse& entry);
|
||||
Reference in New Issue
Block a user