Skip to content

Commit 534483d

Browse files
committed
Google cloud storage support
@githubzilla @cmhms
1 parent adb9f1a commit 534483d

21 files changed

+4978
-163
lines changed

.clang-format

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
1-
# Complete list of style options can be found at:
2-
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
3-
---
1+
# Use the Google style in this project.
42
BasedOnStyle: Google
5-
...
3+
4+
# Some folks prefer to write "int& foo" while others prefer "int &foo". The
5+
# Google Style Guide only asks for consistency within a project, we chose
6+
# "int& foo" for this project:
7+
DerivePointerAlignment: false
8+
PointerAlignment: Left
9+
10+
# The Google Style Guide only asks for consistency w.r.t. "east const" vs.
11+
# "const west" alignment of cv-qualifiers. In this project we use "east const".
12+
QualifierAlignment: Right
13+
14+
IncludeBlocks: Merge
15+
IncludeCategories:
16+
# Matches common headers first, but sorts them after project includes
17+
- Regex: '^\"google/cloud/internal/disable_deprecation_warnings.inc\"$'
18+
Priority: -1
19+
- Regex: '^\"google/cloud/(internal/|grpc_utils/|testing_util/|[^/]+\.h)'
20+
Priority: 1000
21+
- Regex: '^\"google/cloud/' # project includes should sort first
22+
Priority: 500
23+
- Regex: '^\"generator/' # project includes should sort first
24+
Priority: 500
25+
- Regex: '^\"generator/internal/' # project internals second
26+
Priority: 1000
27+
- Regex: '^\"generator/testing/' # testing helpers third
28+
Priority: 1100
29+
- Regex: '^\"' # And then includes from other projects or the system
30+
Priority: 1500
31+
- Regex: '^<grpc/'
32+
Priority: 2000
33+
- Regex: '^<google/*'
34+
Priority: 3000
35+
- Regex: '^<.*/.*'
36+
Priority: 4000
37+
- Regex: '^<.*.hpp>'
38+
Priority: 4000
39+
- Regex: '^<[^/]*>'
40+
Priority: 5000
41+
42+
# Format raw string literals with a `pb` or `proto` tag as proto.
43+
RawStringFormats:
44+
- Language: TextProto
45+
Delimiters:
46+
- 'pb'
47+
- 'proto'
48+
BasedOnStyle: Google
49+
50+
CommentPragmas: '(@copydoc|@copybrief|@see|@overload|@snippet)'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ cmake-build-*
102102
third-party/folly/
103103
.cache
104104
*.sublime-*
105+
106+
.clang-format
107+
.editorconfig
108+
*.vim

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,4 +1651,4 @@ endif()
16511651
option(WITH_BENCHMARK "build benchmark tests" OFF)
16521652
if(WITH_BENCHMARK)
16531653
add_subdirectory(${PROJECT_SOURCE_DIR}/microbench/)
1654-
endif()
1654+
endif()

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,12 @@ replication_test: cloud/replication_test.o $(TEST_LIBRARY) $(LIBRARY)
18861886
cloud_file_system_test: cloud/cloud_file_system_test.o $(TEST_LIBRARY) $(LIBRARY)
18871887
$(AM_LINK)
18881888

1889+
gcp_file_system_test: cloud/gcp/gcp_file_system_test.o $(TEST_LIBRARY) $(LIBRARY)
1890+
$(AM_LINK)
1891+
1892+
gcp_db_cloud_test: cloud/gcp/gcp_db_cloud_test.o $(TEST_LIBRARY) $(LIBRARY)
1893+
$(AM_LINK)
1894+
18891895
cloud_manifest_test: cloud/cloud_manifest_test.o $(TEST_LIBRARY) $(LIBRARY)
18901896
$(AM_LINK)
18911897

