-
Notifications
You must be signed in to change notification settings - Fork 131
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
Introduce KeySpace interface for API v2. #353
Open
iosmanthus
wants to merge
46
commits into
tikv:master
Choose a base branch
from
iosmanthus:api-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
1f314ee
fix type checking for new interface
iosmanthus aa6e4b5
cargo fmt
iosmanthus 222908e
git fire: changing sig for PdRpcClient
iosmanthus 605aed8
fix TxnApiV1 test
iosmanthus 9164cf0
fix all tests for API v1
iosmanthus 7668c37
fix integration tests for API v1
iosmanthus dd1c7b9
remove specification feature
iosmanthus 60585f6
resolve conflict from master
iosmanthus 3a0df00
reduce type annotation
iosmanthus 7c3de1a
recover impl Trait for resolve_locks*
iosmanthus 02377b7
git fire!: wip api v2
iosmanthus 59002d1
impl KeyspaceCodec, along with RawKeyspaceCodec and TxnKeyspaceCodec
iosmanthus a440794
fix fmt check
iosmanthus 0a72d31
rename request_codec.rs to codec.rs
iosmanthus 19c3123
git fire!: wip impl RequestCodec for requests
iosmanthus 624c68e
impl KvRequest for raw requests
iosmanthus 71af50d
cargo fmt
iosmanthus a5f326f
impl KvRequest for txn requests
iosmanthus 5efbc12
make check
iosmanthus b534cfd
impl Default for KeyspaceId
iosmanthus 434e10d
cargo fmt
iosmanthus 317116b
decode in place
iosmanthus 5c5809a
introduce impl_kv_request to simplify code
iosmanthus 701964d
refactor impl_kv_request macro
iosmanthus db38d95
fix tests
iosmanthus 3660ca1
move default impl into RequestCodecExt
iosmanthus 7d68247
fix api version context
iosmanthus 81cbddd
move request codec into raw/txn owned module
iosmanthus 5bd0f6e
fix doc test
iosmanthus 1c1ce17
fix wrong TxnCodec mark trait for raw::Keyspace
iosmanthus 051a157
refactor ApiVx with Mode generic para
iosmanthus 159de5c
Merge branch 'master' of github.com:tikv/client-rust into api-v2
iosmanthus bfd1f28
remove dynamic dispatch while encoding request in Dispatch
iosmanthus 7fc61ea
make IsDefault private in crate
iosmanthus 6baaa94
remove impl Deref for Key
iosmanthus 07c7af7
fix potential index out of range while meets corrupted keyspace prefix
iosmanthus 0ed902d
introduce codec type parameter for Snapshot and Transcation
iosmanthus 182a457
bound Client to right codec
iosmanthus 0e76e10
fix encode range issue with unbound end
iosmanthus 0c3c9e3
Merge branch 'master' of github.com:tikv/client-rust into api-v2
iosmanthus f46cea8
introduce newer version of proto
iosmanthus 130e1b0
git fire: impl load keyspace
iosmanthus 3819c8a
introduce keyspace mgr from keyspace service
iosmanthus a2047eb
fix clippy
iosmanthus 45af3c5
refine trait bound of raw::Client
iosmanthus 9de6f50
remove phatom of txn::Client
iosmanthus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,8 +66,9 @@ | |
//! # use tikv_client::{RawClient, Result}; | ||
//! # use futures::prelude::*; | ||
//! # fn main() -> Result<()> { | ||
//! # futures::executor::block_on(async { | ||
//! let client = RawClient::new(vec!["127.0.0.1:2379"], None).await?; | ||
//! # use tikv_client::request::request_codec::RawApiV1; | ||
//! futures::executor::block_on(async { | ||
//! let client = RawClient::new(vec!["127.0.0.1:2379"], RawApiV1, None).await?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might break the original API, we should add a default implementation for API V1. |
||
//! client.put("key".to_owned(), "value".to_owned()).await?; | ||
//! let value = client.get("key".to_owned()).await?; | ||
//! # Ok(()) | ||
|
@@ -80,8 +81,9 @@ | |
//! # use tikv_client::{TransactionClient, Result}; | ||
//! # use futures::prelude::*; | ||
//! # fn main() -> Result<()> { | ||
//! # futures::executor::block_on(async { | ||
//! let txn_client = TransactionClient::new(vec!["127.0.0.1:2379"], None).await?; | ||
//! # use tikv_client::request::request_codec::TxnApiV1; | ||
//! futures::executor::block_on(async { | ||
//! let txn_client = TransactionClient::new(vec!["127.0.0.1:2379"], TxnApiV1, None).await?; | ||
//! let mut txn = txn_client.begin_optimistic().await?; | ||
//! txn.put("key".to_owned(), "value".to_owned()).await?; | ||
//! let value = txn.get("key".to_owned()).await?; | ||
|
@@ -124,6 +126,8 @@ pub use crate::backoff::Backoff; | |
#[doc(inline)] | ||
pub use crate::kv::{BoundRange, IntoOwnedRange, Key, KvPair, Value}; | ||
#[doc(inline)] | ||
pub use crate::pd::PdClient; | ||
#[doc(inline)] | ||
pub use crate::raw::{lowering as raw_lowering, Client as RawClient, ColumnFamily}; | ||
#[doc(inline)] | ||
pub use crate::request::RetryOptions; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Client
itself can tell we are using TxnKV already, can we hide things like TxnApiV1, TxnApiV2, RawApiV1, RawApiV2. Just let user chose the appropriate client and use ApiV1 or ApiV2.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may reexport them in their own module, like:
raw::ApiV1
,txn::ApiV1