Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
3f94bae
feat: emulator skeleton
dopiera Dec 3, 2024
ef4b99a
Working read rows
dopiera Dec 17, 2024
f1e4740
Tidy up iterators.
dopiera Dec 28, 2024
58cdbb1
Mostly working filters.
dopiera Dec 29, 2024
f37f61e
working read filtering
dopiera Jan 11, 2025
0546316
Refactored filtering.
dopiera Jan 26, 2025
7a82f26
Refactor to use a column stream directly.
dopiera Jan 28, 2025
cc02728
Refactor
dopiera Jan 28, 2025
ff49c5d
Further fixes after refactor.
dopiera Feb 3, 2025
9b52402
StringRangeSet::Range tested.
dopiera Feb 10, 2025
d9f6182
RangeSets tested.
dopiera Feb 10, 2025
4c54939
FilteredMapView tested.
dopiera Feb 11, 2025
a35b300
Some random fixes.
dopiera Feb 11, 2025
02338d4
emulator: Start RowTransaction class.
marete Feb 17, 2025
a3bb308
emulator: Properly declate all possible row mutations.
marete Feb 17, 2025
9bb68e4
emulator: Implement a SetCell that records an undo log.
marete Feb 20, 2025
84e18e4
Complete implementation of Undo() for SetCell mutations.
marete Feb 20, 2025
613ade9
emulator: Implement a constructor for the RowTransaction class.
marete Feb 20, 2025
49a3e33
emulator: Pass RowTransaction a constant reference to the mutation re…
marete Feb 20, 2025
9071761
emulator: Introduce the use of a RowTransaction in Table::MutateRow.
marete Feb 20, 2025
7b1ebe4
emulator: Run clang-format on the subset of the files we have been ch…
marete Feb 20, 2025
8146b73
emulator: Implement undo log and wire-up rewind for the SetCell mutat…
marete Feb 17, 2025
2506fe2
Merge branch 'emulator' of github.com:marete/google-cloud-cpp into em…
marete Feb 21, 2025
274a19d
emulator: Start test suite for row mutation transaction rollback.
marete Feb 21, 2025
93d757e
feat: some semi-working tests
dopiera Feb 21, 2025
19d57ff
emulator: Add a static method to Table that returns a default-constru…
marete Feb 21, 2025
9e96abc
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Feb 21, 2025
6eefe40
emulator: testing: Create a table in the correct way.
marete Feb 24, 2025
7f95ac2
emulator: testing: rollback_test: Fix crash when setting up SetCell m…
marete Feb 24, 2025
82bcf54
emulator: SetCell mutation: Various logic fixes for undo log.
marete Feb 24, 2025
d685ab4
emulator: trasnaction rollback test: Fix crash in destructor.
marete Feb 24, 2025
d34e47c
emulator: transaction rollback test: Fix crash in destructor.
marete Feb 24, 2025
67192b5
Merge branch 'emulator' of github.com:marete/google-cloud-cpp into em…
marete Feb 24, 2025
77adf30
emulator: table: Add a method to return an iterator to the column fam…
marete Feb 25, 2025
b9aaa07
emulator: Introduce methods to retrieve begin and end of column famil…
marete Feb 25, 2025
eb3e40f
emulator: Complete implementing test for basic transaction functional…
marete Feb 25, 2025
62f6ecc
emulator: rollback test: Fix for more consistent handling of the tabl…
marete Feb 26, 2025
050a55c
emulator: Store a std::shared_ptr<Table> in RowTransaction.
marete Feb 26, 2025
b1cb90f
More tests
dopiera Feb 27, 2025
dd528d3
emulator: rollback tests: fix test for basic functionality.
marete Feb 27, 2025
9fcb0d3
emulator: rollback tests: fix test for basic functionality.
marete Feb 27, 2025
8383131
emulator: ColumnFamily class: Disable copying.
marete Feb 28, 2025
f56b010
emulator: Disable copying ColumnFamilyRow and simplify tx SetCell logic.
marete Feb 28, 2025
fabf01a
Merge branch 'emulator' of github.com:marete/google-cloud-cpp into em…
marete Feb 28, 2025
ec0f58b
emulator: Disable the copying of ColumnRows.
marete Feb 28, 2025
601b664
emulator: rollback_test.cc: factor out helper to check a cell exists …
marete Feb 28, 2025
863f1c0
emulator: add helper to set a cell to a value.
marete Feb 28, 2025
7d15c20
emulator: rollback tests: implement helper function to create tables.
marete Feb 28, 2025
a38278f
emulator: rollack tests: Fix comment describing test.
marete Feb 28, 2025
978c3fb
emulator: rollback tests: Implement additional testing helper functions.
marete Mar 2, 2025
21051c1
emulator: add helper to test > 1 SetCell mutations at once.
marete Mar 2, 2025
09c5b85
emulator: use set_cells() to set possibly more than one SetCell mutat…
marete Mar 2, 2025
36f5686
emualtor: transaction rollback: Implement working test for RestoreValue.
marete Mar 3, 2025
e59e729
emulator: rollback_tests.cc: run clang-format.
marete Mar 3, 2025
693ddff
emulator: transaction rollback: Avoid copying the possibly very large…
marete Mar 3, 2025
9ee731c
emulator: transaction rollback: SetCell: Implement working test for D…
marete Mar 3, 2025
ca8a621
emulator: transaction rollback: Implement working DeleteRow test.
marete Mar 3, 2025
60ab245
emulator: transaction rollback: Implement a DeleteFromRow that update…
marete Mar 5, 2025
0d4fd5a
emulator: transaction rollback: Implement undo for row deletions (Del…
marete Mar 5, 2025
e3791d4
emulator: RestoreRow undo log: Rename struct members more conventiona…
marete Mar 5, 2025
a6119b2
emulator: DeleteFromFamily mutation: Implement with rollback support …
marete Mar 5, 2025
c8ce0d8
emulator: transaction rollback: Test basic functionality of a DeleteF…
marete Mar 6, 2025
c9953d6
emulator: test rollback of a row deletion due to DeleteFromFamily.
marete Mar 6, 2025
520a199
Filters work again.
dopiera Mar 9, 2025
dde01fe
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Mar 10, 2025
2a17dc7
emulator: Fixes for review: Improve name of return varible.
marete Mar 10, 2025
b99368a
emulator: Rename RestoreRow -> RestoreColumnFamilyRow.
marete Mar 10, 2025
dab9605
emulator: style: Remove trailing underscore from struct member names.
marete Mar 10, 2025
a518e8d
emulator: Rename several iterator variables more appropriately.
marete Mar 10, 2025
6255c5e
emulator: Use std::move() to avoid a copy.
marete Mar 10, 2025
a76f2d0
emulator: Rename another iterator properly.
marete Mar 10, 2025
688c66b
emulator: Use std::move() to avoid another copy.
marete Mar 10, 2025
3805e40
emulator: check and return from exceptional conditions first.
marete Mar 10, 2025
5cea718
emualtor: Fix the naming of another iterator variable.
marete Mar 10, 2025
c7f50b0
emulator: remove use of C++17 syntax feature (if with initializer).
marete Mar 10, 2025
a51584e
emulator: rename another iterator variable more appropriately.
marete Mar 10, 2025
ff5d406
emulator: Add a comment justifying storing the column family iterator…
marete Mar 12, 2025
1ac8657
emulator: transaction rollback: RestoreValue: Eliminate the storage o…
marete Mar 12, 2025
8221065
emulator: actually remove iterator field from RestoreValue.
marete Mar 12, 2025
54acb82
emulator: Correct and radically simplify SetCell undo code logic.
marete Mar 12, 2025
c62d625
emulator: remove undo types that are no longer needed.
marete Mar 12, 2025
6c8e1cc
emulator: Delete definitions of rollback types no longer used.
marete Mar 13, 2025
f871e27
emulator: return unimplemented error status for unsupported aggregati…
marete Mar 13, 2025
60e3a1a
emulator: row mutations: use a const reference rather than copying th…
marete Mar 13, 2025
35aaa89
emulator: Modify the Delete* methods to return vector of deleted cells.
marete Mar 13, 2025
c02a348
emualator: Implement DeleteFromColumn mutation using RowTransaction.
marete Mar 14, 2025
8c1cbb0
emulator: Test transaction DeleteFromColumn for basic functionality.
marete Mar 14, 2025
6e183b9
emulator: DeleteFromColumn basic functionality test: test that the co…
marete Mar 14, 2025
1d6b85f
emulator: make it possible to test a vector of DeleteFromColumn row m…
marete Mar 14, 2025
9dc3cc4
emulator: Test transaction rollback for DeleteFromColumn.
marete Mar 14, 2025
17c733b
emulator: TEST(TransactonRollback, DeleteFromColumnRollback): also ch…
marete Mar 14, 2025
155fc81
emulator: Prepare to support transaction rollbacks for DeleteRow muta…
marete Mar 14, 2025
077c638
chore: comments, tidy, fixes
dopiera Mar 16, 2025
807de75
emulator: DeleteRow: don't forget to erase the row key.
marete Mar 18, 2025
eda4042
emulator: Fix segmentation fault caused by invalidated iterator in De…
marete Mar 18, 2025
bfa3d24
emulator: Fix segmentation fault caused by invalidated iterator in De…
marete Mar 18, 2025
c633c78
Merge branch 'emulator' of github.com:marete/google-cloud-cpp into em…
marete Mar 18, 2025
915b371
emulator: clang-format.
marete Mar 18, 2025
94552ac
emulator: transaction rollback: get rid of another undo log type.
marete Mar 18, 2025
481293e
emulator: Implement a DeleteFromRow that supports rollback.
marete Mar 18, 2025
2674c1a
emulator: Test DeleteFromRow with rollback support and use it in Muta…
marete Mar 18, 2025
cebb6cb
emulator: Update and correct a comment.
marete Mar 18, 2025
f9b40ac
erge remote-tracking branch 'upstream/emulator' into emulator
marete Mar 18, 2025
52bba8e
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Mar 18, 2025
3b92a60
Merge branch 'emulator' of github.com:marete/google-cloud-cpp into em…
marete Mar 18, 2025
a443044
emualtor: Remove now-unused undo type.
marete Mar 18, 2025
ca1d931
documentation and further clang-tidy
dopiera Mar 19, 2025
06fb8f6
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Mar 28, 2025
28e9acc
emulator: Fixes to avoid copying values that are possibly very large …
marete Mar 31, 2025
86a4fa2
emulator: mutation transactions: use std::chrono:duration_cast.
marete Mar 31, 2025
908f3c9
emulator: use invariant that rows are never empty to eliminate some c…
marete Mar 31, 2025
10d3378
emulator: optimization: make it possible to delete a column via a row…
marete Mar 31, 2025
00545b8
emulator: eliminate redundant storage of row_key in undo log.
marete Mar 31, 2025
1efa6f5
emulator: Use google-standard status builder everywhere in main code.
marete Mar 31, 2025
0fda7c8
emulator: Add a FIXME to ask to use google-standard Status builder ev…
marete Mar 31, 2025
9364a31
emulator: Remove unused local var.
marete Apr 2, 2025
2a4422a
emulator: eliminate a C++-17ism.
marete Apr 2, 2025
fecad9b
emulator: DeleteRow: fix hang/crash due to use of invalidated row ite…
marete Apr 3, 2025
e5aabf7
emulator: remove non-Google-standard Status builders.
marete Apr 3, 2025
cfda22b
emulator: remove some outdated FIXMEs.
marete Apr 3, 2025
af59899
emulator: make some std::chrono usage more type-safe.
marete Apr 8, 2025
893a8d5
emulator: std::move() to avoid another copy of a cell.
marete Apr 8, 2025
c9a76b3
emulator: eliminate some code duplication.
marete Apr 8, 2025
103bfb6
emulator: SetCell: return overwritten value (if any).
marete Apr 10, 2025
e845437
emulator: radically simplify undo log preparation code.
marete Apr 10, 2025
a544337
emulator: ColumnFamily::DeleteRow(): radically simplify the function.
marete Apr 11, 2025
ed6352b
Test and fix MergeCellStreams.
dopiera Apr 13, 2025
7ae87db
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Apr 15, 2025
7e0b3f0
emulator: tests: exclude "programs" from tests. (#5)
marete Apr 17, 2025
90024d1
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Apr 17, 2025
2b83160
emulator: SetCell: set timestamp to server time if passed 0 or negati…
marete Apr 23, 2025
2538679
emulator: transaction rollback: Check that a SetCell with timestamp 0…
marete Apr 23, 2025
8dd57eb
emulator: docs: correct formatting of several comments in header.
marete Apr 23, 2025
2646a59
emulator: tests: use a better EXPECT* macro in one place.
marete Apr 23, 2025
edd5b7c
emulator: Implement ColumnFamily::DeleteTimeStamp().
marete Apr 23, 2025
e1abe87
emulator: transaction undo: radically simplify the code for DeleteValue.
marete Apr 23, 2025
a3c10fe
emulator: rollback tests: perform some trivial refactoring.
marete Apr 23, 2025
3e62278
emulator tests: Fix bigtable_emulator_range_set_test.
marete Apr 25, 2025
ff0bed9
emulator tests: Fix bigtable_emulator_range_set_test.
marete Apr 28, 2025
751f684
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Apr 28, 2025
dcad63c
emulator: fixes for clang-tidy and clang-format.
marete Apr 29, 2025
a7054b0
emulator: Implement atomic transaction rollback support.
marete Apr 29, 2025
ced499b
Merge remote-tracking branch 'upstream/emulator' into emulator
marete Apr 29, 2025
6b13984
Merge branch 'emulator' into fix-test-bigtable_emulator_range_set_test
marete Apr 29, 2025
235ca33
emulator: SampleRowKeys: Implement a row sampler.
marete May 5, 2025
a9637ad
emulator: SampleRowKeys: Wire up the sampler to the SampleRowKeys GRP…
marete May 7, 2025
ff6cd6d
emulator: SampleRowKeys: Consider the size of the row in all column f…
marete May 7, 2025
a8908e9
More filter tests and some bug fixes.
dopiera May 7, 2025
de711bd
Make linter happy.
dopiera May 7, 2025
fb3f00f
emulator: SampleRowKeys: Fix crash due to incorrect usage of lambda c…
marete May 7, 2025
10cdcba
emulator: SampleRowKeys: Fix some typos in an important comment.
marete May 7, 2025
4961655
emulator: SampleRowKeys: Fix a couple more bugs.
marete May 7, 2025
a92e866
emulator: SampleRowKeys: Revert 2 ci/ files to upstream contents.
marete May 7, 2025
6898492
emulator: SampleRowKeys: improve the generation of randomness.
marete May 8, 2025
c4b361f
Merge remote-tracking branch 'upstream/emulator' into emulator
marete May 12, 2025
16bc30e
Merge branch 'emulator' into sample_row_keys
marete May 12, 2025
0032912
emulator: Implement Conditional Mutations
marete May 12, 2025
341d672
emulator: server: implement MutateRows.
marete May 13, 2025
337d8bd
emulator: Implement the DropRowRanges RPC.
marete May 14, 2025
c33e39f
emulator: Trivial fixes for Google C++ style.
marete May 14, 2025
0ef3ff4
Merge remote-tracking branch 'upstream/emulator' into sample_row_keys
marete May 21, 2025
5fae498
test: add emulator filter tests and fix the issues encountered
prawilny May 22, 2025
519b1f1
Remove redundant includes
prawilny May 23, 2025
cdb2d6f
emulator: SampleRowKeys: Start rewrite that uses a filter and CellStr…
marete May 26, 2025
c6bc6e7
emulator: trivial mechanical formatting fixes.
marete May 26, 2025
3504529
emulator: Re-implement SampleRowKeys to use the sampled CellStream.
marete May 26, 2025
ef4d3c2
emulator: server.cc: mechanical formatting fixes.
marete May 26, 2025
4997b64
emulator: SetCell: Fix the handling of 0 and negative timestamps.
marete May 29, 2025
df0fa0d
Merge pull request #13 from marete/fix_timestamp_handling
marete May 29, 2025
9fd934f
Merge branch 'upstream_emulator' into sample_row_keys
marete May 29, 2025
9b456f1
emulator: SampleRowKeys: Re-write to compute exact offset for row keys.
marete May 29, 2025
e870f91
emulator: Remove unused code from earlier PR iteration.
marete May 29, 2025
bd7f315
emulator: mechanical fixes of typos.
marete May 29, 2025
eab03f2
emulator: clang-tidy fixes.
marete May 29, 2025
5c35c23
Formatter and clang-tidy improvements
prawilny Jun 5, 2025
620fc1f
emulator: Fixes for typos.
marete Jun 10, 2025
38a5a25
Merge branch 'upstream_emulator' into sample_row_keys
marete Jun 10, 2025
1a25b13
Implement the ReadModifyWriteRow RPC.
marete Jun 12, 2025
6db78d1
emulator: ReadModifyWrite: Eliminate some code duplication.
marete Jun 12, 2025
70d0473
Mechanical fixes by CI automation. (#17)
marete Jun 12, 2025
9e5efee
emulator: trivial: fix typo in rollback_test.cc (#18)
marete Jun 14, 2025
295925b
Merge branch 'upstream_emulator' into sample_row_keys
marete Jun 14, 2025
323b500
emulator: ReadModifyWrite: Implement passing unit tests and fix a bug…
marete Jun 18, 2025
f8d303b
emulator: tests: rename rollback_test.cc to something more appropriat…
marete Jun 18, 2025
d26faad
Merge branch 'upstream_emulator' into sample_row_keys
marete Jun 18, 2025
4db993a
emulator: mechanical fixes by CI tool.
marete Jun 18, 2025
e2155d9
emulator: Complex Types: Implement AddToCell mutation
marete Jun 24, 2025
94cdc27
Merge branch 'upstream_emulator' into sample_row_keys
marete Jun 24, 2025
ca633a4
Merge remote-tracking branch 'upstream/ac/emulator_filter_tests_and_f…
marete Jun 26, 2025
ca0ed08
emulator: tests: prepare to reuse some code from mutations_test.cc.
marete Jun 26, 2025
df894e8
emulator: fix api usage and compilation.
marete Jun 26, 2025
d446920
emulator: refactor to reuse existing testing code.
marete Jun 26, 2025
fa5e09e
emulator: filters: ColumnRange: implement end-to-end test.
marete Jun 26, 2025
3735316
emulator: make CreateCellStream public.
marete Jun 26, 2025
a9cc374
test: add blackbox gRPC server tests (#11)
prawilny Jun 27, 2025
ab313de
test: add emulator filter tests and fix the issues encountered (#12)
prawilny Jul 1, 2025
d6238e5
emulator: filters: ColumnRange: Don't return cells from every column …
marete Jul 1, 2025
023fbd8
emulator: tests: add license and header include guards.
marete Jul 1, 2025
cc64848
emulator: automatic formatting fixes by CI tool.
marete Jul 1, 2025
775ef28
Merge branch 'upstream_emulator' into fix_colmnrange_filter
marete Jul 1, 2025
8ac5df7
emulator: mechanical formatting fixes by CI tool.
marete Jul 1, 2025
7d7ce68
Merge branch 'upstream_emulator' into sample_row_keys
marete Jul 1, 2025
d667401
Merge branch 'sample_row_keys' into for_google
marete Jul 1, 2025
14454ae
Merge branch 'main' into for_google
marete Jul 1, 2025
e89a4dd
fix: Fix several ReadRow bugs revealed by the bigtable_data_integrati…
marete Jul 2, 2025
93dd515
Merge branch 'googleapis:main' into emulator
marete Jul 2, 2025
1e747c9
fix: emulator: Filters: Fix the ColumnRange Filter
marete Jul 4, 2025
fd7f0fe
feat: emulator: server: Implement port and address command-line options.
marete Jul 7, 2025
f5e14cf
fix: fix segmentation fault due to the use of an invalid grpc server_…
marete Jul 7, 2025
530d2ea
emulator: Implement SampleRowKeys.
marete Jul 8, 2025
f504325
feat: bigtable emulator: Use new emulator (written in C++) for tests.
marete Jul 8, 2025
30d9127
Merge branch 'main' into for_google
marete Jul 8, 2025
9e7a5cb
Merge branch 'googleapis:main' into emulator
marete Jul 8, 2025
d84912a
Merge branch 'main' into for_google
marete Jul 8, 2025
15ea4ce
fix: DeleteFromColumn: reject requests with an empty or reversed time…
marete Jul 9, 2025
0d1a2a7
Merge branch 'upstream_emulator' into pr_for_google
marete Jul 9, 2025
d9d2c64
Merge branch 'fix_delete_from_column_empty_or_reversed_ts' into pr_fo…
marete Jul 9, 2025
52936ca
style: emulator: mechanical header inclusion fixes by clang-tidy and …
marete Jul 9, 2025
041a27d
fix: DeleteFromColumn: reject requests with an empty or reversed time…
marete Jul 9, 2025
f06b5f7
Merge branch 'upstream_emulator' into pr_for_google
marete Jul 9, 2025
c833e3b
Merge branch 'googleapis:main' into emulator
marete Jul 9, 2025
2689288
Merge branch 'upstream_emulator' into pr_for_google
marete Jul 9, 2025
7ef5b5f
fix: emulator: fix MSVC compilation error due to storing a int64_t in…
marete Jul 10, 2025
5e32911
Merge branch 'fix_msvc_size_t_compilation_error' into pr_for_google
marete Jul 10, 2025
5efa404
fix: MSVC (windows): Prevent GetCurrentTime macro expansion in windows.
marete Jul 10, 2025
0bf5235
Merge branch 'fix_getcurrenttime_macro_expansion_in_windows' into pr_…
marete Jul 10, 2025
c10571b
fix: MSVC (windows): Prevent GetCurrentTime macro expansion in windows.
marete Jul 11, 2025
173f00b
fix: emulator: fix MSVC compilation error due to storing a int64_t in…
marete Jul 11, 2025
4860122
Merge branch 'googleapis:main' into emulator
marete Jul 14, 2025
a380d16
Merge branch 'upstream_emulator' into pr_for_google
marete Jul 14, 2025
00c4232
feat: Implement a function to determine if 2 strings of a maximum len…
marete Jul 15, 2025
fc25d0f
Merge branch 'fix_consecutive_strings' into pr_for_google
marete Jul 15, 2025
12b50f9
Merge branch 'google' into upstream_emulator
marete Jul 17, 2025
1281aa1
Merge branch 'upstream_emulator' into pr_for_google
marete Jul 17, 2025
af466fb
Merge branch 'upstream_emulator' into fix_consecutive_strings
marete Jul 17, 2025
99401e3
Merge branch 'fix_consecutive_strings' into pr_for_google
marete Jul 17, 2025
1001bda
fix: Reject row_keys larger than 4KiB for mutations (and range set cr…
marete Jul 17, 2025
61a1e27
Merge branch 'limit_row_key_length' into pr_for_google
marete Jul 20, 2025
8345653
fix: windows build: fix build failure due to undefined type.
marete Jul 21, 2025
d213b50
Merge branch 'fix_undefined_grpc_serialize' into pr_for_google
marete Jul 21, 2025
b2cc85a
fix: Windows Build: Fix remaining compile and linkage errors.
marete Jul 22, 2025
badfd2d
Merge branch 'fix_windows_build' into pr_for_google
marete Jul 22, 2025
5fd1768
style: mechanical header fixes by checkers CI script.
marete Jul 22, 2025
26b34e9
Merge branch 'fix_windows_build' into pr_for_google
marete Jul 22, 2025
b71328d
fix: windows build: fix windows buiuld.
marete Jul 21, 2025
b64acec
Merge branch 'fix_windows_build' into pr_for_google
marete Jul 22, 2025
e773510
fix: windows build: fix windows buiuld.
marete Jul 22, 2025
e99e1b5
Merge branch 'upstream_emulator' into pr_for_google
marete Jul 22, 2025
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Code coverage output artefacts
code_coverage.info
code_coverage_report/

# Common build output directory names
.build/
_build/
build/
build-output/
build-out/
cmake-out/
Expand Down
5 changes: 5 additions & 0 deletions google/cloud/bigtable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set(DOXYGEN_EXCLUDE_SYMBOLS
"benchmarks"
"bigtable_admin_internal"
"bigtable_internal"
"emulator"
"internal"
"testing"
"examples"
Expand Down Expand Up @@ -204,6 +205,8 @@ add_library(
internal/readrowsparser.cc
internal/readrowsparser.h
internal/retry_traits.h
internal/row_range_helpers.cc
internal/row_range_helpers.h
internal/row_reader_impl.h
internal/rpc_policy_parameters.h
internal/rpc_policy_parameters.inc
Expand Down Expand Up @@ -512,6 +515,8 @@ if (BUILD_TESTING)
add_subdirectory(tests)
endif ()

add_subdirectory(emulator)

# Examples are enabled if possible, but package maintainers may want to disable
# compilation to speed up their builds.
if (GOOGLE_CLOUD_CPP_ENABLE_EXAMPLES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ fi
CBT_INSTANCE_ADMIN_EMULATOR_START=(
"${BINARY_DIR}/google/cloud/bigtable/tests/instance_admin_emulator"
)

# Configure run_emulators_utils.sh to find the cbt emulator.
CBT_EMULATOR_CMD=(
"${BINARY_DIR}/google/cloud/bigtable/emulator/emulator"
)

source module /google/cloud/bigtable/tools/run_emulator_utils.sh

cd "${BINARY_DIR}"
Expand Down
114 changes: 114 additions & 0 deletions google/cloud/bigtable/emulator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# ~~~
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ~~~

add_library(
bigtable_emulator_common # cmake-format: sort
cell_view.h
cluster.cc
cluster.h
column_family.cc
column_family.h
filter.cc
filter.h
filtered_map.h
limits.h
range_set.cc
range_set.h
row_streamer.cc
row_streamer.h
server.cc
server.h
table.cc
table.h
test_util.cc
test_util.h
to_grpc_status.cc
to_grpc_status.h)

target_link_libraries(
bigtable_emulator_common
google-cloud-cpp::bigtable
google-cloud-cpp::bigtable_protos
google-cloud-cpp::common
google-cloud-cpp::grpc_utils
gRPC::grpc++
gRPC::grpc
protobuf::libprotobuf)
google_cloud_cpp_add_common_options(bigtable_emulator_common)

include(CreateBazelConfig)
create_bazel_config(bigtable_emulator_common YEAR 2024)

if (BUILD_TESTING)
# List the unit tests, then setup the targets and dependencies.
set(bigtable_emulator_unit_tests
# cmake-format: sort
column_family_test.cc
conditional_mutations_test.cc
drop_row_range_test.cc
filter_test.cc
filtered_map_test.cc
mutations_test.cc
range_set_test.cc
server_test.cc
table_test.cc)
export_list_to_bazel("bigtable_emulator_unit_tests.bzl"
"bigtable_emulator_unit_tests" YEAR "2024")

foreach (fname ${bigtable_emulator_unit_tests})
google_cloud_cpp_add_executable(target "bigtable_emulator" "${fname}")
target_link_libraries(
${target}
PRIVATE bigtable_emulator_common
bigtable_client_testing
google_cloud_cpp_testing
google_cloud_cpp_testing_grpc
google-cloud-cpp::bigtable
google-cloud-cpp::bigtable_protos
google-cloud-cpp::common
google-cloud-cpp::grpc_utils
GTest::gmock_main
GTest::gmock
GTest::gtest
gRPC::grpc++
gRPC::grpc
protobuf::libprotobuf)
google_cloud_cpp_add_common_options(${target})
add_test(NAME ${target} COMMAND ${target})
endforeach ()
endif ()

set(bigtable_emulator_programs # cmake-format: sort
emulator.cc)
export_list_to_bazel("bigtable_emulator_programs.bzl"
"bigtable_emulator_programs" YEAR "2024")

foreach (fname ${bigtable_emulator_programs})
google_cloud_cpp_add_executable(target "bigtable" "${fname}")
target_link_libraries(
${target}
PRIVATE bigtable_emulator_common
absl::flags
absl::flags_parse
google-cloud-cpp::bigtable
google-cloud-cpp::bigtable_protos
google-cloud-cpp::grpc_utils
google_cloud_cpp_testing
gRPC::grpc++
gRPC::grpc
protobuf::libprotobuf)
google_cloud_cpp_add_common_options(${target})
endforeach ()
44 changes: 44 additions & 0 deletions google/cloud/bigtable/emulator/bigtable_emulator_common.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# DO NOT EDIT -- GENERATED BY CMake -- Change the CMakeLists.txt file if needed

"""Automatically generated source lists for bigtable_emulator_common - DO NOT EDIT."""

bigtable_emulator_common_hdrs = [
"cell_view.h",
"cluster.h",
"column_family.h",
"filter.h",
"filtered_map.h",
"limits.h",
"range_set.h",
"row_streamer.h",
"server.h",
"table.h",
"test_util.h",
"to_grpc_status.h",
]

bigtable_emulator_common_srcs = [
"cluster.cc",
"column_family.cc",
"filter.cc",
"range_set.cc",
"row_streamer.cc",
"server.cc",
"table.cc",
"test_util.cc",
"to_grpc_status.cc",
]
21 changes: 21 additions & 0 deletions google/cloud/bigtable/emulator/bigtable_emulator_programs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# DO NOT EDIT -- GENERATED BY CMake -- Change the CMakeLists.txt file if needed

"""Automatically generated unit tests list - DO NOT EDIT."""

bigtable_emulator_programs = [
"emulator.cc",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# DO NOT EDIT -- GENERATED BY CMake -- Change the CMakeLists.txt file if needed

"""Automatically generated source lists for bigtable_emulator_test_common - DO NOT EDIT."""

bigtable_emulator_test_common_hdrs = [
"test_util.h",
]

bigtable_emulator_test_common_srcs = [
"test_util.cc",
]
29 changes: 29 additions & 0 deletions google/cloud/bigtable/emulator/bigtable_emulator_unit_tests.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# DO NOT EDIT -- GENERATED BY CMake -- Change the CMakeLists.txt file if needed

"""Automatically generated unit tests list - DO NOT EDIT."""

bigtable_emulator_unit_tests = [
"column_family_test.cc",
"conditional_mutations_test.cc",
"drop_row_range_test.cc",
"filter_test.cc",
"filtered_map_test.cc",
"mutations_test.cc",
"range_set_test.cc",
"server_test.cc",
"table_test.cc",
]
71 changes: 71 additions & 0 deletions google/cloud/bigtable/emulator/cell_view.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_EMULATOR_CELL_VIEW_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_EMULATOR_CELL_VIEW_H

#include <absl/types/optional.h>
#include <chrono>
#include <functional>
#include <string>

namespace google {
namespace cloud {
namespace bigtable {
namespace emulator {

/**
* A class used to represent values when scanning a table.
*
* It is transient - it should never be stored as it only contains references to
* data which will likely become invalidated on first update.
*/
class CellView {
public:
CellView(std::string const& row_key, std::string const& column_family,
std::string const& column_qualifier,
std::chrono::milliseconds timestamp, std::string const& value)
: row_key_(row_key),
column_family_(column_family),
column_qualifier_(column_qualifier),
timestamp_(timestamp),
value_(value) {}

std::string const& row_key() const { return row_key_.get(); }
std::string const& column_family() const { return column_family_.get(); }
std::string const& column_qualifier() const {
return column_qualifier_.get();
}
std::chrono::milliseconds timestamp() const { return timestamp_; }
std::string const& value() const { return value_.get(); }
bool HasLabel() const { return label_.has_value(); }
std::string const& label() const { return label_.value().get(); }
void SetLabel(std::string const& label) { label_ = label; }
void SetValue(std::string const& value) { value_ = value; }

private:
std::reference_wrapper<std::string const> row_key_;
std::reference_wrapper<std::string const> column_family_;
std::reference_wrapper<std::string const> column_qualifier_;
std::chrono::milliseconds timestamp_;
std::reference_wrapper<std::string const> value_;
absl::optional<std::reference_wrapper<std::string const>> label_;
};

} // namespace emulator
} // namespace bigtable
} // namespace cloud
} // namespace google

#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_EMULATOR_CELL_VIEW_H
Loading
Loading