Skip to content

Commit

Permalink
Refactor: Corrected inclusion of private headers in public include files
Browse files Browse the repository at this point in the history
  • Loading branch information
umegane committed Sep 4, 2024
1 parent 1e41608 commit c268384
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 20 deletions.
6 changes: 4 additions & 2 deletions include/limestone/api/datastore.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
#include <limestone/api/tag_repository.h>
#include <limestone/api/restore_progress.h>
#include <limestone/api/rotation_task.h>
#include <limestone/api/compaction_catalog.h>

namespace limestone::internal {
class compaction_catalog;
}
namespace limestone::api {

/**
Expand Down Expand Up @@ -256,7 +258,7 @@ class datastore {

std::atomic<bool> stop_online_compaction_worker_{false};

std::optional<compaction_catalog> compaction_catalog_;
std::unique_ptr<limestone::internal::compaction_catalog> compaction_catalog_;

void online_compaction_worker();

Expand Down
8 changes: 4 additions & 4 deletions src/limestone/compaction_catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#include <boost/filesystem.hpp>


#include <limestone/api/compaction_catalog.h>
#include "compaction_catalog.h"
#include "logging_helper.h"
#include <limestone/api/epoch_id_type.h>
#include "limestone/api/epoch_id_type.h"

namespace limestone::api {
namespace limestone::internal {

using limestone::api::epoch_id_type;

Expand Down Expand Up @@ -256,4 +256,4 @@ const std::set<std::string>& compaction_catalog::get_detached_pwals() const {
return detached_pwals_;
}

} // namespace limestone::api
} // namespace limestone::internal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

#include "limestone/api/epoch_id_type.h"

namespace limestone::api {
namespace limestone::internal {

using namespace limestone::api;

/**
* @brief Structure to hold information about compacted files.
Expand Down Expand Up @@ -208,8 +210,6 @@ class compaction_catalog {
epoch_id_type max_epoch_id_ = 0; ///< Maximum epoch ID included in the compacted files

// Set of filenames for compacted files.
// Compacted files are those with filenames starting with "cmpct",
// and they contain deduplicated data from PWAL files.
boost::filesystem::path catalog_file_path_;

// Set of filenames for compacted PWAL files.
Expand All @@ -223,6 +223,6 @@ class compaction_catalog {
[[nodiscard]] std::string create_catalog_content() const;
};

} // namespace limestone::api
} // namespace limestone::internal

#endif // COMPACTION_CATALOG_H
5 changes: 3 additions & 2 deletions src/limestone/datastore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@

#include <limestone/api/datastore.h>
#include "internal.h"
#include <limestone/api/compaction_catalog.h>

#include <limestone/api/rotation_task.h>
#include "log_entry.h"
#include "online_compaction.h"
#include "compaction_catalog.h"

namespace limestone::api {
using namespace limestone::internal;
Expand Down Expand Up @@ -67,7 +68,7 @@ datastore::datastore(configuration const& conf) : location_(conf.data_locations_
}
internal::check_and_migrate_logdir_format(location_);
add_file(compaction_catalog_path);
compaction_catalog_ = compaction_catalog::from_catalog_file(location_);
compaction_catalog_ = std::make_unique<compaction_catalog>(compaction_catalog::from_catalog_file(location_));

// XXX: prusik era
// TODO: read rotated epoch files if main epoch file does not exist
Expand Down
2 changes: 1 addition & 1 deletion src/limestone/datastore_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "logging_helper.h"

#include <limestone/api/datastore.h>
#include <limestone/api/compaction_catalog.h>

#include "compaction_catalog.h"
#include "internal.h"
#include "log_entry.h"

Expand Down
2 changes: 1 addition & 1 deletion src/limestone/online_compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#include "online_compaction.h"

#include <glog/logging.h>
#include <limestone/api/compaction_catalog.h>
#include <limestone/logging.h>

#include <boost/filesystem.hpp>
#include "logging_helper.h"
#include "compaction_catalog.h"

namespace limestone::internal {

Expand Down
6 changes: 3 additions & 3 deletions test/limestone/compaction/compaction_catalog_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

#include <gtest/gtest.h>
#include <boost/filesystem.hpp>
#include <limestone/api/compaction_catalog.h>
#include "compaction_catalog.h"

namespace limestone::testing {

using limestone::api::epoch_id_type;
using limestone::api::compacted_file_info;
using limestone::api::compaction_catalog;
using limestone::internal::compacted_file_info;
using limestone::internal::compaction_catalog;
class compaction_catalog_test : public ::testing::Test {
protected:
void SetUp() override {
Expand Down
2 changes: 1 addition & 1 deletion test/limestone/compaction/online_compaction_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include <boost/filesystem.hpp>

#include <limestone/logging.h>
#include <limestone/api/compaction_catalog.h>
#include <limestone/api/datastore.h>

#include "dblog_scan.h"
#include "internal.h"
#include "log_entry.h"
#include "online_compaction.h"
#include "compaction_catalog.h"

#include "test_root.h"

Expand Down
4 changes: 2 additions & 2 deletions test/limestone/log/log_dir_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
#include <boost/filesystem.hpp>

#include <limestone/logging.h>
#include <limestone/api/compaction_catalog.h>

#include "dblog_scan.h"
#include "internal.h"
#include "log_entry.h"
#include "compaction_catalog.h"

#include "test_root.h"

using namespace std::literals;
using dblog_scan = limestone::internal::dblog_scan;
using compaction_catalog = limestone::api::compaction_catalog;
using compaction_catalog = limestone::internal::compaction_catalog;

namespace limestone::testing {

Expand Down

0 comments on commit c268384

Please sign in to comment.