Commit 0921f02d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 82b85e36
......@@ -67,17 +67,22 @@ func TestLoad(t *testing.T) {
txh := txe.Header
// loadSerial
// TODO also test for getting error when not found
xid := zodb.Xid{zodb.XTid{txh.Tid, false}, txh.Oid}
checkLoad(t, fs, xid, oidLoadedOk{txh.Tid, txe.Data()})
// loadBefore
// TODO also test for getting error when not found
xid = zodb.Xid{zodb.XTid{txh.Tid, true}, txh.Oid}
expect, ok := before[txh.Oid]
// TODO also test for getting error when !ok
if ok {
checkLoad(t, fs, xid, expect)
}
// loadBefore to get current record
xid.Tid += 1
checkLoad(t, fs, xid, oidLoadedOk{txh.Tid, txe.Data()})
before[txh.Oid] = oidLoadedOk{txh.Tid, txe.Data()}
}
......
......@@ -137,13 +137,11 @@ type IStorage interface {
// XXX ^^^ ok ?
LastTid() Tid // XXX -> Tid, ok ?
// LoadSerial and LoadBefore generalized into 1 Load (see Xid for details)
// TODO data []byte -> something allocated from slab ?
Load(xid Xid) (data []byte, tid Tid, err error)
/* generalized ^^^
LoadBefore(oid Oid, beforeTid Tid) (data []byte, tid Tid, err error)
LoadSerial(oid Oid, serial Tid) (data []byte, err error)
*/
// -> Prefetch(xid Xid) ...
// PrefetchBefore(oidv []Oid, beforeTid Tid) 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