Commit Graph

881 Commits

Author SHA1 Message Date
Yilin Chen bcf9e36e81
Address comments
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-19 17:23:08 +08:00
Yilin Chen 5638c419cb
Move requests to their own modules
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-19 14:53:48 +08:00
Yilin Chen 6f38474a3c
Use a more general name "Payload" instead of "KeyType"
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-19 13:19:31 +08:00
Yilin Chen ae1edeff3b
Merge branch 'master' into request-based-kv 2019-08-19 10:51:17 +08:00
Yilin Chen bcf73cdf34
Set verion in mvcc apis
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-15 11:55:53 +08:00
Yilin Chen 54b14b8caa
Merge pull request #97 from sticnarf/handle-mutations
Record mutations in transactions
2019-08-15 11:42:50 +08:00
Yilin Chen 236c510551 Merge branch 'handle-mutations' into request-based-kv 2019-08-15 10:47:12 +08:00
Yilin Chen c1751ac4b9
Address comments
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-15 10:45:44 +08:00
Yilin Chen 3f9960f308
Remove outdated comment
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-14 16:00:16 +08:00
Yilin Chen 893f26e9df
Remove mvcc apis of old style
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-14 15:51:00 +08:00
Yilin Chen 1c5ce3dddb Merge branch 'handle-mutations' into request-based-kv 2019-08-14 14:34:07 +08:00
Yilin Chen 388f7cfaac
Add tests for buffered mutations
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-14 14:09:09 +08:00
Yilin Chen a601c39c1f
batch_get returns an iterator
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-14 13:14:29 +08:00
Yilin Chen 332933fc9e
Add request based mvcc api
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-14 10:49:25 +08:00
Yilin Chen a74e1abd1a
Fix tests
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-12 14:08:49 +08:00
Yilin Chen 52e9cb2c15
Return HashMap in batch_get
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-12 13:48:24 +08:00
Yilin Chen 042eb000a2
Merge remote-tracking branch 'upstream/master' into handle-mutations
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-12 11:40:41 +08:00
Yilin Chen 8e9f33717c
Upgrade kvproto and futures
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-12 11:09:00 +08:00
Nick Cameron 8165adf1f9 Refactor into a request-style API (#87)
* Refactor the raw API to be command-oriented

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* WIP: provide mocks and use them for tests

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-08-09 07:53:55 -07:00
Yilin Chen ad49e78c29
Read from mutations in transactions
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-08 10:40:42 +08:00
Yilin Chen f79c8c57f0 Merge remote-tracking branch 'upstream/master' into handle-mutations 2019-08-06 18:54:31 +08:00
Yilin Chen 68cd7e6574
Merge pull request #96 from sticnarf/correct-transaction-api
Correct transaction api
2019-08-06 18:15:24 +08:00
Yilin Chen 60dc6a5af2 Merge branch 'master' into correct-transaction-api 2019-08-06 04:48:11 +00:00
Yilin Chen 2733e28ece
Merge pull request #92 from sticnarf/fix-tso
Use a new TSO client implementation
2019-08-06 12:29:28 +08:00
Yilin Chen e57767489f Merge branch 'fix-tso' into handle-mutations 2019-08-05 20:49:30 +08:00
Yilin Chen c64281fbd4 Refine some docs
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-05 20:44:45 +08:00
Yilin Chen 9f9c4ba71e Record mutations in the transaction
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-05 20:37:34 +08:00
Yilin Chen 67f741acb0 Merge branch 'fix-tso' into enable-async-await 2019-08-05 16:28:47 +08:00
Yilin Chen 31511aa9f0 Do some refactoring and add some more docs
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-05 16:04:38 +08:00
Yilin Chen aea6538919
Clarify that the abbreviation TSO refers to timestamp oracle
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 10:57:24 +08:00
Yilin Chen 8f6479b9ad
Address CI warnings and some comments
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 10:32:12 +08:00
Yilin Chen 3522d33696
Fix CI by changing PD_ADDR to PD_ADDRS
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 02:44:18 +08:00
Yilin Chen 52ea5dd600
Fix CI by changing PD_ADDR to PD_ADDRS
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 02:08:31 +08:00
Yilin Chen 463a03fc9b
Merge branch 'master' into fix-tso 2019-08-01 02:06:27 +08:00
Yilin Chen e652a6aeb4 Add a new TSO implementation
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 02:05:24 +08:00
Shirly 91bc7f637f
Use async/await in the transaction APIs (#91)
Use async/await in the transaction APIs
2019-07-31 17:05:50 +08:00
Yilin Chen 4ce0844280
Fix a clippy bug by upgrading toolchain version
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 16:38:16 +08:00
Yilin Chen ebcf7d4469
Address comments
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 16:10:32 +08:00
Yilin Chen 78fa34fd37 Remove explicit Futures for transaction
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 13:53:57 +08:00
Yilin Chen 94f080e269 Add integration tests for get TS
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 13:53:57 +08:00
Yilin Chen 5a0b6feddf Use async/await in the transaction APIs
After this commit, the library requires a nightly Rust compiler to build.

The required toolchain version is also updated in README.md and .travis.yml.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 13:53:57 +08:00
Yilin Chen b7a9441815
Merge pull request #88 from sticnarf/no-custom-timestamp
Replace begin_with_timestamp with snapshot_at
2019-07-31 11:44:08 +08:00
Yilin Chen 033e13da1a
Fix warnings
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-30 16:24:57 +08:00
Yilin Chen 934cce8785
Replace begin_with_timestamp with snapshot_at.
Users should not be able to begin a transaction with a custom timestamp.
If there were two transactions running with the same start TS, data could
be corrupted. However, a read-only snapshot with a custom timestamp is OK.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-30 15:40:08 +08:00
Nick Cameron 010fd4bea0 test group_tasks_by_region (#86)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-25 11:22:01 -07:00
Brian Anderson abc39fe10f
Merge pull request #85 from nrc/deps
Update deps and fix the build
2019-07-24 12:36:40 -07:00
Nick Cameron 800d3b02dc Update deps and fix the build
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-25 07:07:50 +12:00
Nick Cameron b66a310ecf Implement a unit test by mocking lower level clients (#81)
* Move Contexts from rpc/client to rpc

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Refactor rpc/pd

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add a test for `RpcClient::kv_client`

This serves as a template for a testing strategy using mocks. This commit abstracts
and mocks the PdClient, then uses that to mock the RpcClient and thus test `kv_client`.
The test itself is not too interesting.

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-23 15:01:16 -07:00
Yilin Chen c13f63398e Upgrade rustc version to solve cargo doc failure (#83)
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-16 11:05:32 -07:00
Nick Cameron 7bc06c062b
Merge pull request #80 from nrc/kv-ref-into
Don't implement From<&'static str> for Key and Value
2019-07-12 15:18:19 +12:00