Skip to content

Commit

Permalink
Cleaned up rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Oct 1, 2024
1 parent 827357c commit 2ee0adc
Show file tree
Hide file tree
Showing 32 changed files with 450 additions and 434 deletions.
33 changes: 16 additions & 17 deletions src/bucket/Bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,23 +1071,6 @@ HotArchiveBucket::isTombstoneEntry(HotArchiveBucketEntry const& e)
return e.type() == HOT_ARCHIVE_LIVE;
}

template std::shared_ptr<LiveBucket> Bucket::merge<LiveBucket>(
BucketManager& bucketManager, uint32_t maxProtocolVersion,
std::shared_ptr<LiveBucket> const& oldBucket,
std::shared_ptr<LiveBucket> const& newBucket,
std::vector<std::shared_ptr<LiveBucket>> const& shadows,
bool keepTombstoneEntries, bool countMergeEvents, asio::io_context& ctx,
bool doFsync);

template std::shared_ptr<HotArchiveBucket> Bucket::merge<HotArchiveBucket>(
BucketManager& bucketManager, uint32_t maxProtocolVersion,
std::shared_ptr<HotArchiveBucket> const& oldBucket,
std::shared_ptr<HotArchiveBucket> const& newBucket,
std::vector<std::shared_ptr<HotArchiveBucket>> const& shadows,
bool keepTombstoneEntries, bool countMergeEvents, asio::io_context& ctx,
bool doFsync);
}

BucketEntryCounters&
BucketEntryCounters::operator+=(BucketEntryCounters const& other)
{
Expand All @@ -1114,4 +1097,20 @@ BucketEntryCounters::operator!=(BucketEntryCounters const& other) const
{
return !(*this == other);
}

template std::shared_ptr<LiveBucket> Bucket::merge<LiveBucket>(
BucketManager& bucketManager, uint32_t maxProtocolVersion,
std::shared_ptr<LiveBucket> const& oldBucket,
std::shared_ptr<LiveBucket> const& newBucket,
std::vector<std::shared_ptr<LiveBucket>> const& shadows,
bool keepTombstoneEntries, bool countMergeEvents, asio::io_context& ctx,
bool doFsync);

template std::shared_ptr<HotArchiveBucket> Bucket::merge<HotArchiveBucket>(
BucketManager& bucketManager, uint32_t maxProtocolVersion,
std::shared_ptr<HotArchiveBucket> const& oldBucket,
std::shared_ptr<HotArchiveBucket> const& newBucket,
std::vector<std::shared_ptr<HotArchiveBucket>> const& shadows,
bool keepTombstoneEntries, bool countMergeEvents, asio::io_context& ctx,
bool doFsync);
}
6 changes: 6 additions & 0 deletions src/bucket/Bucket.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ class LiveBucket : public Bucket,
{
public:
LiveBucket();
virtual ~LiveBucket()
{
}
LiveBucket(std::string const& filename, Hash const& hash,
std::unique_ptr<BucketIndex const>&& index);

Expand Down Expand Up @@ -219,6 +222,9 @@ class HotArchiveBucket : public Bucket,

public:
HotArchiveBucket();
virtual ~HotArchiveBucket()
{
}
HotArchiveBucket(std::string const& filename, Hash const& hash,
std::unique_ptr<BucketIndex const>&& index);
uint32_t getBucketVersion() const override;
Expand Down
6 changes: 5 additions & 1 deletion src/bucket/BucketIndexImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ BucketIndexImpl<IndexT>::BucketIndexImpl(BucketManager& bm,
{
mData.keysToOffset.emplace_back(key, pos);
}
countEntry(be);

if constexpr (std::is_same<BucketEntryT, BucketEntry>::value)
{
countEntry(be);
}
}

pos = in.pos();
Expand Down
12 changes: 3 additions & 9 deletions src/bucket/BucketList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace stellar

template <> BucketListDepth BucketListBase<LiveBucket>::kNumLevels = 11;

// TODO: I made this number up, do some analysis and pick a better value or
// make this a configurable network config.
// TODO: This is an arbitrary number. Do some analysis and pick a better value
// or make this a configurable network config.
template <> BucketListDepth BucketListBase<HotArchiveBucket>::kNumLevels = 9;

template <typename BucketT>
Expand Down Expand Up @@ -577,12 +577,6 @@ HotArchiveBucketList::addBatch(Application& app, uint32_t currLedger,

for (uint32_t i = static_cast<uint32>(mLevels.size()) - 1; i != 0; --i)
{
/*
CLOG_DEBUG(Bucket, "curr={}, half(i-1)={}, size(i-1)={},
roundDown(curr,half)={}, roundDown(curr,size)={}", currLedger,
levelHalf(i-1), levelSize(i-1), roundDown(currLedger, levelHalf(i-1)),
roundDown(currLedger, levelSize(i-1)));
*/
if (levelShouldSpill(currLedger, i - 1))
{
/**
Expand Down Expand Up @@ -771,7 +765,7 @@ LiveBucketList::addBatch(Application& app, uint32_t currLedger,
}

BucketEntryCounters
BucketList::sumBucketEntryCounters() const
LiveBucketList::sumBucketEntryCounters() const
{
BucketEntryCounters counters;
for (auto const& lev : mLevels)
Expand Down
Loading

0 comments on commit 2ee0adc

Please sign in to comment.