@@ -2618,4 +2624,4 @@ list_all_tests:
26182624
ROCKS_DEP_RULES=$(filter-out clean format check-format check-buck-targets check-headers check-sources jclean jtest package analyze tags rocksdbjavastatic% unity.% unity_test checkout_folly, $(MAKECMDGOALS))
26192625
ifneq ("$(ROCKS_DEP_RULES)", "")
26202626
-include $(DEPFILES)
2621-
endif
2627+
endif

TARGETS

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ cpp_library_wrapper(name="rocksdb_lib", srcs=[
375375
"//folly/synchronization:distributed_mutex",
376376
], headers=None, link_whole=False, extra_test_libs=False)
377377

378-
<<<<<<< HEAD
379378
cpp_library_wrapper(name="rocksdb_whole_archive_lib", srcs=[
380379
"cache/cache.cc",
381380
"cache/cache_entry_roles.cc",
@@ -4983,6 +4982,15 @@ cpp_unittest_wrapper(name="cloud_file_system_test",
49834982
deps=[":rocksdb_test_lib"],
49844983
extra_compiler_flags=[])
49854984

4985+
cpp_unittest_wrapper(name="gcp_file_system_test",
4986+
srcs=["cloud/gcp/gcp_file_system_test.cc"],
4987+
deps=[":rocksdb_test_lib"],
4988+
extra_compiler_flags=[])
4989+
4990+
cpp_unittest_wrapper(name="gcp_db_cloud_test",
4991+
srcs=["cloud/gcp/gcp_db_cloud_test.cc"],
4992+
deps=[":rocksdb_test_lib"],
4993+
extra_compiler_flags=[])
49864994

49874995
cpp_unittest_wrapper(name="cloud_manifest_test",
49884996
srcs=["cloud/cloud_manifest_test.cc"],

build_tools/build_detect_platform

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,16 @@ if [ "${USE_AWS}XXX" = "1XXX" ]; then
641641
COMMON_FLAGS="$COMMON_FLAGS $S3_CCFLAGS"
642642
PLATFORM_LDFLAGS="$S3_LDFLAGS $PLATFORM_LDFLAGS"
643643
fi
644+
645+
if [ "${USE_GCP}XXX" = "1XXX" ]; then
646+
GCP_SDK=/usr/local
647+
GCI=${GCP_SDK}/include/
648+
GCS_CCFLAGS="$GCS_CCFLAGS -I$GCI -DUSE_GCP"
649+
GCS_LDFLAGS="$GCS_LDFLAGS -lgoogle_cloud_cpp_common -lgoogle_cloud_cpp_storage"
650+
COMMON_FLAGS="$COMMON_FLAGS $GCS_CCFLAGS"
651+
PLATFORM_LDFLAGS="$GCS_LDFLAGS $PLATFORM_LDFLAGS"
652+
fi
653+
644654
#
645655
# Support the Kafka WAL storing if the env variable named USE_KAFKA
646656
# is set to 1. Setting it to any other value or not setting it at all means
@@ -832,4 +842,4 @@ if test -n "$USE_FOLLY"; then
832842
fi
833843
if test -n "$PPC_LIBC_IS_GNU"; then
834844
echo "PPC_LIBC_IS_GNU=$PPC_LIBC_IS_GNU" >> "$OUTPUT"
835-
fi
845+
fi

cloud/aws/aws_s3.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ IOStatus S3StorageProvider::ExistsCloudObject(const std::string& bucket_name,
688688
IOStatus S3StorageProvider::GetCloudObjectSize(const std::string& bucket_name,
689689
const std::string& object_path,
690690
uint64_t* filesize) {
691-
HeadObjectResult result;
691+
HeadObjectResult result;
692692
result.size = filesize;
693693
return HeadObject(bucket_name, object_path, &result);
694694
}
@@ -1064,4 +1064,4 @@ Status CloudStorageProviderImpl::CreateS3Provider(
10641064
#endif /* USE_AWS */
10651065
}
10661066
} // namespace ROCKSDB_NAMESPACE
1067-
#endif // ROCKSDB_LITE
1067+
#endif // ROCKSDB_LITE

0 commit comments

Comments
 (0)