Skip to content
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

Add a columnFamily feature for client-go when use rawput in tikv #424

Closed
joccau opened this issue Feb 20, 2022 · 4 comments · Fixed by #425 or #433
Closed

Add a columnFamily feature for client-go when use rawput in tikv #424

joccau opened this issue Feb 20, 2022 · 4 comments · Fixed by #425 or #433

Comments

@joccau
Copy link
Contributor

joccau commented Feb 20, 2022

About current rawKV API interface

  • It don't support specified columnFamily to put/get/delete and so on. Only support a default columnFamily to manipulate the TiKV by client-go API.

What I want to do

  • Create rawKV client firstly
    client := NewRawKVClient(...args)

  • If user do not specify columnFamily, Just put key-value into a default columnFamily.
    client.put(key, value)

  • If specify columnFamily for client, user can put key-value into this columnFamily.
    client.SetColumnFamily(cf string)
    client.put(key, value)

  • If specify columnFamily contained in options, user can put key-value into this columnFamily.
    func(c *client) put(key, value []byte, options... Option)
    client.put(key, value, SetColumnFamily(cf))

Why I want to enhance

We are developing the feature about backup/restore stream log currently. It observes the key-value records in TiKV layer during backup, and need to put these key-value records into TiKV by rawKV API in client layer during restore.

So we need put these key-value records stored in different columnFamily(default_cf and write_cf) by the RawKV APIs with columnFamily parameters.

@joccau
Copy link
Contributor Author

joccau commented Feb 20, 2022

/assign

@joccau
Copy link
Contributor Author

joccau commented Feb 20, 2022

/enhancement

joccau added a commit to joccau/client-go that referenced this issue Feb 20, 2022
Signed-off-by: joccau <zak.zhao@pingcap.com>
@zz-jason
Copy link
Member

could you ellobrate more about the use case of this feature?

@joccau
Copy link
Contributor Author

joccau commented Mar 2, 2022

could you ellobrate more about the use case of this feature?

As comments above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants