Skip to content

Commit c5f87a8

Browse files
committed
feat: Implement GC for Column Families.
Includes a full coverage test suite.
1 parent 4b1a090 commit c5f87a8

28 files changed

+1341
-128
lines changed

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ cmake-build-debug/
55
cmake-build-coverage/
66
cmake-build-release/
77
.build/
8+
build/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ CMakeUserPresets.json
4242

4343
# Lock files created by bzlmod. We do not want to accidentally commit these.
4444
MODULE.bazel.lock
45+
Testing/

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ FetchContent_Declare(
8181

8282
FetchContent_MakeAvailable(google-cloud-cpp)
8383

84+
find_package(Protobuf REQUIRED)
85+
8486
add_library(
8587
bigtable_emulator_common # cmake-format: sort
8688
cell_view.h
@@ -110,7 +112,8 @@ target_link_libraries(
110112
google-cloud-cpp::bigtable
111113
google-cloud-cpp::bigtable_protos
112114
google-cloud-cpp::common
113-
google-cloud-cpp::grpc_utils)
115+
google-cloud-cpp::grpc_utils
116+
${PROTOBUF_LIBRARIES})
114117

115118
google_cloud_cpp_add_common_options(bigtable_emulator_common)
116119

@@ -128,6 +131,7 @@ if (BUILD_TESTING)
128131
drop_row_range_test.cc
129132
filter_test.cc
130133
filtered_map_test.cc
134+
gc_test.cc
131135
mutations_test.cc
132136
range_set_test.cc
133137
server_test.cc

bigtable_emulator_unit_tests.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ bigtable_emulator_unit_tests = [
2222
"drop_row_range_test.cc",
2323
"filter_test.cc",
2424
"filtered_map_test.cc",
25+
"gc_test.cc",
2526
"mutations_test.cc",
2627
"range_set_test.cc",
2728
"server_test.cc",

bigtable_limits.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace cloud {
2121
namespace bigtable {
2222
namespace emulator {
2323
constexpr std::size_t kMaxRowLen = 2 << 11;
24+
constexpr std::size_t kMaxGCRuleSize = 500;
2425
} // namespace emulator
2526
} // namespace bigtable
2627
} // namespace cloud

cluster.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
// limitations under the License.
1414

1515
#include "cluster.h"
16-
#include "table.h"
1716
#include "google/cloud/internal/make_status.h"
1817
#include "google/cloud/status.h"
1918
#include "google/cloud/status_or.h"
2019
#include "absl/strings/match.h"
20+
#include "table.h"
2121
#include <google/bigtable/admin/v2/table.pb.h>
2222
#include <iostream>
2323
#include <map>

cluster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_EMULATOR_CLUSTER_H
1616
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_EMULATOR_CLUSTER_H
1717

18-
#include "table.h"
1918
#include "google/cloud/status.h"
2019
#include "google/cloud/status_or.h"
20+
#include "table.h"
2121
#include <google/bigtable/admin/v2/table.pb.h>
2222
#include <map>
2323
#include <memory>

0 commit comments

Comments
 (0)