Skip to content

Commit

Permalink
Remove in hive_utilities dependency on hive_chain
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz-Trela authored and vogel76 committed Jan 8, 2025
1 parent 3c68b28 commit 78c0af1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
1 change: 1 addition & 0 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ add_library( hive_chain
irreversible_block_writer.cpp
single_block_storage.cpp
sync_block_writer.cpp
split_block_log.cpp

generic_custom_operation_interpreter.cpp

Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/block_log_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <hive/chain/block_log.hpp>
#include <hive/chain/database.hpp>
#include <hive/utilities/split_block_log.hpp>
#include <hive/chain/split_block_log.hpp>
//#include <regex>

namespace hive { namespace chain {
Expand Down Expand Up @@ -497,7 +497,7 @@ bool block_log_wrapper::try_splitting_monolithic_log_file( full_block_ptr_t stat
try
{
wlog("Trying to split legacy monolithic block log file.");
utilities::split_block_log( monolith_path, head_block_number, part_count, _app, _thread_pool );
split_block_log( monolith_path, head_block_number, part_count, _app, _thread_pool );
wlog("Successfully split legacy monolithic block log file.");
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <fc/filesystem.hpp>

namespace hive { namespace utilities {
namespace hive { namespace chain {

/**
* @brief Tries splitting provided legacy block log file into parts.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#include <hive/utilities/split_block_log.hpp>

#include <hive/chain/split_block_log.hpp>
#include <hive/chain/block_log.hpp>
#include <hive/chain/block_log_wrapper.hpp>

namespace hive { namespace utilities {

using hive::chain::block_log;
using hive::chain::block_log_artifacts;
using hive::chain::block_log_file_name_info;
using hive::chain::block_log_wrapper;
using hive::chain::blockchain_worker_thread_pool;
namespace hive { namespace chain {

using block_data_t = std::tuple<uint32_t,std::unique_ptr<char[]>,size_t,block_log_artifacts::artifacts_t>;
using block_data_container_t = std::vector<block_data_t>;
Expand Down
3 changes: 1 addition & 2 deletions libraries/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ file(GLOB HEADERS "include/hive/utilities/*.hpp")
set(sources
notifications.cpp
benchmark_dumper.cpp
split_block_log.cpp
string_escape.cpp
tempdir.cpp
logging_config.cpp
Expand All @@ -29,7 +28,7 @@ list(APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp")
add_library( hive_utilities
${sources}
${HEADERS} )
target_link_libraries( hive_utilities appbase hive_chain fc hive_protocol )
target_link_libraries( hive_utilities appbase fc hive_protocol )
target_include_directories( hive_utilities
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
if (USE_PCH)
Expand Down
4 changes: 2 additions & 2 deletions programs/util/block_log_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include <hive/chain/full_block.hpp>
#include <hive/chain/blockchain_worker_thread_pool.hpp>
#include <hive/chain/block_compression_dictionaries.hpp>
#include <hive/chain/split_block_log.hpp>
#include <hive/utilities/io_primitives.hpp>
#include <hive/utilities/git_revision.hpp>
#include <hive/utilities/split_block_log.hpp>

#include <boost/program_options.hpp>
#include <boost/scope_exit.hpp>
Expand Down Expand Up @@ -877,7 +877,7 @@ bool split_block_log(const fc::path &block_log_filename, const int32_t first_blo
uint32_t head_block_number = head_part_num == 0 ? 0 :
hive::chain::block_log_wrapper::get_number_of_last_block_in_part( head_part_num, MAX_FILES_OF_SPLIT_BLOCK_LOG );
std::cout << "Splitting block_log ...\n";
hive::utilities::split_block_log(block_log_filename, head_block_number, part_count, app, thread_pool, output_dir);
hive::chain::split_block_log(block_log_filename, head_block_number, part_count, app, thread_pool, output_dir);
std::cout << "Splitting block_log finished\n";
if (!last_block_is_head_block && (last_block % BLOCKS_IN_SPLIT_BLOCK_LOG_FILE != 0))
{
Expand Down

0 comments on commit 78c0af1

Please sign in to comment.