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

.

parent 355ffc66
......@@ -13,15 +13,8 @@ const (
INVALID_TID zodb.Tid = 1<<64 - 1 // 0xffffffffffffffff
INVALID_OID zodb.Oid = 1<<64 - 1
// XXX vvv move to ZODB ?
ZERO_TID zodb.Tid = 0 // XXX or simply TID{} ?
TID0 zodb.Tid = ZERO_TID // XXX ^^^ choose 1
// // XXX vvv move to ZODB ?
ZERO_OID zodb.Oid = 0 // XXX or simply OID{} ? // XXX -> OID0
// OID_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
import (
"os"
. "../"
"../zodb"
)
type FileStorage struct {
......@@ -13,12 +13,12 @@ type FileStorage struct {
}
// IStorage
var _ IStorage = (*FileStorage)(nil)
var _ zodb.IStorage = (*FileStorage)(nil)
type TxnRecHead struct {
Tid Tid
Tid zodb.Tid
RecLenm8 uint64
Status TxnStatus
Status zodb.TxnStatus
//UserLen uint16
//DescriptionLen uint16
//ExtensionLen uint16
......@@ -30,8 +30,8 @@ type TxnRecHead struct {
}
type DataRec struct {
Oid Oid
Tid Tid
Oid zodb.Oid
Tid zodb.Tid
PrevDataRecPos uint64 // previous-record file-position
TxnPos uint64 // beginning of transaction record file position
// 2-bytes with zero values. (Was version length.)
......@@ -70,8 +70,8 @@ func (f *FileStorage) Close() error {
return nil
}
func (f *FileStorage) Iterate(start, stop Tid) IStorageIterator {
if start != TID0 || stop != TIDMAX {
func (f *FileStorage) Iterate(start, stop zodb.Tid) zodb.IStorageIterator {
if start != zodb.Tid0 || stop != zodb.TidMax {
panic("TODO start/stop support")
}
......
......@@ -8,7 +8,7 @@
package b
import "zodb"
import "../../../zodb"
import (
"fmt"
......
......@@ -14,7 +14,7 @@ echo "// KEY=$KEY VALUE=$VALUE" >>$out
echo "// ---- 8< ----" >>$out
echo >>$out
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/VALUE/$VALUE/g" \
>>$out
......@@ -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
......
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