Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move some header files from cloud/ to include/rocksdb/cloud/ #304

Merged
merged 3 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloud/aws/aws_file_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "cloud/cloud_log_controller_impl.h"
#include "cloud/cloud_scheduler.h"
#include "cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
#include "cloud/filename.h"
#include "port/port.h"
#include "rocksdb/cloud/cloud_log_controller.h"
Expand Down
2 changes: 1 addition & 1 deletion cloud/aws/aws_file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <algorithm>
#include <iostream>

#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"

#ifdef USE_AWS

Expand Down
2 changes: 1 addition & 1 deletion cloud/aws/aws_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#include "cloud/aws/aws_file.h"
#include "cloud/aws/aws_file_system.h"
#include "cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
#include "cloud/filename.h"
#include "file/read_write_util.h"
#include "file/writable_file_writer.h"
Expand Down
2 changes: 1 addition & 1 deletion cloud/cloud_file_deletion_scheduler.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2016-present, Rockset, Inc. All rights reserved.

#include "cloud/cloud_file_deletion_scheduler.h"
#include "rocksdb/cloud/cloud_file_deletion_scheduler.h"

#include "cloud/cloud_scheduler.h"
#include "test_util/sync_point.h"
Expand Down
4 changes: 2 additions & 2 deletions cloud/cloud_file_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <unordered_map>

#include "cloud/aws/aws_file_system.h"
#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "cloud/cloud_log_controller_impl.h"
#include "cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
#include "cloud/db_cloud_impl.h"
#include "cloud/filename.h"
#include "env/composite_env_wrapper.h"
Expand Down
5 changes: 3 additions & 2 deletions cloud/cloud_file_system_impl.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) 2017 Rockset.
#ifndef ROCKSDB_LITE

#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"

#include <cinttypes>

#include "cloud/cloud_file_deletion_scheduler.h"
#include "rocksdb/cloud/cloud_file_deletion_scheduler.h"
#include "cloud/cloud_log_controller_impl.h"
#include "cloud/cloud_manifest.h"
#include "cloud/cloud_scheduler.h"
Expand All @@ -17,6 +17,7 @@
#include "file/filename.h"
#include "file/writable_file_writer.h"
#include "port/likely.h"
#include "port/port_posix.h"
#include "rocksdb/cloud/cloud_log_controller.h"
#include "rocksdb/cloud/cloud_storage_provider.h"
#include "rocksdb/db.h"
Expand Down
2 changes: 1 addition & 1 deletion cloud/cloud_file_system_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "rocksdb/cloud/cloud_file_system.h"

#include "cloud/cloud_log_controller_impl.h"
#include "cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_log_controller.h"
#include "rocksdb/cloud/cloud_storage_provider.h"
#include "rocksdb/convenience.h"
Expand Down
10 changes: 6 additions & 4 deletions cloud/cloud_storage_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <mutex>
#include <set>

#include "cloud/cloud_file_system_impl.h"
#include "cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
#include "cloud/filename.h"
#include "file/filename.h"
#include "rocksdb/cloud/cloud_file_system.h"
Expand All @@ -18,6 +18,7 @@
#include "rocksdb/status.h"
#include "rocksdb/utilities/object_registry.h"
#include "util/coding.h"
#include "util/random.h"
#include "util/string_util.h"

