Commit 74e02634 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f68398c9
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
package main package main
// diff for BTree // diff for BTree
// XXX move -> btree? (needs generics)
// XXX doc
// FIXME the algorythm is different: recursion is implemented by expanding rangeSplit step by step. // FIXME the algorythm is different: recursion is implemented by expanding rangeSplit step by step.
// //
...@@ -69,16 +71,45 @@ package main ...@@ -69,16 +71,45 @@ package main
// . -k(blk) -> invalidate #blk // . -k(blk) -> invalidate #blk
// . +k(blk) -> invalidate #blk (e.g. if blk was previously read as hole) // . +k(blk) -> invalidate #blk (e.g. if blk was previously read as hole)
//go:generate ./gen-set main Oid Oid zset_oid.go
import ( import (
"context" "context"
"math"
"fmt" "fmt"
"reflect" "reflect"
"sort" "sort"
"lab.nexedi.com/kirr/go123/xerr" "lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/neo/go/zodb" "lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb/btree"
) )
type Tree = btree.LOBTree
type Bucket = btree.LOBucket
type Node = btree.LONode
type TreeEntry = btree.LOEntry
type BucketEntry = btree.LOBucketEntry
type Key = int64
const KeyMax Key = math.MaxInt64
const KeyMin Key = math.MinInt64
// value is assumed to be persistent reference.
// deletion is represented as VDEL.
type Value = zodb.Oid
const VDEL = zodb.InvalidOid
// ΔValue represents change in value.
type ΔValue struct {
Old Value
New Value
}
type Oid = zodb.Oid
type SetKey = SetI64
// treeSetKey represents ordered set of keys. // treeSetKey represents ordered set of keys.
// it can be point-queried and range-accessed. // it can be point-queried and range-accessed.
......
...@@ -22,47 +22,16 @@ package main ...@@ -22,47 +22,16 @@ package main
// TODO move -> btree when ΔTail matures. // TODO move -> btree when ΔTail matures.
// XXX doc // XXX doc
//go:generate ./gen-set main Oid Oid zset_oid.go
import ( import (
"context" "context"
"math"
"sort" "sort"
"strings" "strings"
"lab.nexedi.com/kirr/go123/xerr" "lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/neo/go/transaction" "lab.nexedi.com/kirr/neo/go/transaction"
"lab.nexedi.com/kirr/neo/go/zodb" "lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb/btree"
) )
type Tree = btree.LOBTree
type Bucket = btree.LOBucket
type Node = btree.LONode
type TreeEntry = btree.LOEntry
type BucketEntry = btree.LOBucketEntry
type Key = int64
const KeyMax Key = math.MaxInt64
const KeyMin Key = math.MinInt64
// value is assumed to be persistent reference.
// deletion is represented as VDEL.
type Value = zodb.Oid
const VDEL = zodb.InvalidOid
type Oid = zodb.Oid
type SetKey = SetI64
// ΔValue represents change in value.
type ΔValue struct {
Old Value
New Value
}
// ΔBtail represents tail of revisional changes to BTrees. // ΔBtail represents tail of revisional changes to BTrees.
// //
// It semantically consists of // It semantically consists of
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment