Commit a3127b62 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ec815f60
...@@ -23,6 +23,8 @@ import ( ...@@ -23,6 +23,8 @@ import (
"strings" "strings"
"testing" "testing"
"unsafe" "unsafe"
"./zodb"
) )
// decode string as hex; panic on error // decode string as hex; panic on error
...@@ -192,9 +194,9 @@ func TestPktMarshal(t *testing.T) { ...@@ -192,9 +194,9 @@ func TestPktMarshal(t *testing.T) {
// map[Oid]struct {Tid,Tid,bool} // map[Oid]struct {Tid,Tid,bool}
{&AnswerObjectUndoSerial{ {&AnswerObjectUndoSerial{
ObjectTIDDict: map[Oid]struct{ ObjectTIDDict: map[zodb.Oid]struct{
CurrentSerial Tid CurrentSerial zodb.Tid
UndoSerial Tid UndoSerial zodb.Tid
IsCurrent bool IsCurrent bool
} { } {
1: {1, 0, false}, 1: {1, 0, false},
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Package zodb defines types and interfaces used in ZODB databases // Package zodb defines types and interfaces used in ZODB databases
// XXX partly based on ZODB/py
package zodb package zodb
// ZODB types // ZODB types
...@@ -27,8 +29,15 @@ const ( ...@@ -27,8 +29,15 @@ const (
// ---------------------------------------- // ----------------------------------------
// TxnStatus represents status of a transaction
type TxnStatus byte type TxnStatus byte
const (
TxnComplete TxnStatus = ' ' // completed transaction that hasn't been packed
TxnPacked = 'p' // completed transaction that has been packed
TxnInprogress = 'c' // checkpoint -- a transaction in progress; it's been thru vote() but not finish()
)
// TODO Tid.String(), Oid.String() +verbose, scanning (?) // TODO Tid.String(), Oid.String() +verbose, scanning (?)
// Information about single storage transaction // Information about single storage transaction
...@@ -59,13 +68,18 @@ type StorageRecordInformation struct { ...@@ -59,13 +68,18 @@ type StorageRecordInformation struct {
type IStorage interface { type IStorage interface {
Close() error Close() error
// TODO: // Name returns storage name
// Name() Name() string
// History(oid, size=1) // History(oid, size=1)
// LastTid()
// LoadBefore(oid Oid, beforeTid Tid) (data []bytes, tid Tid, err error) // LastTid returns the id of the last committed transaction.
// LoadSerial(oid Oid, serial Tid) (data []bytes, err error) // if not transactions have been committed yet, LastTid returns Tid zero value
// XXX ^^^ ok ?
LastTid() Tid // XXX -> Tid, ok ?
LoadBefore(oid Oid, beforeTid Tid) (data []byte, tid Tid, err error)
LoadSerial(oid Oid, serial Tid) (data []byte, err error)
// PrefetchBefore(oidv []Oid, beforeTid Tid) error (?) // PrefetchBefore(oidv []Oid, beforeTid Tid) error (?)
// Store(oid Oid, serial Tid, data []byte, txn ITransaction) error // Store(oid Oid, serial Tid, data []byte, txn ITransaction) error
......
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