Commit 428eb133 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 467c573c
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
"lab.nexedi.com/kirr/go123/xmath" "lab.nexedi.com/kirr/go123/xmath"
) )
// Buf represents memory buffer. // Buf is reference-counted memory buffer.
// //
// To lower pressure on Go garbage-collector allocate buffers with BufAlloc and // To lower pressure on Go garbage-collector allocate buffers with BufAlloc and
// free them with Buf.Release. // free them with Buf.Release.
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// See https://www.nexedi.com/licensing for rationale and options. // See https://www.nexedi.com/licensing for rationale and options.
package zodb package zodb
// logic to open storages by URL // open storages by URL
import ( import (
"context" "context"
...@@ -55,7 +55,7 @@ func RegisterStorage(scheme string, opener StorageOpener) { ...@@ -55,7 +55,7 @@ func RegisterStorage(scheme string, opener StorageOpener) {
// //
// Storage authors should register their storages with RegisterStorage. // Storage authors should register their storages with RegisterStorage.
// //
// TODO automatically wrap a storage with Cache. // TODO automatically wrap opened storage with Cache.
func OpenStorage(ctx context.Context, storageURL string, opt *OpenOptions) (IStorage, error) { func OpenStorage(ctx context.Context, storageURL string, opt *OpenOptions) (IStorage, error) {
// no scheme -> file:// // no scheme -> file://
if !strings.Contains(storageURL, "://") { if !strings.Contains(storageURL, "://") {
......
...@@ -43,7 +43,10 @@ func Catobj(ctx context.Context, w io.Writer, stor zodb.IStorage, xid zodb.Xid) ...@@ -43,7 +43,10 @@ func Catobj(ctx context.Context, w io.Writer, stor zodb.IStorage, xid zodb.Xid)
_, err = w.Write(buf.Data) // NOTE deleted data are returned as err by Load _, err = w.Write(buf.Data) // NOTE deleted data are returned as err by Load
buf.Release() buf.Release()
return err // XXX err ctx ? if err != nil {
err = fmt.Errorf("%s: catobj %s: %s", stor.URL(), xid, err)
}
return err
} }
// Dumpobj dumps content of one ZODB object with zodbdump-like header // Dumpobj dumps content of one ZODB object with zodbdump-like header
...@@ -55,7 +58,7 @@ func Dumpobj(ctx context.Context, w io.Writer, stor zodb.IStorage, xid zodb.Xid, ...@@ -55,7 +58,7 @@ func Dumpobj(ctx context.Context, w io.Writer, stor zodb.IStorage, xid zodb.Xid,
return err return err
} }
// XXX hack - TODO rework IStorage.Load to fill-in objInfo directly // XXX hack - TODO rework IStorage.Load to fill-in objInfo directly?
objInfo.Oid = xid.Oid objInfo.Oid = xid.Oid
objInfo.Tid = tid objInfo.Tid = tid
objInfo.Data = buf.Data objInfo.Data = buf.Data
......
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