diff --git a/CMakeLists.txt b/CMakeLists.txt index 7744d8a65c..dac8cb6b3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,7 +192,6 @@ add_subdirectory(kvbc) add_subdirectory(performance) add_subdirectory(bftengine) add_subdirectory(tools) -add_subdirectory(storage) add_subdirectory(scripts) add_subdirectory(client) if(USE_GRPC) diff --git a/bftengine/include/bftengine/DbCheckpointManager.hpp b/bftengine/include/bftengine/DbCheckpointManager.hpp index 1c65ff0df9..6a97bb26c7 100644 --- a/bftengine/include/bftengine/DbCheckpointManager.hpp +++ b/bftengine/include/bftengine/DbCheckpointManager.hpp @@ -31,7 +31,7 @@ #include "DbCheckpointMetadata.hpp" #include "util/Metrics.hpp" #include "InternalBFTClient.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include "util/filesystem.hpp" #include "kv_types.hpp" namespace _fs = fs; diff --git a/bftengine/include/bftengine/DbMetadataStorage.hpp b/bftengine/include/bftengine/DbMetadataStorage.hpp index 50fcb17f55..c9a498bd3e 100644 --- a/bftengine/include/bftengine/DbMetadataStorage.hpp +++ b/bftengine/include/bftengine/DbMetadataStorage.hpp @@ -19,8 +19,8 @@ #include "log/logger.hpp" #include "bftengine/MetadataStorage.hpp" -#include "storage/db_interface.h" -#include "storage/key_manipulator_interface.h" +#include "storage/db_interface.hpp" +#include "storage/key_manipulator_interface.hpp" #include "util/sliver.hpp" namespace concord { diff --git a/bftengine/src/bcstatetransfer/BCStateTran.cpp b/bftengine/src/bcstatetransfer/BCStateTran.cpp index fef210b02a..6db15c0bf3 100644 --- a/bftengine/src/bcstatetransfer/BCStateTran.cpp +++ b/bftengine/src/bcstatetransfer/BCStateTran.cpp @@ -27,9 +27,9 @@ #include "util/json_output.hpp" #include "ReservedPagesClient.hpp" #include "DBDataStore.hpp" -#include "storage/db_interface.h" -#include "storage/key_manipulator_interface.h" -#include "memorydb/client.h" +#include "storage/db_interface.hpp" +#include "storage/key_manipulator_interface.hpp" +#include "storage/memorydb/client.hpp" #include "client/reconfiguration/client_reconfiguration_engine.hpp" #include "client/reconfiguration/poll_based_state_client.hpp" #include "RVBManager.hpp" diff --git a/bftengine/src/bcstatetransfer/DBDataStore.cpp b/bftengine/src/bcstatetransfer/DBDataStore.cpp index ca52d7626a..782cd170e0 100644 --- a/bftengine/src/bcstatetransfer/DBDataStore.cpp +++ b/bftengine/src/bcstatetransfer/DBDataStore.cpp @@ -1,6 +1,6 @@ #include #include "DBDataStore.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include "util/serializable.hpp" using concord::serialize::Serializable; diff --git a/bftengine/src/bcstatetransfer/DBDataStore.hpp b/bftengine/src/bcstatetransfer/DBDataStore.hpp index d1d192f62a..22c64bafd7 100644 --- a/bftengine/src/bcstatetransfer/DBDataStore.hpp +++ b/bftengine/src/bcstatetransfer/DBDataStore.hpp @@ -20,7 +20,7 @@ #include "log/logger.hpp" #include "util/string.hpp" #include "InMemoryDataStore.hpp" -#include "storage/key_manipulator_interface.h" +#include "storage/key_manipulator_interface.hpp" namespace bftEngine { namespace bcst { diff --git a/bftengine/src/bcstatetransfer/DataStore.hpp b/bftengine/src/bcstatetransfer/DataStore.hpp index feb3eb7013..6f534afe0f 100644 --- a/bftengine/src/bcstatetransfer/DataStore.hpp +++ b/bftengine/src/bcstatetransfer/DataStore.hpp @@ -19,7 +19,7 @@ #include "log/logger.hpp" #include "util/assertUtils.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include "crypto/digest.hpp" using std::set; diff --git a/bftengine/src/simplestatetransfer/SimpleStateTran.cpp b/bftengine/src/simplestatetransfer/SimpleStateTran.cpp index 5f6c1957e4..5acf8c308f 100644 --- a/bftengine/src/simplestatetransfer/SimpleStateTran.cpp +++ b/bftengine/src/simplestatetransfer/SimpleStateTran.cpp @@ -21,9 +21,9 @@ #include "util/assertUtils.hpp" #include "SimpleStateTransfer.hpp" #include "SimpleBCStateTransfer.hpp" -#include "memorydb/client.h" -#include "memorydb/key_comparator.h" -#include "storage/direct_kv_key_manipulator.h" +#include "storage/memorydb/client.hpp" +#include "storage/memorydb/key_comparator.hpp" +#include "storage/direct_kv_key_manipulator.hpp" #include "util/Timers.hpp" namespace bftEngine { diff --git a/bftengine/tests/bcstatetransfer/bcstatetransfer_tests.cpp b/bftengine/tests/bcstatetransfer/bcstatetransfer_tests.cpp index 025c9d5331..2a9b254a8e 100644 --- a/bftengine/tests/bcstatetransfer/bcstatetransfer_tests.cpp +++ b/bftengine/tests/bcstatetransfer/bcstatetransfer_tests.cpp @@ -33,8 +33,8 @@ #include "test_replica.hpp" #include "DBDataStore.hpp" #include "direct_kv_db_adapter.h" -#include "memorydb/client.h" -#include "storage/direct_kv_key_manipulator.h" +#include "storage/memorydb/client.hpp" +#include "storage/direct_kv_key_manipulator.hpp" #include "ReservedPagesMock.hpp" #include "EpochManager.hpp" #include "Messages.hpp" @@ -45,8 +45,8 @@ #include "messages/StateTransferMsg.hpp" #ifdef USE_ROCKSDB -#include "rocksdb/client.h" -#include "rocksdb/key_comparator.h" +#include "storage/rocksdb/client.hpp" +#include "storage/rocksdb/key_comparator.hpp" using concord::storage::rocksdb::Client; using concord::storage::rocksdb::KeyComparator; #endif diff --git a/bftengine/tests/metadataStorage/metadataStorage_test.cpp b/bftengine/tests/metadataStorage/metadataStorage_test.cpp index d7025d9072..41052f3148 100644 --- a/bftengine/tests/metadataStorage/metadataStorage_test.cpp +++ b/bftengine/tests/metadataStorage/metadataStorage_test.cpp @@ -7,11 +7,11 @@ #include "log/logger.hpp" #include "gtest/gtest.h" -#include "rocksdb/key_comparator.h" -#include "rocksdb/client.h" +#include "storage/rocksdb/key_comparator.hpp" +#include "storage/rocksdb/client.hpp" #include "DbMetadataStorage.hpp" #include "direct_kv_db_adapter.h" -#include "storage/direct_kv_key_manipulator.h" +#include "storage/direct_kv_key_manipulator.hpp" #include diff --git a/bftengine/tests/s3/metrics_test.cpp b/bftengine/tests/s3/metrics_test.cpp index 34aae0b65f..986f9a0fc8 100644 --- a/bftengine/tests/s3/metrics_test.cpp +++ b/bftengine/tests/s3/metrics_test.cpp @@ -1,5 +1,5 @@ #include "gtest/gtest.h" -#include "s3/s3_metrics.hpp" +#include "storage/s3/s3_metrics.hpp" #include "direct_kv_storage_factory.h" #include "direct_kv_db_adapter.h" diff --git a/examples/replica/main.cpp b/examples/replica/main.cpp index b6dab57fbc..8c17e654f3 100644 --- a/examples/replica/main.cpp +++ b/examples/replica/main.cpp @@ -26,8 +26,8 @@ #include "util/Metrics.hpp" #ifdef USE_ROCKSDB -#include "rocksdb/client.h" -#include "rocksdb/key_comparator.h" +#include "storage/rocksdb/client.hpp" +#include "storage/rocksdb/key_comparator.hpp" #endif #include diff --git a/examples/replica/src/SetupReplica.cpp b/examples/replica/src/SetupReplica.cpp index 1833a29e43..045e3a0a10 100644 --- a/examples/replica/src/SetupReplica.cpp +++ b/examples/replica/src/SetupReplica.cpp @@ -17,7 +17,7 @@ #include "SetupReplica.hpp" #include "common.hpp" -#include "memorydb/client.h" +#include "storage/memorydb/client.hpp" #include "secrets/secrets_manager_plain.h" #include "secrets/secrets_manager_enc.h" #include "direct_kv_storage_factory.h" diff --git a/kvbc/benchmark/kvbcbench/main.cpp b/kvbc/benchmark/kvbcbench/main.cpp index 21d9e672dc..3fa50a2d79 100644 --- a/kvbc/benchmark/kvbcbench/main.cpp +++ b/kvbc/benchmark/kvbcbench/main.cpp @@ -34,7 +34,7 @@ #include "categorized_kvbc_msgs.cmf.hpp" #include "kvbc_adapter/replica_adapter.hpp" #include "performance_handler.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "diagnostics.hpp" #include "diagnostics_server.hpp" #include "input.h" diff --git a/kvbc/benchmark/sparse_merkle_benchmark.cpp b/kvbc/benchmark/sparse_merkle_benchmark.cpp index 17f51ce1bd..fc385243bd 100644 --- a/kvbc/benchmark/sparse_merkle_benchmark.cpp +++ b/kvbc/benchmark/sparse_merkle_benchmark.cpp @@ -17,7 +17,7 @@ #include "util/endianness.hpp" #include "util/Handoff.hpp" -#include "memorydb/client.h" +#include "storage/memorydb/client.hpp" #include "merkle_tree_db_adapter.h" #include "merkle_tree_key_manipulator.h" #include "merkle_tree_serialization.h" diff --git a/kvbc/benchmark/state_snapshot_benchmarks/hash_state_benchmark.cpp b/kvbc/benchmark/state_snapshot_benchmarks/hash_state_benchmark.cpp index a68170f008..8676d58854 100644 --- a/kvbc/benchmark/state_snapshot_benchmarks/hash_state_benchmark.cpp +++ b/kvbc/benchmark/state_snapshot_benchmarks/hash_state_benchmark.cpp @@ -17,7 +17,7 @@ #include "categorization/details.h" #include "util/hex_tools.hpp" #include "kv_types.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "util/thread_pool.hpp" #include "multi_get_batch.hpp" diff --git a/kvbc/benchmark/state_snapshot_benchmarks/multi_get_batch.hpp b/kvbc/benchmark/state_snapshot_benchmarks/multi_get_batch.hpp index f37d682f3b..a085a931a8 100644 --- a/kvbc/benchmark/state_snapshot_benchmarks/multi_get_batch.hpp +++ b/kvbc/benchmark/state_snapshot_benchmarks/multi_get_batch.hpp @@ -15,7 +15,7 @@ #include "util/assertUtils.hpp" #include "categorized_kvbc_msgs.cmf.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include #include diff --git a/kvbc/include/KVBCInterfaces.h b/kvbc/include/KVBCInterfaces.h index f67bf934b5..29c8aeb830 100644 --- a/kvbc/include/KVBCInterfaces.h +++ b/kvbc/include/KVBCInterfaces.h @@ -17,7 +17,7 @@ #include "util/sliver.hpp" #include "communication/ICommunication.hpp" #include "util/Metrics.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include "db_interfaces.h" #include "bftengine/Replica.hpp" #include "kv_types.hpp" diff --git a/kvbc/include/Replica.h b/kvbc/include/Replica.h index 8e9d105a0e..f131fca136 100644 --- a/kvbc/include/Replica.h +++ b/kvbc/include/Replica.h @@ -23,7 +23,7 @@ #include "replica_state_sync_imp.hpp" #include "db_adapter_interface.h" #include "db_interfaces.h" -#include "memorydb/client.h" +#include "storage/memorydb/client.hpp" #include "bftengine/DbMetadataStorage.hpp" #include "storage_factory_interface.h" #include "ControlStateManager.hpp" diff --git a/kvbc/include/categorization/block_merkle_category.h b/kvbc/include/categorization/block_merkle_category.h index b079abc732..950a68e9e1 100644 --- a/kvbc/include/categorization/block_merkle_category.h +++ b/kvbc/include/categorization/block_merkle_category.h @@ -16,7 +16,7 @@ #ifdef USE_ROCKSDB #include "log/logger.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "sparse_merkle/tree.h" #include "base_types.h" diff --git a/kvbc/include/categorization/details.h b/kvbc/include/categorization/details.h index f45f16510f..aca002ec41 100644 --- a/kvbc/include/categorization/details.h +++ b/kvbc/include/categorization/details.h @@ -15,7 +15,7 @@ #include "base_types.h" #include "categorized_kvbc_msgs.cmf.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include #include diff --git a/kvbc/include/categorization/immutable_kv_category.h b/kvbc/include/categorization/immutable_kv_category.h index 7198b66989..e6634fb2ea 100644 --- a/kvbc/include/categorization/immutable_kv_category.h +++ b/kvbc/include/categorization/immutable_kv_category.h @@ -14,7 +14,7 @@ #pragma once #include "kv_types.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "base_types.h" #include "categorized_kvbc_msgs.cmf.hpp" diff --git a/kvbc/include/categorization/kv_blockchain.h b/kvbc/include/categorization/kv_blockchain.h index 2bd03bba3d..d85ea0f616 100644 --- a/kvbc/include/categorization/kv_blockchain.h +++ b/kvbc/include/categorization/kv_blockchain.h @@ -15,7 +15,7 @@ #include "updates.h" #include "blockchain_misc.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "blocks.h" #include "blockchain.h" #include "immutable_kv_category.h" diff --git a/kvbc/include/categorization/versioned_kv_category.h b/kvbc/include/categorization/versioned_kv_category.h index 0bc99d6c95..68992beee5 100644 --- a/kvbc/include/categorization/versioned_kv_category.h +++ b/kvbc/include/categorization/versioned_kv_category.h @@ -14,7 +14,7 @@ #pragma once #include "kv_types.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "base_types.h" #include "categorized_kvbc_msgs.cmf.hpp" diff --git a/kvbc/include/direct_kv_db_adapter.h b/kvbc/include/direct_kv_db_adapter.h index 0b8bfa5f1f..a79c0aad7f 100644 --- a/kvbc/include/direct_kv_db_adapter.h +++ b/kvbc/include/direct_kv_db_adapter.h @@ -7,8 +7,8 @@ #include "db_adapter_interface.h" #include "kv_types.hpp" -#include "storage/db_interface.h" -#include "storage/direct_kv_key_manipulator.h" +#include "storage/db_interface.hpp" +#include "storage/direct_kv_key_manipulator.hpp" #include "PerformanceManager.hpp" #include diff --git a/kvbc/include/direct_kv_storage_factory.h b/kvbc/include/direct_kv_storage_factory.h index 2be8398089..045f9993be 100644 --- a/kvbc/include/direct_kv_storage_factory.h +++ b/kvbc/include/direct_kv_storage_factory.h @@ -16,7 +16,7 @@ #include "PerformanceManager.hpp" #ifdef USE_S3_OBJECT_STORE -#include "s3/client.hpp" +#include "storage/s3/client.hpp" #endif #include diff --git a/kvbc/include/kvbc_adapter/common/state_snapshot_adapter.hpp b/kvbc/include/kvbc_adapter/common/state_snapshot_adapter.hpp index 16065a44b8..b84c23505f 100644 --- a/kvbc/include/kvbc_adapter/common/state_snapshot_adapter.hpp +++ b/kvbc/include/kvbc_adapter/common/state_snapshot_adapter.hpp @@ -20,7 +20,7 @@ #include "categorized_kvbc_msgs.cmf.hpp" #include "state_snapshot_interface.hpp" #include "categorization/kv_blockchain.h" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" namespace concord::kvbc::adapter::common::statesnapshot { class KVBCStateSnapshot : public concord::kvbc::IKVBCStateSnapshot { diff --git a/kvbc/include/kvbc_adapter/replica_adapter.hpp b/kvbc/include/kvbc_adapter/replica_adapter.hpp index ee95dfc6c6..7d6ea4f469 100644 --- a/kvbc/include/kvbc_adapter/replica_adapter.hpp +++ b/kvbc/include/kvbc_adapter/replica_adapter.hpp @@ -21,7 +21,7 @@ #include "util/assertUtils.hpp" #include "kv_types.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "blockchain_misc.hpp" #include "ReplicaConfig.hpp" #include "db_interfaces.h" @@ -30,7 +30,7 @@ #include "replica_adapter_auxilliary_types.hpp" #include "categorization/kv_blockchain.h" #include "v4blockchain/v4_blockchain.h" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" namespace concord::kvbc::adapter { class ReplicaBlockchain : public IBlocksDeleter, diff --git a/kvbc/include/merkle_tree_db_adapter.h b/kvbc/include/merkle_tree_db_adapter.h index 78d3b8524f..daa0dc7317 100644 --- a/kvbc/include/merkle_tree_db_adapter.h +++ b/kvbc/include/merkle_tree_db_adapter.h @@ -19,7 +19,7 @@ #include "merkle_tree_block.h" #include "util/sliver.hpp" #include "sparse_merkle/tree.h" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include "util/Statistics.hpp" #include "PerformanceManager.hpp" diff --git a/kvbc/include/merkle_tree_key_manipulator.h b/kvbc/include/merkle_tree_key_manipulator.h index db64586446..63bc1bd4f2 100644 --- a/kvbc/include/merkle_tree_key_manipulator.h +++ b/kvbc/include/merkle_tree_key_manipulator.h @@ -18,7 +18,7 @@ #include "util/sliver.hpp" #include "sparse_merkle/base_types.h" #include "sparse_merkle/keys.h" -#include "storage/db_types.h" +#include "storage/db_types.hpp" namespace concord::kvbc::v2MerkleTree::detail { diff --git a/kvbc/include/merkle_tree_serialization.h b/kvbc/include/merkle_tree_serialization.h index fce1e5fd6d..8d4c9c8ea8 100644 --- a/kvbc/include/merkle_tree_serialization.h +++ b/kvbc/include/merkle_tree_serialization.h @@ -21,7 +21,7 @@ #include "sparse_merkle/base_types.h" #include "sparse_merkle/internal_node.h" #include "sparse_merkle/keys.h" -#include "storage/db_types.h" +#include "storage/db_types.hpp" #include "util/string.hpp" #include diff --git a/kvbc/include/migrations/block_merkle_latest_ver_cf_migration.h b/kvbc/include/migrations/block_merkle_latest_ver_cf_migration.h index bd5693ce83..677f2d9c0b 100644 --- a/kvbc/include/migrations/block_merkle_latest_ver_cf_migration.h +++ b/kvbc/include/migrations/block_merkle_latest_ver_cf_migration.h @@ -12,7 +12,7 @@ #pragma once -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include diff --git a/kvbc/include/replica_state_sync.h b/kvbc/include/replica_state_sync.h index f654000b6c..c20f0ca9f7 100644 --- a/kvbc/include/replica_state_sync.h +++ b/kvbc/include/replica_state_sync.h @@ -15,7 +15,7 @@ #pragma once -#include "storage/db_types.h" +#include "storage/db_types.hpp" #include "db_adapter_interface.h" #include "kvbc_adapter/replica_adapter.hpp" #include "PersistentStorage.hpp" diff --git a/kvbc/include/storage_factory_interface.h b/kvbc/include/storage_factory_interface.h index 3d042207f6..79f19daf4f 100644 --- a/kvbc/include/storage_factory_interface.h +++ b/kvbc/include/storage_factory_interface.h @@ -13,8 +13,8 @@ #pragma once #include "db_adapter_interface.h" -#include "storage/db_interface.h" -#include "storage/key_manipulator_interface.h" +#include "storage/db_interface.hpp" +#include "storage/key_manipulator_interface.hpp" #include diff --git a/kvbc/include/v4blockchain/detail/blockchain.h b/kvbc/include/v4blockchain/detail/blockchain.h index 93aafc8de6..5937c05dfe 100644 --- a/kvbc/include/v4blockchain/detail/blockchain.h +++ b/kvbc/include/v4blockchain/detail/blockchain.h @@ -19,7 +19,7 @@ #include #include #include -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include #include "kv_types.hpp" #include "v4blockchain/detail/blocks.h" diff --git a/kvbc/include/v4blockchain/detail/categories.h b/kvbc/include/v4blockchain/detail/categories.h index 5aea83dee1..7b350b26ce 100644 --- a/kvbc/include/v4blockchain/detail/categories.h +++ b/kvbc/include/v4blockchain/detail/categories.h @@ -15,7 +15,7 @@ #include #include #include -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include #include "categorization/base_types.h" diff --git a/kvbc/include/v4blockchain/detail/detail.h b/kvbc/include/v4blockchain/detail/detail.h index a0d908dff9..a66cd935e6 100644 --- a/kvbc/include/v4blockchain/detail/detail.h +++ b/kvbc/include/v4blockchain/detail/detail.h @@ -14,7 +14,7 @@ #pragma once #include #include "kvbc_key_types.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "blockchain_misc.hpp" namespace concord::kvbc::v4blockchain::detail { diff --git a/kvbc/include/v4blockchain/detail/latest_keys.h b/kvbc/include/v4blockchain/detail/latest_keys.h index 8dc1654314..f20b613670 100644 --- a/kvbc/include/v4blockchain/detail/latest_keys.h +++ b/kvbc/include/v4blockchain/detail/latest_keys.h @@ -13,7 +13,7 @@ #pragma once -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include #include #include "categorization/updates.h" @@ -21,7 +21,7 @@ #include #include "util/endianness.hpp" #include "util/hex_tools.hpp" -#include "rocksdb/snapshot.h" +#include namespace concord::kvbc::v4blockchain::detail { diff --git a/kvbc/include/v4blockchain/detail/st_chain.h b/kvbc/include/v4blockchain/detail/st_chain.h index bcfb1703fc..62b3877102 100644 --- a/kvbc/include/v4blockchain/detail/st_chain.h +++ b/kvbc/include/v4blockchain/detail/st_chain.h @@ -14,7 +14,7 @@ #pragma once #include -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "kv_types.hpp" #include "v4blockchain/detail/blocks.h" #include "v4blockchain/detail/blockchain.h" diff --git a/kvbc/include/v4blockchain/v4_blockchain.h b/kvbc/include/v4blockchain/v4_blockchain.h index e9073d6c3c..34fd78b73c 100644 --- a/kvbc/include/v4blockchain/v4_blockchain.h +++ b/kvbc/include/v4blockchain/v4_blockchain.h @@ -14,7 +14,7 @@ #pragma once #include "categorization/updates.h" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "v4blockchain/detail/st_chain.h" #include "v4blockchain/detail/latest_keys.h" #include "v4blockchain/detail/blockchain.h" diff --git a/kvbc/src/Replica.cpp b/kvbc/src/Replica.cpp index 2dff5b6df8..ff62ffe6d6 100644 --- a/kvbc/src/Replica.cpp +++ b/kvbc/src/Replica.cpp @@ -18,7 +18,7 @@ #include "util/sliver.hpp" #include "metadata_block_id.h" #include "bftengine/DbMetadataStorage.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "categorization/blocks.h" #include "pruning_handler.hpp" #include "IRequestHandler.hpp" diff --git a/kvbc/src/blockchain_misc.cpp b/kvbc/src/blockchain_misc.cpp index f2c64d1fd3..6e744e8519 100644 --- a/kvbc/src/blockchain_misc.cpp +++ b/kvbc/src/blockchain_misc.cpp @@ -11,7 +11,7 @@ // file. #include "blockchain_misc.hpp" -#include "storage/merkle_tree_key_manipulator.h" +#include "storage/merkle_tree_key_manipulator.hpp" #include "categorization/blocks.h" namespace concord::kvbc { diff --git a/kvbc/src/categorization/immutable_kv_category.cpp b/kvbc/src/categorization/immutable_kv_category.cpp index 76607a90e0..3a303674e1 100644 --- a/kvbc/src/categorization/immutable_kv_category.cpp +++ b/kvbc/src/categorization/immutable_kv_category.cpp @@ -16,7 +16,7 @@ #include "util/assertUtils.hpp" #include "categorization/column_families.h" #include "categorization/details.h" -#include "rocksdb/details.h" +#include "storage/rocksdb/details.hpp" #include #include diff --git a/kvbc/src/categorization/versioned_kv_category.cpp b/kvbc/src/categorization/versioned_kv_category.cpp index 3fac0c9cf6..d9b6ce5562 100644 --- a/kvbc/src/categorization/versioned_kv_category.cpp +++ b/kvbc/src/categorization/versioned_kv_category.cpp @@ -17,7 +17,7 @@ #include "categorization/blockchain.h" #include "categorization/column_families.h" #include "categorization/details.h" -#include "rocksdb/details.h" +#include "storage/rocksdb/details.hpp" #include #include diff --git a/kvbc/src/direct_kv_storage_factory.cpp b/kvbc/src/direct_kv_storage_factory.cpp index 456ce42f29..4e7337adbe 100644 --- a/kvbc/src/direct_kv_storage_factory.cpp +++ b/kvbc/src/direct_kv_storage_factory.cpp @@ -13,15 +13,15 @@ #include "direct_kv_storage_factory.h" #include "direct_kv_db_adapter.h" -#include "memorydb/client.h" -#include "memorydb/key_comparator.h" -#include "storage/direct_kv_key_manipulator.h" -#include "rocksdb/client.h" -#include "rocksdb/key_comparator.h" +#include "storage/memorydb/client.hpp" +#include "storage/memorydb/key_comparator.hpp" +#include "storage/direct_kv_key_manipulator.hpp" +#include "storage/rocksdb/client.hpp" +#include "storage/rocksdb/key_comparator.hpp" #include "ReplicaConfig.hpp" #ifdef USE_S3_OBJECT_STORE -#include "s3/key_manipulator.h" -#include "s3/client.hpp" +#include "storage/s3/key_manipulator.hpp" +#include "storage/s3/client.hpp" #endif #include diff --git a/kvbc/src/merkle_tree_storage_factory.cpp b/kvbc/src/merkle_tree_storage_factory.cpp index 3c03b6649f..3a57bb13be 100644 --- a/kvbc/src/merkle_tree_storage_factory.cpp +++ b/kvbc/src/merkle_tree_storage_factory.cpp @@ -13,10 +13,10 @@ #include "merkle_tree_storage_factory.h" #include "merkle_tree_db_adapter.h" -#include "memorydb/client.h" -#include "storage/merkle_tree_key_manipulator.h" -#include "rocksdb/client.h" -#include "rocksdb/native_client.h" +#include "storage/memorydb/client.hpp" +#include "storage/merkle_tree_key_manipulator.hpp" +#include "storage/rocksdb/client.hpp" +#include "storage/rocksdb/native_client.hpp" #include "v4blockchain/detail/column_families.h" #include "v4blockchain/detail/latest_keys.h" diff --git a/kvbc/src/migrations/block_merkle_latest_ver_cf_migration.cpp b/kvbc/src/migrations/block_merkle_latest_ver_cf_migration.cpp index 2f591c62a0..e99de2b148 100644 --- a/kvbc/src/migrations/block_merkle_latest_ver_cf_migration.cpp +++ b/kvbc/src/migrations/block_merkle_latest_ver_cf_migration.cpp @@ -19,7 +19,7 @@ #include "categorization/db_categories.h" #include "categorization/details.h" #include "kv_types.hpp" -#include "storage/db_types.h" +#include "storage/db_types.hpp" #include "util/string.hpp" #include diff --git a/kvbc/src/reconfiguration_kvbc_handler.cpp b/kvbc/src/reconfiguration_kvbc_handler.cpp index 7e2a284cd8..c9a15a8365 100644 --- a/kvbc/src/reconfiguration_kvbc_handler.cpp +++ b/kvbc/src/reconfiguration_kvbc_handler.cpp @@ -21,7 +21,7 @@ #include "kvbc_app_filter/kvbc_key_types.h" #include "concord.cmf.hpp" #include "secrets/secrets_manager_plain.h" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "kvbc_adapter/idempotent_reader.h" #include "categorization/db_categories.h" #include "categorization/details.h" diff --git a/kvbc/src/v4blockchain/detail/latest_keys.cpp b/kvbc/src/v4blockchain/detail/latest_keys.cpp index e6597033a6..02926d5217 100644 --- a/kvbc/src/v4blockchain/detail/latest_keys.cpp +++ b/kvbc/src/v4blockchain/detail/latest_keys.cpp @@ -16,7 +16,7 @@ #include "v4blockchain/detail/column_families.h" #include "log/logger.hpp" #include "v4blockchain/detail/blockchain.h" -#include "rocksdb/details.h" +#include "storage/rocksdb/details.hpp" using namespace concord::kvbc; namespace concord::kvbc::v4blockchain::detail { diff --git a/kvbc/test/CMakeLists.txt b/kvbc/test/CMakeLists.txt index 9485068cda..4a3ebcf2f6 100644 --- a/kvbc/test/CMakeLists.txt +++ b/kvbc/test/CMakeLists.txt @@ -20,7 +20,8 @@ target_link_libraries(kvbc_filter_test kvbc concord-kvbc-proto corebft - logging) + logging + concordbft_storage_test_headers) add_executable(order_test order_test.cpp ) add_test(order_test order_test) @@ -186,6 +187,7 @@ if (BUILD_ROCKSDB_STORAGE) corebft kvbc stdc++fs + concordbft_storage_test_headers ) add_executable(block_merkle_category_unit_test categorization/block_merkle_category_unit_test.cpp ) @@ -196,6 +198,7 @@ if (BUILD_ROCKSDB_STORAGE) util kvbc stdc++fs + concordbft_storage_test_headers ) add_executable(versioned_kv_category_unit_test categorization/versioned_kv_category_unit_test.cpp ) @@ -219,6 +222,7 @@ if (BUILD_ROCKSDB_STORAGE) corebft kvbc stdc++fs + concordbft_storage_test_headers ) add_executable(v4_blocks_unit_test @@ -243,6 +247,7 @@ if (BUILD_ROCKSDB_STORAGE) corebft kvbc stdc++fs + concordbft_storage_test_headers ) add_executable(v4_categories_unit_test @@ -292,6 +297,7 @@ if (BUILD_ROCKSDB_STORAGE) corebft kvbc stdc++fs + concordbft_storage_test_headers ) add_executable(common_state_snapshot_adapter_test @@ -304,6 +310,7 @@ if (BUILD_ROCKSDB_STORAGE) corebft kvbc stdc++fs + concordbft_storage_test_headers ) @@ -313,7 +320,8 @@ if (BUILD_ROCKSDB_STORAGE) GTest::GTest corebft kvbc - stdc++fs) + stdc++fs + concordbft_storage_test_headers) add_executable(replica_state_sync_test replica_state_sync_test.cpp) add_test(replica_state_sync_test_v4 replica_state_sync_test v4) @@ -353,4 +361,4 @@ if (BUILD_ROCKSDB_STORAGE) # stdc++fs # execution_data_cmf # ) -endif (BUILD_ROCKSDB_STORAGE) +endif (BUILD_ROCKSDB_STORAGE) \ No newline at end of file diff --git a/kvbc/test/categorization/block_merkle_category_unit_test.cpp b/kvbc/test/categorization/block_merkle_category_unit_test.cpp index 640c7d2133..7d83464c3b 100644 --- a/kvbc/test/categorization/block_merkle_category_unit_test.cpp +++ b/kvbc/test/categorization/block_merkle_category_unit_test.cpp @@ -16,8 +16,8 @@ #include "categorization/block_merkle_category.h" #include "kv_types.hpp" -#include "rocksdb/native_client.h" -#include "storage/test/storage_test_common.h" +#include "storage/rocksdb/native_client.hpp" +#include "storage/test/storage_test_common.hpp" #include "categorization/column_families.h" #include diff --git a/kvbc/test/categorization/blockchain_test.cpp b/kvbc/test/categorization/blockchain_test.cpp index 2b9b3903c6..e07f6c5673 100644 --- a/kvbc/test/categorization/blockchain_test.cpp +++ b/kvbc/test/categorization/blockchain_test.cpp @@ -20,7 +20,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" using concord::storage::rocksdb::NativeClient; using namespace concord::kvbc::categorization; diff --git a/kvbc/test/categorization/blocks_test.cpp b/kvbc/test/categorization/blocks_test.cpp index 5e8bc6c76c..10bef6b958 100644 --- a/kvbc/test/categorization/blocks_test.cpp +++ b/kvbc/test/categorization/blocks_test.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" using concord::storage::rocksdb::NativeClient; using namespace concord::kvbc::categorization; diff --git a/kvbc/test/categorization/immutable_kv_category_unit_test.cpp b/kvbc/test/categorization/immutable_kv_category_unit_test.cpp index 1cfca1d9ef..df4f57ee3e 100644 --- a/kvbc/test/categorization/immutable_kv_category_unit_test.cpp +++ b/kvbc/test/categorization/immutable_kv_category_unit_test.cpp @@ -19,8 +19,8 @@ #include "categorization/details.h" #include "categorization/immutable_kv_category.h" #include "kv_types.hpp" -#include "rocksdb/native_client.h" -#include "storage/test/storage_test_common.h" +#include "storage/rocksdb/native_client.hpp" +#include "storage/test/storage_test_common.hpp" #include #include diff --git a/kvbc/test/categorization/kv_blockchain_test.cpp b/kvbc/test/categorization/kv_blockchain_test.cpp index 747a95f301..4ef413beb2 100644 --- a/kvbc/test/categorization/kv_blockchain_test.cpp +++ b/kvbc/test/categorization/kv_blockchain_test.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "util/endianness.hpp" using concord::storage::rocksdb::NativeClient; diff --git a/kvbc/test/categorization/versioned_kv_category_unit_test.cpp b/kvbc/test/categorization/versioned_kv_category_unit_test.cpp index 2b4e11e6aa..6a595ff8b6 100644 --- a/kvbc/test/categorization/versioned_kv_category_unit_test.cpp +++ b/kvbc/test/categorization/versioned_kv_category_unit_test.cpp @@ -19,8 +19,8 @@ #include "categorization/details.h" #include "categorization/versioned_kv_category.h" #include "kv_types.hpp" -#include "rocksdb/native_client.h" -#include "storage/test/storage_test_common.h" +#include "storage/rocksdb/native_client.hpp" +#include "storage/test/storage_test_common.hpp" #include #include diff --git a/kvbc/test/kvbc_adapter/common/state_snapshot_adapter_test.cpp b/kvbc/test/kvbc_adapter/common/state_snapshot_adapter_test.cpp index 28429846d8..833b346af7 100644 --- a/kvbc/test/kvbc_adapter/common/state_snapshot_adapter_test.cpp +++ b/kvbc/test/kvbc_adapter/common/state_snapshot_adapter_test.cpp @@ -22,7 +22,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "kvbc_adapter/common/state_snapshot_adapter.hpp" using concord::storage::rocksdb::NativeClient; diff --git a/kvbc/test/kvbc_adapter/v4blockchain/app_state_adapter_test.cpp b/kvbc/test/kvbc_adapter/v4blockchain/app_state_adapter_test.cpp index 619bac4c05..9c4299aa73 100644 --- a/kvbc/test/kvbc_adapter/v4blockchain/app_state_adapter_test.cpp +++ b/kvbc/test/kvbc_adapter/v4blockchain/app_state_adapter_test.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "util/endianness.hpp" #include "v4blockchain/detail/st_chain.h" #include "kvbc_adapter/v4blockchain/app_state_adapter.hpp" diff --git a/kvbc/test/kvbc_app_filter/kvbc_filter_test.cpp b/kvbc/test/kvbc_app_filter/kvbc_filter_test.cpp index 3e37e4b6ff..a515d13241 100644 --- a/kvbc/test/kvbc_app_filter/kvbc_filter_test.cpp +++ b/kvbc/test/kvbc_app_filter/kvbc_filter_test.cpp @@ -24,14 +24,14 @@ #include "log/logger.hpp" #include "kv_types.hpp" -#include "memorydb/client.h" -#include "memorydb/key_comparator.h" +#include "storage/memorydb/client.hpp" +#include "storage/memorydb/key_comparator.hpp" #include "crypto/openssl/crypto.hpp" #include "util/status.hpp" #include "concord_kvbc.pb.h" #include "kvbc_app_filter/kvbc_app_filter.h" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" using com::vmware::concord::kvbc::ValueWithTrids; diff --git a/kvbc/test/kvbc_dbadapter_test.cpp b/kvbc/test/kvbc_dbadapter_test.cpp index f322b2a36d..105de15522 100644 --- a/kvbc/test/kvbc_dbadapter_test.cpp +++ b/kvbc/test/kvbc_dbadapter_test.cpp @@ -11,8 +11,8 @@ #include "direct_kv_block.h" #ifdef USE_ROCKSDB -#include "rocksdb/client.h" -#include "rocksdb/key_comparator.h" +#include "storage/rocksdb/client.hpp" +#include "storage/rocksdb/key_comparator.hpp" #endif using namespace std; diff --git a/kvbc/test/migrations/block_merkle_latest_ver_cf_migration_test.cpp b/kvbc/test/migrations/block_merkle_latest_ver_cf_migration_test.cpp index 4ffb02ae75..7bf9deb9f4 100644 --- a/kvbc/test/migrations/block_merkle_latest_ver_cf_migration_test.cpp +++ b/kvbc/test/migrations/block_merkle_latest_ver_cf_migration_test.cpp @@ -19,7 +19,7 @@ #include "categorization/db_categories.h" #include "categorization/kv_blockchain.h" #include "util/hex_tools.hpp" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "util/filesystem.hpp" diff --git a/kvbc/test/migrations/v4_migration_test.cpp b/kvbc/test/migrations/v4_migration_test.cpp index 287a3ea3b6..b74113e215 100644 --- a/kvbc/test/migrations/v4_migration_test.cpp +++ b/kvbc/test/migrations/v4_migration_test.cpp @@ -30,7 +30,7 @@ #include "event_group_msgs.cmf.hpp" #include "kvbc_app_filter/kvbc_key_types.h" #include "concord_kvbc.pb.h" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "tools/db_editor/include/kv_blockchain_db_editor.hpp" #include "tools/migrations/v4migration_tool/include/blockchain_adapter.hpp" #include "tools/migrations/v4migration_tool/include/migration_bookeeper.hpp" diff --git a/kvbc/test/multiIO_test.cpp b/kvbc/test/multiIO_test.cpp index 7a1ed2408e..513f38a01c 100644 --- a/kvbc/test/multiIO_test.cpp +++ b/kvbc/test/multiIO_test.cpp @@ -7,8 +7,8 @@ #include "log/logger.hpp" #include "gtest/gtest.h" -#include "rocksdb/key_comparator.h" -#include "rocksdb/client.h" +#include "storage/rocksdb/key_comparator.hpp" +#include "storage/rocksdb/client.hpp" #include "kv_types.hpp" #include "direct_kv_db_adapter.h" diff --git a/kvbc/test/pruning_test.cpp b/kvbc/test/pruning_test.cpp index 1a86fc58c3..8775405067 100644 --- a/kvbc/test/pruning_test.cpp +++ b/kvbc/test/pruning_test.cpp @@ -19,7 +19,7 @@ #include "util/endianness.hpp" #include "pruning_handler.hpp" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include #include diff --git a/kvbc/test/replica_state_sync_test.cpp b/kvbc/test/replica_state_sync_test.cpp index d7ccd0f0df..793ed9bc06 100644 --- a/kvbc/test/replica_state_sync_test.cpp +++ b/kvbc/test/replica_state_sync_test.cpp @@ -19,9 +19,9 @@ #include "metadata_block_id.h" #include "PersistentStorageImp.hpp" #include "replica_state_sync_imp.hpp" -#include "rocksdb/native_client.h" -#include "storage/merkle_tree_key_manipulator.h" -#include "storage/test/storage_test_common.h" +#include "storage/rocksdb/native_client.hpp" +#include "storage/merkle_tree_key_manipulator.hpp" +#include "storage/test/storage_test_common.hpp" #include #include diff --git a/kvbc/test/sparse_merkle_storage/db_adapter_property_test.cpp b/kvbc/test/sparse_merkle_storage/db_adapter_property_test.cpp index 6cfd19f7c4..d3fbff5d6b 100644 --- a/kvbc/test/sparse_merkle_storage/db_adapter_property_test.cpp +++ b/kvbc/test/sparse_merkle_storage/db_adapter_property_test.cpp @@ -11,7 +11,7 @@ #include "merkle_tree_db_adapter.h" #include "util/sliver.hpp" #include "sparse_merkle/base_types.h" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include #include diff --git a/kvbc/test/sparse_merkle_storage/db_adapter_unit_test.cpp b/kvbc/test/sparse_merkle_storage/db_adapter_unit_test.cpp index b0c86a7a93..44de5deba8 100644 --- a/kvbc/test/sparse_merkle_storage/db_adapter_unit_test.cpp +++ b/kvbc/test/sparse_merkle_storage/db_adapter_unit_test.cpp @@ -9,10 +9,10 @@ #include "merkle_tree_block.h" #include "merkle_tree_db_adapter.h" #include "merkle_tree_key_manipulator.h" -#include "memorydb/client.h" -#include "rocksdb/client.h" +#include "storage/memorydb/client.hpp" +#include "storage/rocksdb/client.hpp" #include "sparse_merkle/base_types.h" -#include "storage/db_types.h" +#include "storage/db_types.hpp" #include #include @@ -690,7 +690,7 @@ TEST_P(db_adapter_custom_blockchain, get_key_by_ver_1_key_empty_blocks) { // Test the getKeyByReadVersion() method with multiple keys, including ones that are ordered before and after the keys // in the system. -// Note: Leaf keys are ordered first on the key hash and then on the version. See db_types.h and +// Note: Leaf keys are ordered first on the key hash and then on the version. See db_types.hpp and // merkle_tree_serialization.h for more information. TEST_P(db_adapter_custom_blockchain, get_key_by_ver_multiple_keys) { const auto key = defaultSliver; diff --git a/kvbc/test/sparse_merkle_storage/db_editor_tests_base.h b/kvbc/test/sparse_merkle_storage/db_editor_tests_base.h index dd068aad3e..287d5de3a7 100644 --- a/kvbc/test/sparse_merkle_storage/db_editor_tests_base.h +++ b/kvbc/test/sparse_merkle_storage/db_editor_tests_base.h @@ -22,8 +22,8 @@ #include "merkle_tree_db_adapter.h" #include "PersistentStorageImp.hpp" #include "util/sliver.hpp" -#include "storage/db_types.h" -#include "storage/merkle_tree_key_manipulator.h" +#include "storage/db_types.hpp" +#include "storage/merkle_tree_key_manipulator.hpp" #include "categorization/updates.h" namespace { diff --git a/kvbc/test/sparse_merkle_storage/kvbc_storage_test_common.h b/kvbc/test/sparse_merkle_storage/kvbc_storage_test_common.h index 2054ac83a4..b123729f2d 100644 --- a/kvbc/test/sparse_merkle_storage/kvbc_storage_test_common.h +++ b/kvbc/test/sparse_merkle_storage/kvbc_storage_test_common.h @@ -13,7 +13,7 @@ #pragma once -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "kv_types.hpp" #include "sparse_merkle/base_types.h" diff --git a/kvbc/test/sparse_merkle_storage/serialization_unit_test.cpp b/kvbc/test/sparse_merkle_storage/serialization_unit_test.cpp index 0a6828afc0..b613f95c1f 100644 --- a/kvbc/test/sparse_merkle_storage/serialization_unit_test.cpp +++ b/kvbc/test/sparse_merkle_storage/serialization_unit_test.cpp @@ -22,8 +22,7 @@ #include "merkle_tree_serialization.h" #include "util/sliver.hpp" #include "sparse_merkle/base_types.h" -#include "storage/merkle_tree_key_manipulator.h" - +#include "storage/merkle_tree_key_manipulator.hpp" #include #include diff --git a/kvbc/test/v4blockchain/blockchain_test.cpp b/kvbc/test/v4blockchain/blockchain_test.cpp index 459be6a9e3..5422dd0c4c 100644 --- a/kvbc/test/v4blockchain/blockchain_test.cpp +++ b/kvbc/test/v4blockchain/blockchain_test.cpp @@ -14,7 +14,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" #include "v4blockchain/detail/blockchain.h" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "v4blockchain/detail/column_families.h" #include diff --git a/kvbc/test/v4blockchain/blocks_test.cpp b/kvbc/test/v4blockchain/blocks_test.cpp index 403dc39c9a..46487899f0 100644 --- a/kvbc/test/v4blockchain/blocks_test.cpp +++ b/kvbc/test/v4blockchain/blocks_test.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" using namespace concord::kvbc; using namespace ::testing; diff --git a/kvbc/test/v4blockchain/categories_test.cpp b/kvbc/test/v4blockchain/categories_test.cpp index 54b9940d00..07d2648f84 100644 --- a/kvbc/test/v4blockchain/categories_test.cpp +++ b/kvbc/test/v4blockchain/categories_test.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "util/endianness.hpp" #include "v4blockchain/detail/column_families.h" #include "categorization/db_categories.h" diff --git a/kvbc/test/v4blockchain/st_chain_test.cpp b/kvbc/test/v4blockchain/st_chain_test.cpp index 5d98a8e234..4774b879b4 100644 --- a/kvbc/test/v4blockchain/st_chain_test.cpp +++ b/kvbc/test/v4blockchain/st_chain_test.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "util/endianness.hpp" #include "v4blockchain/detail/st_chain.h" diff --git a/kvbc/test/v4blockchain/v4_blockchain_test.cpp b/kvbc/test/v4blockchain/v4_blockchain_test.cpp index d7b324f24a..3018672908 100644 --- a/kvbc/test/v4blockchain/v4_blockchain_test.cpp +++ b/kvbc/test/v4blockchain/v4_blockchain_test.cpp @@ -23,7 +23,7 @@ #include #include #include "util/thread_pool.hpp" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "util/endianness.hpp" #include "v4blockchain/detail/column_families.h" #include "categorization/db_categories.h" diff --git a/kvbc/test/v4blockchain/v4_latest_keys_test.cpp b/kvbc/test/v4blockchain/v4_latest_keys_test.cpp index b68c07a4b7..4ce2684154 100644 --- a/kvbc/test/v4blockchain/v4_latest_keys_test.cpp +++ b/kvbc/test/v4blockchain/v4_latest_keys_test.cpp @@ -19,12 +19,12 @@ #include #include #include -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "util/endianness.hpp" #include "v4blockchain/detail/column_families.h" #include "categorization/db_categories.h" #include "categorized_kvbc_msgs.cmf.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" using concord::storage::rocksdb::NativeClient; using namespace concord::kvbc; diff --git a/kvbc/tools/db_editor/include/db_editor_common.hpp b/kvbc/tools/db_editor/include/db_editor_common.hpp index 4d966143b8..c315c3f79d 100644 --- a/kvbc/tools/db_editor/include/db_editor_common.hpp +++ b/kvbc/tools/db_editor/include/db_editor_common.hpp @@ -16,8 +16,8 @@ #include "util/json_output.hpp" #include "merkle_tree_block.h" -#include "storage/db_types.h" -#include "rocksdb/client.h" +#include "storage/db_types.hpp" +#include "storage/rocksdb/client.hpp" #include "util/filesystem.hpp" namespace concord::kvbc::tools::db_editor { diff --git a/kvbc/tools/db_editor/include/kv_blockchain_db_editor.hpp b/kvbc/tools/db_editor/include/kv_blockchain_db_editor.hpp index 753b278a2c..abfd8795f6 100644 --- a/kvbc/tools/db_editor/include/kv_blockchain_db_editor.hpp +++ b/kvbc/tools/db_editor/include/kv_blockchain_db_editor.hpp @@ -25,7 +25,7 @@ #include "db_interfaces.h" #include "kvbc_app_filter/kvbc_key_types.h" #include "categorization/db_categories.h" -#include "storage/merkle_tree_key_manipulator.h" +#include "storage/merkle_tree_key_manipulator.hpp" #include "bcstatetransfer/DBDataStore.hpp" #include "bcstatetransfer/SimpleBCStateTransfer.hpp" #include "bftengine/PersistentStorageImp.hpp" diff --git a/kvbc/tools/migrations/v4migration_tool/include/migration_bookeeper.hpp b/kvbc/tools/migrations/v4migration_tool/include/migration_bookeeper.hpp index d7093a19b7..70bb43d471 100644 --- a/kvbc/tools/migrations/v4migration_tool/include/migration_bookeeper.hpp +++ b/kvbc/tools/migrations/v4migration_tool/include/migration_bookeeper.hpp @@ -28,7 +28,7 @@ #include #include "log/logger.hpp" -#include "rocksdb/native_client.h" +#include "storage/rocksdb/native_client.hpp" #include "categorization/updates.h" #include "blockchain_adapter.hpp" #include "util/thread_pool.hpp" diff --git a/kvbc/tools/object_store_utility/integrity_checker.cpp b/kvbc/tools/object_store_utility/integrity_checker.cpp index 73f1453d18..d0749dd494 100644 --- a/kvbc/tools/object_store_utility/integrity_checker.cpp +++ b/kvbc/tools/object_store_utility/integrity_checker.cpp @@ -13,7 +13,7 @@ #include "integrity_checker.hpp" #include "util/string.hpp" -#include "s3/config_parser.hpp" +#include "storage/s3/config_parser.hpp" #include "bftengine/ReplicaConfig.hpp" #include "bftengine/ReplicasInfo.hpp" #include "bftengine/SigManager.hpp" diff --git a/kvbc/tools/object_store_utility/integrity_checker.hpp b/kvbc/tools/object_store_utility/integrity_checker.hpp index a0c8eacda7..e74303ab51 100644 --- a/kvbc/tools/object_store_utility/integrity_checker.hpp +++ b/kvbc/tools/object_store_utility/integrity_checker.hpp @@ -19,7 +19,7 @@ #include "log/logger.hpp" #include "util/filesystem.hpp" #include "kv_types.hpp" -#include "s3/client.hpp" +#include "storage/s3/client.hpp" #include "bftengine/PersistentStorage.hpp" #include "storage_factory_interface.h" #include "categorization/blocks.h" diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 94311d2f0d..ef5ba17acb 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -7,4 +7,6 @@ add_subdirectory(secrets) add_subdirectory(communication) add_subdirectory(reconfiguration) add_subdirectory(diagnostics) +add_subdirectory(storage) + diff --git a/libs/storage/CMakeLists.txt b/libs/storage/CMakeLists.txt new file mode 100644 index 0000000000..34a90b3796 --- /dev/null +++ b/libs/storage/CMakeLists.txt @@ -0,0 +1,67 @@ +project (libbftstorage LANGUAGES CXX) + +add_library(concordbft_storage STATIC src/memorydb_client.cpp + src/direct_kv_key_manipulator.cpp + src/merkle_tree_key_manipulator.cpp + src/s3/key_manipulator.cpp) + +target_include_directories(concordbft_storage PUBLIC .) + +if (USE_S3_OBJECT_STORE) + find_library(LIBS3 s3) + target_sources(concordbft_storage PRIVATE src/s3/client.cpp src/s3/config_parser.cpp) + target_link_libraries(concordbft_storage PRIVATE ${LIBS3}) +endif(USE_S3_OBJECT_STORE) + +if (BUILD_ROCKSDB_STORAGE) + find_library(ROCKSDB_LIBRARY rocksdb) + find_path(ROCKSDB_INCLUDE_DIR "rocksdb/utilities/transaction_db.h") + find_library(LIBBZ2 bz2) + find_library(LIBLZ4 lz4) + find_library(LIBZSTD zstd) + find_library(LIBZ z) + find_library(LIBSNAPPY snappy) + + #cmake_policy(SET CMP0076 NEW) for cmake 3.14 + target_sources(concordbft_storage PRIVATE src/rocksdb_client.cpp src/rocksdb_key_comparator.cpp) + target_compile_definitions(concordbft_storage PUBLIC USE_ROCKSDB=1 __BASE=1 SPARSE_STATE=1) + target_include_directories(concordbft_storage PUBLIC ${ROCKSDB_INCLUDE_DIR}) + target_link_libraries(concordbft_storage PRIVATE ${ROCKSDB_LIBRARY} ${LIBBZ2} ${LIBLZ4} ${LIBZSTD} ${LIBZ} ${LIBSNAPPY} ${CMAKE_DL_LIBS} util) + +endif(BUILD_ROCKSDB_STORAGE) + +target_sources(concordbft_storage PUBLIC FILE_SET storage_pub_hdrs + TYPE HEADERS + FILES + memorydb/transaction.hpp + memorydb/client.hpp + memorydb/key_comparator.hpp + rocksdb/rocksdb_exception.hpp + rocksdb/native_iterator.hpp + rocksdb/transaction.hpp + rocksdb/client.hpp + rocksdb/native_write_batch.hpp + rocksdb/key_comparator.hpp + rocksdb/native_write_batch.ipp + rocksdb/native_client.ipp + rocksdb/details.hpp + rocksdb/native_client.hpp + s3/s3_metrics.hpp + s3/config_parser.hpp + s3/client.hpp + s3/key_manipulator.hpp + storage_metrics.hpp + db_interface.hpp + merkle_tree_key_manipulator.hpp + key_manipulator_interface.hpp + direct_kv_key_manipulator.hpp + db_types.hpp + ) +install(TARGETS concordbft_storage FILE_SET storage_pub_hdrs DESTINATION storage) + +add_library(concordbft_storage_test_headers INTERFACE) +target_include_directories(concordbft_storage_test_headers INTERFACE test) + +if (BUILD_TESTING) +add_subdirectory(test) +endif() \ No newline at end of file diff --git a/storage/README.md b/libs/storage/README.md similarity index 100% rename from storage/README.md rename to libs/storage/README.md diff --git a/storage/include/storage/db_interface.h b/libs/storage/db_interface.hpp similarity index 100% rename from storage/include/storage/db_interface.h rename to libs/storage/db_interface.hpp diff --git a/storage/include/storage/db_types.h b/libs/storage/db_types.hpp similarity index 100% rename from storage/include/storage/db_types.h rename to libs/storage/db_types.hpp diff --git a/storage/include/storage/direct_kv_key_manipulator.h b/libs/storage/direct_kv_key_manipulator.hpp similarity index 95% rename from storage/include/storage/direct_kv_key_manipulator.h rename to libs/storage/direct_kv_key_manipulator.hpp index dbdb6814c7..1ad7c0c3a0 100644 --- a/storage/include/storage/direct_kv_key_manipulator.h +++ b/libs/storage/direct_kv_key_manipulator.hpp @@ -6,10 +6,10 @@ #pragma once #include "log/logger.hpp" -#include "key_manipulator_interface.h" +#include "key_manipulator_interface.hpp" -#include "db_interface.h" -#include "storage/db_types.h" +#include "db_interface.hpp" +#include "storage/db_types.hpp" namespace concord::storage::v1DirectKeyValue { diff --git a/storage/include/storage/key_manipulator_interface.h b/libs/storage/key_manipulator_interface.hpp similarity index 98% rename from storage/include/storage/key_manipulator_interface.h rename to libs/storage/key_manipulator_interface.hpp index f20632e2a1..00a102f14b 100644 --- a/storage/include/storage/key_manipulator_interface.h +++ b/libs/storage/key_manipulator_interface.hpp @@ -15,7 +15,7 @@ #include -#include "db_types.h" +#include "db_types.hpp" #include "util/sliver.hpp" namespace concord::storage { diff --git a/storage/include/memorydb/client.h b/libs/storage/memorydb/client.hpp similarity index 97% rename from storage/include/memorydb/client.h rename to libs/storage/memorydb/client.hpp index 68b5f192a1..60a1ec01a9 100644 --- a/storage/include/memorydb/client.h +++ b/libs/storage/memorydb/client.hpp @@ -13,12 +13,12 @@ #include #include "util/sliver.hpp" -#include "key_comparator.h" -#include "storage/db_interface.h" +#include "key_comparator.hpp" +#include "storage/db_interface.hpp" #include #include "log/logger.hpp" -#include "storage/storage_metrics.h" +#include "storage/storage_metrics.hpp" namespace concord { namespace storage { diff --git a/storage/include/memorydb/key_comparator.h b/libs/storage/memorydb/key_comparator.hpp similarity index 97% rename from storage/include/memorydb/key_comparator.h rename to libs/storage/memorydb/key_comparator.hpp index 9628839873..781ef01ae7 100644 --- a/storage/include/memorydb/key_comparator.h +++ b/libs/storage/memorydb/key_comparator.hpp @@ -6,7 +6,7 @@ #include "log/logger.hpp" #include "util/sliver.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" namespace concord { namespace storage { diff --git a/storage/include/memorydb/transaction.h b/libs/storage/memorydb/transaction.hpp similarity index 97% rename from storage/include/memorydb/transaction.h rename to libs/storage/memorydb/transaction.hpp index d229454fce..ae8e8d054d 100644 --- a/storage/include/memorydb/transaction.h +++ b/libs/storage/memorydb/transaction.hpp @@ -2,9 +2,9 @@ #pragma once -#include "client.h" +#include "client.hpp" #include "util/sliver.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include #include diff --git a/storage/include/storage/merkle_tree_key_manipulator.h b/libs/storage/merkle_tree_key_manipulator.hpp similarity index 96% rename from storage/include/storage/merkle_tree_key_manipulator.h rename to libs/storage/merkle_tree_key_manipulator.hpp index 1c2057b01e..4852b08bb8 100644 --- a/storage/include/storage/merkle_tree_key_manipulator.h +++ b/libs/storage/merkle_tree_key_manipulator.hpp @@ -13,7 +13,7 @@ #pragma once -#include "key_manipulator_interface.h" +#include "storage/key_manipulator_interface.hpp" #include "util/string.hpp" #include diff --git a/storage/include/rocksdb/client.h b/libs/storage/rocksdb/client.hpp similarity index 98% rename from storage/include/rocksdb/client.h rename to libs/storage/rocksdb/client.hpp index 6e0afa89a1..c81dcb2fff 100644 --- a/storage/include/rocksdb/client.h +++ b/libs/storage/rocksdb/client.hpp @@ -23,8 +23,8 @@ #include #include #include -#include "storage/db_interface.h" -#include "storage/storage_metrics.h" +#include "storage/db_interface.hpp" +#include "storage/storage_metrics.hpp" #include #include diff --git a/storage/include/rocksdb/details.h b/libs/storage/rocksdb/details.hpp similarity index 97% rename from storage/include/rocksdb/details.h rename to libs/storage/rocksdb/details.hpp index 91ad5c7bb3..e7178db3de 100644 --- a/storage/include/rocksdb/details.h +++ b/libs/storage/rocksdb/details.hpp @@ -15,8 +15,8 @@ #ifdef USE_ROCKSDB -#include "client.h" -#include "rocksdb_exception.h" +#include "client.hpp" +#include "rocksdb_exception.hpp" #include #include diff --git a/storage/include/rocksdb/key_comparator.h b/libs/storage/rocksdb/key_comparator.hpp similarity index 97% rename from storage/include/rocksdb/key_comparator.h rename to libs/storage/rocksdb/key_comparator.hpp index 9787878811..83cc1acc57 100644 --- a/storage/include/rocksdb/key_comparator.h +++ b/libs/storage/rocksdb/key_comparator.hpp @@ -10,7 +10,7 @@ #include #include #include "util/sliver.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" namespace concord { namespace storage { diff --git a/storage/include/rocksdb/native_client.h b/libs/storage/rocksdb/native_client.hpp similarity index 98% rename from storage/include/rocksdb/native_client.h rename to libs/storage/rocksdb/native_client.hpp index 5eede8cf0a..2569e48aff 100644 --- a/storage/include/rocksdb/native_client.h +++ b/libs/storage/rocksdb/native_client.hpp @@ -15,14 +15,14 @@ #ifdef USE_ROCKSDB -#include "details.h" -#include "native_iterator.h" -#include "native_write_batch.h" -#include "rocksdb_exception.h" -#include "rocksdb/snapshot.h" +#include "details.hpp" +#include "native_iterator.hpp" +#include "native_write_batch.hpp" +#include "rocksdb_exception.hpp" #include "util/endianness.hpp" -#include "client.h" +#include "client.hpp" +#include #include #include #include diff --git a/storage/include/rocksdb/native_client.ipp b/libs/storage/rocksdb/native_client.ipp similarity index 99% rename from storage/include/rocksdb/native_client.ipp rename to libs/storage/rocksdb/native_client.ipp index 2c717d3744..584c94a0f4 100644 --- a/storage/include/rocksdb/native_client.ipp +++ b/libs/storage/rocksdb/native_client.ipp @@ -15,8 +15,8 @@ #ifdef USE_ROCKSDB -#include "client.h" -#include "details.h" +#include "client.hpp" +#include "details.hpp" #include #include diff --git a/storage/include/rocksdb/native_iterator.h b/libs/storage/rocksdb/native_iterator.hpp similarity index 98% rename from storage/include/rocksdb/native_iterator.h rename to libs/storage/rocksdb/native_iterator.hpp index a6414f9d76..801437b830 100644 --- a/storage/include/rocksdb/native_iterator.h +++ b/libs/storage/rocksdb/native_iterator.hpp @@ -15,7 +15,7 @@ #ifdef USE_ROCKSDB -#include "details.h" +#include "details.hpp" #include #include @@ -28,7 +28,7 @@ namespace concord::storage::rocksdb { using namespace std::string_view_literals; -// For use with NativeClient. See native_client.h . +// For use with NativeClient. See native_client.hpp . class NativeIterator { public: // Returns true if the iterator points to a key-value pair and false otherwise. Initially, an iterator doesn't point diff --git a/storage/include/rocksdb/native_write_batch.h b/libs/storage/rocksdb/native_write_batch.hpp similarity index 98% rename from storage/include/rocksdb/native_write_batch.h rename to libs/storage/rocksdb/native_write_batch.hpp index 02b5c12a48..83af4aaba2 100644 --- a/storage/include/rocksdb/native_write_batch.h +++ b/libs/storage/rocksdb/native_write_batch.hpp @@ -25,7 +25,7 @@ namespace concord::storage::rocksdb { class NativeClient; -// For use with NativeClient. See native_client.h . +// For use with NativeClient. See native_client.hpp . class NativeWriteBatch { public: NativeWriteBatch(const std::shared_ptr &) noexcept; diff --git a/storage/include/rocksdb/native_write_batch.ipp b/libs/storage/rocksdb/native_write_batch.ipp similarity index 99% rename from storage/include/rocksdb/native_write_batch.ipp rename to libs/storage/rocksdb/native_write_batch.ipp index ce0e4df5b7..981d3f824b 100644 --- a/storage/include/rocksdb/native_write_batch.ipp +++ b/libs/storage/rocksdb/native_write_batch.ipp @@ -15,7 +15,7 @@ #ifdef USE_ROCKSDB -#include "details.h" +#include "details.hpp" namespace concord::storage::rocksdb { diff --git a/storage/include/rocksdb/rocksdb_exception.h b/libs/storage/rocksdb/rocksdb_exception.hpp similarity index 100% rename from storage/include/rocksdb/rocksdb_exception.h rename to libs/storage/rocksdb/rocksdb_exception.hpp diff --git a/storage/include/rocksdb/transaction.h b/libs/storage/rocksdb/transaction.hpp similarity index 97% rename from storage/include/rocksdb/transaction.h rename to libs/storage/rocksdb/transaction.hpp index e520f4c733..bdacd3b4d1 100644 --- a/storage/include/rocksdb/transaction.h +++ b/libs/storage/rocksdb/transaction.hpp @@ -10,8 +10,8 @@ // terms and conditions of the sub-component's license, as noted in the // LICENSE file. #include -#include "storage/db_interface.h" -#include "client.h" +#include "storage/db_interface.hpp" +#include "client.hpp" #include "log/logger.hpp" #pragma once diff --git a/storage/include/s3/client.hpp b/libs/storage/s3/client.hpp similarity index 99% rename from storage/include/s3/client.hpp rename to libs/storage/s3/client.hpp index 5479dfe64c..57284a5528 100644 --- a/storage/include/s3/client.hpp +++ b/libs/storage/s3/client.hpp @@ -23,7 +23,7 @@ #include "log/logger.hpp" #include "util/kvstream.h" #include "util/assertUtils.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include "s3_metrics.hpp" #include "util/thread_pool.hpp" diff --git a/storage/include/s3/config_parser.hpp b/libs/storage/s3/config_parser.hpp similarity index 96% rename from storage/include/s3/config_parser.hpp rename to libs/storage/s3/config_parser.hpp index 449fb9a0ff..a58953028f 100644 --- a/storage/include/s3/config_parser.hpp +++ b/libs/storage/s3/config_parser.hpp @@ -20,7 +20,7 @@ #include "log/logger.hpp" #include "util/string.hpp" -#include "s3/client.hpp" +#include "storage/s3/client.hpp" #include "util/config_file_parser.hpp" namespace concord::storage::s3 { diff --git a/storage/include/s3/key_manipulator.h b/libs/storage/s3/key_manipulator.hpp similarity index 96% rename from storage/include/s3/key_manipulator.h rename to libs/storage/s3/key_manipulator.hpp index 5b52be34be..80e76c841c 100644 --- a/storage/include/s3/key_manipulator.h +++ b/libs/storage/s3/key_manipulator.hpp @@ -14,7 +14,7 @@ #pragma once #include "log/logger.hpp" -#include "storage/key_manipulator_interface.h" +#include "storage/key_manipulator_interface.hpp" namespace concord::storage::s3 { diff --git a/storage/include/s3/s3_metrics.hpp b/libs/storage/s3/s3_metrics.hpp similarity index 100% rename from storage/include/s3/s3_metrics.hpp rename to libs/storage/s3/s3_metrics.hpp diff --git a/storage/src/direct_kv_key_manipulator.cpp b/libs/storage/src/direct_kv_key_manipulator.cpp similarity index 99% rename from storage/src/direct_kv_key_manipulator.cpp rename to libs/storage/src/direct_kv_key_manipulator.cpp index e7e80f80d3..a458215ebb 100644 --- a/storage/src/direct_kv_key_manipulator.cpp +++ b/libs/storage/src/direct_kv_key_manipulator.cpp @@ -14,7 +14,7 @@ #include "util/sliver.hpp" #include "util/status.hpp" -#include "storage/direct_kv_key_manipulator.h" +#include "storage/direct_kv_key_manipulator.hpp" #include "util/hex_tools.hpp" #include "util/assertUtils.hpp" #include diff --git a/storage/src/memorydb_client.cpp b/libs/storage/src/memorydb_client.cpp similarity index 99% rename from storage/src/memorydb_client.cpp rename to libs/storage/src/memorydb_client.cpp index 9a438bc2a9..ef085c034f 100644 --- a/storage/src/memorydb_client.cpp +++ b/libs/storage/src/memorydb_client.cpp @@ -1,7 +1,7 @@ // Copyright 2018 VMware, all rights reserved -#include "memorydb/client.h" -#include "memorydb/transaction.h" +#include "storage/memorydb/client.hpp" +#include "storage/memorydb/transaction.hpp" #include #include diff --git a/storage/src/merkle_tree_key_manipulator.cpp b/libs/storage/src/merkle_tree_key_manipulator.cpp similarity index 95% rename from storage/src/merkle_tree_key_manipulator.cpp rename to libs/storage/src/merkle_tree_key_manipulator.cpp index fc43a6bf73..067d4b8dae 100644 --- a/storage/src/merkle_tree_key_manipulator.cpp +++ b/libs/storage/src/merkle_tree_key_manipulator.cpp @@ -11,10 +11,10 @@ // terms and conditions of the subcomponent's license, as noted in the LICENSE // file. -#include "storage/merkle_tree_key_manipulator.h" +#include "storage/merkle_tree_key_manipulator.hpp" #include "util/endianness.hpp" -#include "storage/db_types.h" +#include "storage/db_types.hpp" #include diff --git a/storage/src/rocksdb_client.cpp b/libs/storage/src/rocksdb_client.cpp similarity index 99% rename from storage/src/rocksdb_client.cpp rename to libs/storage/src/rocksdb_client.cpp index a16f8a797c..15fb6d68b8 100644 --- a/storage/src/rocksdb_client.cpp +++ b/libs/storage/src/rocksdb_client.cpp @@ -18,8 +18,8 @@ #ifdef USE_ROCKSDB -#include -#include +#include "rocksdb/client.hpp" +#include "rocksdb/transaction.hpp" #include #include #include diff --git a/storage/src/rocksdb_key_comparator.cpp b/libs/storage/src/rocksdb_key_comparator.cpp similarity index 89% rename from storage/src/rocksdb_key_comparator.cpp rename to libs/storage/src/rocksdb_key_comparator.cpp index 2861ba060a..0013b74a65 100644 --- a/storage/src/rocksdb_key_comparator.cpp +++ b/libs/storage/src/rocksdb_key_comparator.cpp @@ -4,12 +4,12 @@ #ifdef USE_ROCKSDB -#include "rocksdb/key_comparator.h" +#include "storage/rocksdb/key_comparator.hpp" #include "log/logger.hpp" #include "util/hex_tools.hpp" #include "util/sliver.hpp" -#include "rocksdb/client.h" +#include "storage/rocksdb/client.hpp" #include diff --git a/storage/src/s3/client.cpp b/libs/storage/src/s3/client.cpp similarity index 99% rename from storage/src/s3/client.cpp rename to libs/storage/src/s3/client.cpp index 095a4c1a3e..c718e5f9df 100644 --- a/storage/src/s3/client.cpp +++ b/libs/storage/src/s3/client.cpp @@ -13,7 +13,7 @@ // // This convenience header combines different block implementations. -#include "s3/client.hpp" +#include "storage/s3/client.hpp" #include #include #include @@ -22,7 +22,7 @@ #include "log/logger.hpp" #include "util/assertUtils.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" namespace concord::storage::s3 { diff --git a/storage/src/s3/config_parser.cpp b/libs/storage/src/s3/config_parser.cpp similarity index 97% rename from storage/src/s3/config_parser.cpp rename to libs/storage/src/s3/config_parser.cpp index 112b1de093..8b0d96cb61 100644 --- a/storage/src/s3/config_parser.cpp +++ b/libs/storage/src/s3/config_parser.cpp @@ -15,7 +15,7 @@ #include #include -#include "s3/config_parser.hpp" +#include "storage/s3/config_parser.hpp" using std::string; diff --git a/storage/src/s3/key_manipulator.cpp b/libs/storage/src/s3/key_manipulator.cpp similarity index 97% rename from storage/src/s3/key_manipulator.cpp rename to libs/storage/src/s3/key_manipulator.cpp index 840c9ea2ab..6a61a25022 100644 --- a/storage/src/s3/key_manipulator.cpp +++ b/libs/storage/src/s3/key_manipulator.cpp @@ -11,7 +11,7 @@ // terms and conditions of the subcomponent's license, as noted in the LICENSE // file. -#include "s3/key_manipulator.h" +#include "storage/s3/key_manipulator.hpp" #include "util/string.hpp" #include diff --git a/storage/include/storage/storage_metrics.h b/libs/storage/storage_metrics.hpp similarity index 100% rename from storage/include/storage/storage_metrics.h rename to libs/storage/storage_metrics.hpp diff --git a/storage/test/CMakeLists.txt b/libs/storage/test/CMakeLists.txt similarity index 71% rename from storage/test/CMakeLists.txt rename to libs/storage/test/CMakeLists.txt index 038db2f455..c03c4c2411 100644 --- a/storage/test/CMakeLists.txt +++ b/libs/storage/test/CMakeLists.txt @@ -1,27 +1,29 @@ find_package(GTest REQUIRED) if (BUILD_ROCKSDB_STORAGE) - add_executable(native_rocksdb_client_test native_rocksdb_client_test.cpp ) + add_executable(native_rocksdb_client_test src/native_rocksdb_client_test.cpp ) add_test(native_rocksdb_client_test native_rocksdb_client_test) target_link_libraries(native_rocksdb_client_test PUBLIC GTest::Main GTest::GTest concordbft_storage + concordbft_storage_test_headers util stdc++fs ) endif(BUILD_ROCKSDB_STORAGE) if(USE_S3_OBJECT_STORE) - add_executable(s3_client_test s3_test.cpp) + add_executable(s3_client_test src/s3_test.cpp) add_test(NAME s3_client_test COMMAND env CI=on ${CMAKE_CURRENT_BINARY_DIR}/s3_client_test) target_link_libraries(s3_client_test PUBLIC GTest::Main GTest::GTest concordbft_storage + concordbft_storage_test_headers util test_config_lib stdc++fs ) -endif(USE_S3_OBJECT_STORE) +endif(USE_S3_OBJECT_STORE) \ No newline at end of file diff --git a/storage/include/storage/test/s3_test_common.h b/libs/storage/test/s3_test_common.hpp similarity index 98% rename from storage/include/storage/test/s3_test_common.h rename to libs/storage/test/s3_test_common.hpp index 91bdc757ee..b3fa75f96e 100644 --- a/storage/include/storage/test/s3_test_common.h +++ b/libs/storage/test/s3_test_common.hpp @@ -4,8 +4,8 @@ // IMPORTANT: the test assume that the S3 storage is up. #include "gtest/gtest.h" -#include "s3/client.hpp" -#include "s3/config_parser.hpp" +#include "storage/s3/client.hpp" +#include "storage/s3/config_parser.hpp" #include "util/sliver.hpp" #include diff --git a/storage/test/native_rocksdb_client_test.cpp b/libs/storage/test/src/native_rocksdb_client_test.cpp similarity index 99% rename from storage/test/native_rocksdb_client_test.cpp rename to libs/storage/test/src/native_rocksdb_client_test.cpp index 3a93fdf492..bc81bd2a59 100644 --- a/storage/test/native_rocksdb_client_test.cpp +++ b/libs/storage/test/src/native_rocksdb_client_test.cpp @@ -14,11 +14,11 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" -#include "memorydb/client.h" -#include "storage/db_interface.h" -#include "rocksdb/native_client.h" +#include "storage/memorydb/client.hpp" +#include "storage/db_interface.hpp" +#include "storage/rocksdb/native_client.hpp" #include "util/sliver.hpp" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include #include diff --git a/storage/test/s3_test.cpp b/libs/storage/test/src/s3_test.cpp similarity index 99% rename from storage/test/s3_test.cpp rename to libs/storage/test/src/s3_test.cpp index e8d1d5f858..e7236cc349 100644 --- a/storage/test/s3_test.cpp +++ b/libs/storage/test/src/s3_test.cpp @@ -4,7 +4,7 @@ // IMPORTANT: the test assume that the S3 storage is up. #include "gtest/gtest.h" -#include "storage/test/s3_test_common.h" +#include "storage/test/s3_test_common.hpp" namespace concord::storage::s3::test { diff --git a/storage/include/storage/test/storage_test_common.h b/libs/storage/test/storage_test_common.hpp similarity index 96% rename from storage/include/storage/test/storage_test_common.h rename to libs/storage/test/storage_test_common.hpp index 5a8cb8434e..a53ddb80bb 100644 --- a/storage/include/storage/test/storage_test_common.h +++ b/libs/storage/test/storage_test_common.hpp @@ -15,11 +15,11 @@ #include "gtest/gtest.h" -#include "memorydb/client.h" -#include "rocksdb/client.h" -#include "rocksdb/native_client.h" +#include "storage/memorydb/client.hpp" +#include "storage/rocksdb/client.hpp" +#include "storage/rocksdb/native_client.hpp" #include "util/sliver.hpp" -#include "storage/db_interface.h" +#include "storage/db_interface.hpp" #include "util/filesystem.hpp" #include diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt deleted file mode 100644 index 509022ebb4..0000000000 --- a/storage/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -add_library(concordbft_storage STATIC src/memorydb_client.cpp - src/direct_kv_key_manipulator.cpp - src/merkle_tree_key_manipulator.cpp - src/s3/key_manipulator.cpp) - -target_include_directories(concordbft_storage PUBLIC include) - -if (USE_S3_OBJECT_STORE) - find_library(LIBS3 s3) - target_sources(concordbft_storage PRIVATE src/s3/client.cpp src/s3/config_parser.cpp) - target_link_libraries(concordbft_storage PRIVATE ${LIBS3}) -endif(USE_S3_OBJECT_STORE) - -if (BUILD_ROCKSDB_STORAGE) - find_library(ROCKSDB_LIBRARY rocksdb) - find_path(ROCKSDB_INCLUDE_DIR "rocksdb/utilities/transaction_db.h") - find_library(LIBBZ2 bz2) - find_library(LIBLZ4 lz4) - find_library(LIBZSTD zstd) - find_library(LIBZ z) - find_library(LIBSNAPPY snappy) - - #cmake_policy(SET CMP0076 NEW) for cmake 3.14 - target_sources(concordbft_storage PRIVATE src/rocksdb_client.cpp src/rocksdb_key_comparator.cpp) - target_compile_definitions(concordbft_storage PUBLIC USE_ROCKSDB=1 __BASE=1 SPARSE_STATE=1) - target_include_directories(concordbft_storage PUBLIC ${ROCKSDB_INCLUDE_DIR}) - target_link_libraries(concordbft_storage PRIVATE ${ROCKSDB_LIBRARY} ${LIBBZ2} ${LIBLZ4} ${LIBZSTD} ${LIBZ} ${LIBSNAPPY} ${CMAKE_DL_LIBS} util) - -endif(BUILD_ROCKSDB_STORAGE) - -if (BUILD_TESTING) -add_subdirectory(test) -endif() diff --git a/tests/simpleKVBC/TesterClient/simpleKVBTestsBuilder.cpp b/tests/simpleKVBC/TesterClient/simpleKVBTestsBuilder.cpp index 74363ec482..1b6a4a6184 100644 --- a/tests/simpleKVBC/TesterClient/simpleKVBTestsBuilder.cpp +++ b/tests/simpleKVBC/TesterClient/simpleKVBTestsBuilder.cpp @@ -19,7 +19,7 @@ #include #include "commonKVBTests.hpp" #include "DbMetadataStorage.cpp" -#include "storage/db_types.h" +#include "storage/db_types.hpp" #include "block_metadata.hpp" using std::set; diff --git a/tests/simpleKVBC/TesterReplica/main.cpp b/tests/simpleKVBC/TesterReplica/main.cpp index 9833633fc1..0d9c6a099a 100644 --- a/tests/simpleKVBC/TesterReplica/main.cpp +++ b/tests/simpleKVBC/TesterReplica/main.cpp @@ -28,8 +28,8 @@ #include #ifdef USE_ROCKSDB -#include "rocksdb/client.h" -#include "rocksdb/key_comparator.h" +#include "storage/rocksdb/client.hpp" +#include "storage/rocksdb/key_comparator.hpp" #endif #include diff --git a/tests/simpleKVBC/TesterReplica/setup.cpp b/tests/simpleKVBC/TesterReplica/setup.cpp index af8e1620df..e8f4dc052b 100644 --- a/tests/simpleKVBC/TesterReplica/setup.cpp +++ b/tests/simpleKVBC/TesterReplica/setup.cpp @@ -26,7 +26,7 @@ #include "communication/CommFactory.hpp" #include "config/test_comm_config.hpp" #include "commonKVBTests.hpp" -#include "memorydb/client.h" +#include "storage/memorydb/client.hpp" #include "util/string.hpp" #include "util/config_file_parser.hpp" #include "direct_kv_storage_factory.h" @@ -46,7 +46,7 @@ #include "blockchain_misc.hpp" #ifdef USE_S3_OBJECT_STORE -#include "s3/config_parser.hpp" +#include "storage/s3/config_parser.hpp" #endif namespace concord::kvbc { diff --git a/tests/simpleKVBC/TesterReplica/setup.hpp b/tests/simpleKVBC/TesterReplica/setup.hpp index ebe9d0f7f9..4da453df8d 100644 --- a/tests/simpleKVBC/TesterReplica/setup.hpp +++ b/tests/simpleKVBC/TesterReplica/setup.hpp @@ -28,7 +28,7 @@ #include "secrets/secrets_manager_impl.h" #ifdef USE_S3_OBJECT_STORE -#include "s3/client.hpp" +#include "storage/s3/client.hpp" #endif namespace concord::kvbc { diff --git a/thin-replica-server/test/replica_state_snapshot_service_test.cpp b/thin-replica-server/test/replica_state_snapshot_service_test.cpp index 3606b8ea51..8ed7e3e2bd 100644 --- a/thin-replica-server/test/replica_state_snapshot_service_test.cpp +++ b/thin-replica-server/test/replica_state_snapshot_service_test.cpp @@ -17,7 +17,7 @@ #include "categorization/db_categories.h" #include "kvbc_adapter/replica_adapter.hpp" #include "kvbc_key_types.hpp" -#include "storage/test/storage_test_common.h" +#include "storage/test/storage_test_common.hpp" #include "thin-replica-server/replica_state_snapshot_service_impl.hpp" #include diff --git a/tools/DBEditor.cpp b/tools/DBEditor.cpp index 7ebf8b071b..cffd5013d2 100644 --- a/tools/DBEditor.cpp +++ b/tools/DBEditor.cpp @@ -25,12 +25,12 @@ #include "util/assertUtils.hpp" #include "log/logger.hpp" -#include "rocksdb/key_comparator.h" -#include "rocksdb/client.h" +#include "storage/rocksdb/key_comparator.hpp" +#include "storage/rocksdb/client.hpp" #include "bftengine/DbMetadataStorage.hpp" #include "direct_kv_block.h" #include "direct_kv_db_adapter.h" -#include "storage/direct_kv_key_manipulator.h" +#include "storage/direct_kv_key_manipulator.hpp" using namespace bftEngine; using namespace std;