mirror of https://github.com/tikv/client-go.git
57 lines
2.4 KiB
Go
57 lines
2.4 KiB
Go
// Copyright 2021 TiKV Authors
|
|
//
|
|
// 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
|
|
//
|
|
// http://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.
|
|
|
|
// NOTE: The code in this file is based on code from the
|
|
// TiDB project, licensed under the Apache License v 2.0
|
|
//
|
|
// https://github.com/pingcap/tidb/tree/cc5e161ac06827589c4966674597c137cc9e809c/store/tikv/txn.go
|
|
//
|
|
|
|
// Copyright 2016 PingCAP, Inc.
|
|
//
|
|
// 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
|
|
//
|
|
// http://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.
|
|
|
|
package tikv
|
|
|
|
import "github.com/tikv/client-go/v2/internal/unionstore"
|
|
|
|
// Getter is the interface for the Get method.
|
|
type Getter = unionstore.Getter
|
|
|
|
// Iterator is the interface for a iterator on KV store.
|
|
type Iterator = unionstore.Iterator
|
|
|
|
// MemDB is rollbackable Red-Black Tree optimized for transaction states buffer use scenario.
|
|
// You can think MemDB is a combination of two separate tree map, one for key => value and another for key => keyFlags.
|
|
//
|
|
// The value map is rollbackable, that means you can use the `Staging`, `Release` and `Cleanup` API to safely modify KVs.
|
|
//
|
|
// The flags map is not rollbackable. There are two types of flag, persistent and non-persistent.
|
|
// When discarding a newly added KV in `Cleanup`, the non-persistent flags will be cleared.
|
|
// If there are persistent flags associated with key, we will keep this key in node without value.
|
|
type MemDB = unionstore.MemDB
|
|
|
|
// MemDBCheckpoint is the checkpoint of memory DB.
|
|
type MemDBCheckpoint = unionstore.MemDBCheckpoint
|