Commit 1395e9a5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 355ffc66
...@@ -13,15 +13,8 @@ const ( ...@@ -13,15 +13,8 @@ const (
INVALID_TID zodb.Tid = 1<<64 - 1 // 0xffffffffffffffff INVALID_TID zodb.Tid = 1<<64 - 1 // 0xffffffffffffffff
INVALID_OID zodb.Oid = 1<<64 - 1 INVALID_OID zodb.Oid = 1<<64 - 1
// XXX vvv move to ZODB ? // // XXX vvv move to ZODB ?
ZERO_TID zodb.Tid = 0 // XXX or simply TID{} ?
TID0 zodb.Tid = ZERO_TID // XXX ^^^ choose 1
ZERO_OID zodb.Oid = 0 // XXX or simply OID{} ? // XXX -> OID0 ZERO_OID zodb.Oid = 0 // XXX or simply OID{} ? // XXX -> OID0
// OID_LEN = 8 // OID_LEN = 8
// TID_LEN = 8 // TID_LEN = 8
MAX_TID zodb.Tid = 1<<63 - 1 // 0x7fffffffffffffff
// SQLite does not accept numbers above 2^63-1
// ZODB also defines maxtid to be max signed int64 since baee84a6 (Jun 7 2016)
TIDMAX zodb.Tid = MAX_TID // XXX ^^^ choose 1
) )
...@@ -5,7 +5,7 @@ package storage ...@@ -5,7 +5,7 @@ package storage
import ( import (
"os" "os"
. "../" "../zodb"
) )
type FileStorage struct { type FileStorage struct {
...@@ -13,12 +13,12 @@ type FileStorage struct { ...@@ -13,12 +13,12 @@ type FileStorage struct {
} }
// IStorage // IStorage
var _ IStorage = (*FileStorage)(nil) var _ zodb.IStorage = (*FileStorage)(nil)
type TxnRecHead struct { type TxnRecHead struct {
Tid Tid Tid zodb.Tid
RecLenm8 uint64 RecLenm8 uint64
Status TxnStatus Status zodb.TxnStatus
//UserLen uint16 //UserLen uint16
//DescriptionLen uint16 //DescriptionLen uint16
//ExtensionLen uint16 //ExtensionLen uint16
...@@ -30,8 +30,8 @@ type TxnRecHead struct { ...@@ -30,8 +30,8 @@ type TxnRecHead struct {
} }
type DataRec struct { type DataRec struct {
Oid Oid Oid zodb.Oid
Tid Tid Tid zodb.Tid
PrevDataRecPos uint64 // previous-record file-position PrevDataRecPos uint64 // previous-record file-position
TxnPos uint64 // beginning of transaction record file position TxnPos uint64 // beginning of transaction record file position
// 2-bytes with zero values. (Was version length.) // 2-bytes with zero values. (Was version length.)
...@@ -70,8 +70,8 @@ func (f *FileStorage) Close() error { ...@@ -70,8 +70,8 @@ func (f *FileStorage) Close() error {
return nil return nil
} }
func (f *FileStorage) Iterate(start, stop Tid) IStorageIterator { func (f *FileStorage) Iterate(start, stop zodb.Tid) zodb.IStorageIterator {
if start != TID0 || stop != TIDMAX { if start != zodb.Tid0 || stop != zodb.TidMax {
panic("TODO start/stop support") panic("TODO start/stop support")
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
package b package b
import "zodb" import "../../../zodb"
import ( import (
"fmt" "fmt"
......
...@@ -14,7 +14,7 @@ echo "// KEY=$KEY VALUE=$VALUE" >>$out ...@@ -14,7 +14,7 @@ echo "// KEY=$KEY VALUE=$VALUE" >>$out
echo "// ---- 8< ----" >>$out echo "// ---- 8< ----" >>$out
echo >>$out echo >>$out
make -s -C $Bdir generic |sed \ make -s -C $Bdir generic |sed \
-e '/package b/a \\nimport "zodb"' \ -e '/package b/a \\nimport "../../../zodb"' \
-e "s/KEY/$KEY/g" \ -e "s/KEY/$KEY/g" \
-e "s/VALUE/$VALUE/g" \ -e "s/VALUE/$VALUE/g" \
>>$out >>$out
...@@ -16,6 +16,13 @@ type Xid struct { ...@@ -16,6 +16,13 @@ type Xid struct {
} }
*/ */
const (
Tid0 Tid = 0
TidMax Tid = 1<<63 - 1 // 0x7fffffffffffffff
// ZODB defines maxtid to be max signed int64 since baee84a6 (Jun 7 2016)
// (XXX in neo: SQLite does not accept numbers above 2^63-1)
)
// ---------------------------------------- // ----------------------------------------
type TxnStatus byte type TxnStatus byte
......
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