Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
428eb133
Commit
428eb133
authored
Nov 20, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
467c573c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
go/zodb/buffer.go
go/zodb/buffer.go
+1
-1
go/zodb/open.go
go/zodb/open.go
+2
-2
go/zodb/zodbtools/catobj.go
go/zodb/zodbtools/catobj.go
+5
-2
No files found.
go/zodb/buffer.go
View file @
428eb133
...
@@ -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.
...
...
go/zodb/open.go
View file @
428eb133
...
@@ -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
,
"://"
)
{
...
...
go/zodb/zodbtools/catobj.go
View file @
428eb133
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment