mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc: Remove unused revisions and change comment rev to modified
Signed-off-by: Hongfei Huang <853885165@qq.com>
This commit is contained in:
parent
2b17db8e17
commit
3b585e94fc
@ -37,7 +37,7 @@ var (
|
|||||||
// For example: put(1.0);put(2.0);tombstone(3.0);put(4.0);tombstone(5.0) on key "foo"
|
// For example: put(1.0);put(2.0);tombstone(3.0);put(4.0);tombstone(5.0) on key "foo"
|
||||||
// generate a keyIndex:
|
// generate a keyIndex:
|
||||||
// key: "foo"
|
// key: "foo"
|
||||||
// rev: 5
|
// modified: 5
|
||||||
// generations:
|
// generations:
|
||||||
// {empty}
|
// {empty}
|
||||||
// {4.0, 5.0(t)}
|
// {4.0, 5.0(t)}
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
|
|
||||||
func TestKeyIndexGet(t *testing.T) {
|
func TestKeyIndexGet(t *testing.T) {
|
||||||
// key: "foo"
|
// key: "foo"
|
||||||
// rev: 16
|
// modified: 16
|
||||||
// generations:
|
// generations:
|
||||||
// {empty}
|
// {empty}
|
||||||
// {{14, 0}[1], {14, 1}[2], {16, 0}(t)[3]}
|
// {{14, 0}[1], {14, 1}[2], {16, 0}(t)[3]}
|
||||||
@ -680,7 +680,7 @@ func TestGenerationWalk(t *testing.T) {
|
|||||||
|
|
||||||
func newTestKeyIndex(lg *zap.Logger) *keyIndex {
|
func newTestKeyIndex(lg *zap.Logger) *keyIndex {
|
||||||
// key: "foo"
|
// key: "foo"
|
||||||
// rev: 16
|
// modified: 16
|
||||||
// generations:
|
// generations:
|
||||||
// {empty}
|
// {empty}
|
||||||
// {{14, 0}[1], {14, 1}[2], {16, 0}(t)[3]}
|
// {{14, 0}[1], {14, 1}[2], {16, 0}(t)[3]}
|
||||||
|
@ -59,9 +59,3 @@ func bytesToRev(bytes []byte) revision {
|
|||||||
sub: int64(binary.BigEndian.Uint64(bytes[9:])),
|
sub: int64(binary.BigEndian.Uint64(bytes[9:])),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type revisions []revision
|
|
||||||
|
|
||||||
func (a revisions) Len() int { return len(a) }
|
|
||||||
func (a revisions) Less(i, j int) bool { return a[j].GreaterThan(a[i]) }
|
|
||||||
func (a revisions) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user