namespace ROCKSDB_NAMESPACE {
Expand Down Expand Up @@ -287,7 +288,8 @@ Status CloudStorageProviderImpl::PrepareOptions(const ConfigOptions& options) {
return st;
}

CloudStorageProviderImpl::CloudStorageProviderImpl() : rng_(time(nullptr)) {}
CloudStorageProviderImpl::CloudStorageProviderImpl()
: rng_(std::make_unique<Random64>(time(nullptr))) {}

CloudStorageProviderImpl::~CloudStorageProviderImpl() {}

Expand All @@ -310,7 +312,7 @@ IOStatus CloudStorageProviderImpl::GetCloudObject(
const std::string& local_destination) {
const auto& local_fs = cfs_->GetBaseFileSystem();
std::string tmp_destination =
local_destination + ".tmp-" + std::to_string(rng_.Next());
local_destination + ".tmp-" + std::to_string(rng_->Next());

uint64_t remote_size;
auto s = DoGetCloudObject(bucket_name, object_path, tmp_destination,
Expand Down
3 changes: 2 additions & 1 deletion cloud/db_cloud_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

#include <cinttypes>

#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "cloud/cloud_manifest.h"
#include "cloud/filename.h"
#include "cloud/manifest_reader.h"
#include "env/composite_env_wrapper.h"
Expand Down
6 changes: 3 additions & 3 deletions cloud/db_cloud_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include <cinttypes>
#include <filesystem>

#include "cloud/cloud_file_deletion_scheduler.h"
#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_deletion_scheduler.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "cloud/cloud_scheduler.h"
#include "cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
#include "cloud/db_cloud_impl.h"
#include "cloud/filename.h"
#include "cloud/manifest_reader.h"
Expand Down
4 changes: 2 additions & 2 deletions cloud/manifest_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#include <unordered_map>

#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "cloud/cloud_manifest.h"
#include "cloud/cloud_storage_provider_impl.h"
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
#include "cloud/db_cloud_impl.h"
#include "cloud/filename.h"
#include "db/version_set.h"
Expand Down
2 changes: 1 addition & 1 deletion cloud/purge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <chrono>
#include <set>

#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "cloud/db_cloud_impl.h"
#include "cloud/filename.h"
#include "cloud/manifest_reader.h"
Expand Down
2 changes: 1 addition & 1 deletion db/db_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "util/stderr_logger.h"
#ifdef USE_AWS
#include <aws/core/Aws.h>
#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_storage_provider.h"
#endif
#include "rocksdb/unique_id.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

#pragma once
#include <chrono>
#include "util/mutexlock.h"
#include <functional>
#include <memory>
#include <mutex>
#include <vector>
#include "rocksdb/io_status.h"

namespace ROCKSDB_NAMESPACE {
class CloudScheduler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
#include <thread>
#include <set>

#include "cloud/cloud_manifest.h"
#include "port/port_posix.h"
#include "rocksdb/cloud/cloud_file_system.h"
#include "rocksdb/file_system.h"
#include "rocksdb/io_status.h"
#include "rocksdb/status.h"
#include "util/mutexlock.h"

namespace ROCKSDB_NAMESPACE {
class CloudManifest;
class CloudScheduler;
class CloudStorageReadableFile;
class ObjectLibrary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <atomic>
#include <thread>

#include "cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system_impl.h"
#include "rocksdb/cloud/cloud_file_system.h"
#include "rocksdb/cloud/cloud_storage_provider.h"
#include "rocksdb/status.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#ifndef ROCKSDB_LITE
#include "rocksdb/cloud/cloud_storage_provider.h"
#include "util/random.h"
#include <optional>

namespace ROCKSDB_NAMESPACE {
Expand Down Expand Up @@ -115,6 +114,7 @@ class CloudStorageWritableFileImpl : public CloudStorageWritableFile {
// All writes to this DB can be configured to be persisted
// in cloud storage.
//
class Random64;
class CloudStorageProviderImpl : public CloudStorageProvider {
public:
static Status CreateS3Provider(std::unique_ptr<CloudStorageProvider>* result);
Expand All @@ -136,7 +136,7 @@ class CloudStorageProviderImpl : public CloudStorageProvider {
Status PrepareOptions(const ConfigOptions& options) override;

protected:
Random64 rng_;
std::unique_ptr<Random64> rng_;
virtual IOStatus DoNewCloudReadableFile(
const std::string& bucket, const std::string& fname, uint64_t fsize,
const std::string& content_hash, const FileOptions& options,
Expand Down
Loading