mirror of https://github.com/tikv/client-go.git
rawkv: split BatchPut and BatchPutTTL (#414)
Signed-off-by: disksing <i@disksing.com>
This commit is contained in:
parent
fe2def20bb
commit
13298f12fb
|
|
@ -113,7 +113,7 @@ func (s *testRawKVSuite) mustPut(key, value []byte) {
|
|||
}
|
||||
|
||||
func (s *testRawKVSuite) mustBatchPut(keys, values [][]byte) {
|
||||
err := s.client.BatchPut(context.Background(), keys, values, nil)
|
||||
err := s.client.BatchPut(context.Background(), keys, values)
|
||||
s.Nil(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -240,7 +240,12 @@ func (c *Client) Put(ctx context.Context, key, value []byte) error {
|
|||
}
|
||||
|
||||
// BatchPut stores key-value pairs to TiKV.
|
||||
func (c *Client) BatchPut(ctx context.Context, keys, values [][]byte, ttls []uint64) error {
|
||||
func (c *Client) BatchPut(ctx context.Context, keys, values [][]byte) error {
|
||||
return c.BatchPutWithTTL(ctx, keys, values, nil)
|
||||
}
|
||||
|
||||
// BatchPutWithTTL stores key-values pairs to TiKV with time-to-live durations.
|
||||
func (c *Client) BatchPutWithTTL(ctx context.Context, keys, values [][]byte, ttls []uint64) error {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metrics.RawkvCmdHistogramWithBatchPut.Observe(time.Since(start).Seconds())
|
||||
|
|
|
|||
Loading…
Reference in New Issue