Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
adaaf7d8
Commit
adaaf7d8
authored
Jul 08, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
13e69c0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
go/zodb/storage/zeo/zeo.go
go/zodb/storage/zeo/zeo.go
+21
-3
No files found.
go/zodb/storage/zeo/zeo.go
View file @
adaaf7d8
...
...
@@ -92,7 +92,7 @@ func (z *zeo) _Load(ctx context.Context, xid zodb.Xid) (*mem.Buf, zodb.Tid, erro
}
// (data, serial, next_serial | None)
res
,
ok
:=
xres
.
(
pickle
.
Tuple
)
res
,
ok
:=
z
.
srv
.
asTuple
(
xres
)
if
!
ok
||
len
(
res
)
!=
3
{
return
nil
,
0
,
rpc
.
ereplyf
(
"got %#v; expect 3-tuple"
,
xres
)
}
...
...
@@ -422,8 +422,7 @@ func init() {
zodb
.
RegisterDriver
(
"zeo"
,
openByURL
)
}
// ---- oid/tid packing ----
// ---- data conversion with unified interface for Z/M encoding ----
// xuint64Unpack tries to decode packed 8-byte string as bigendian uint64
func
(
zl
*
zLink
)
xuint64Unpack
(
xv
interface
{})
(
uint64
,
bool
)
{
...
...
@@ -491,3 +490,22 @@ func (zl *zLink) oidUnpack(xv interface{}) (zodb.Oid, bool) {
v
,
ok
:=
zl
.
xuint64Unpack
(
xv
)
return
zodb
.
Oid
(
v
),
ok
}
// asTuple tries to decode object as tuple. XXX
func
(
zl
*
zLink
)
asTuple
(
xt
interface
{})
(
tuple
,
bool
)
{
switch
zl
.
encoding
{
default
:
panic
(
"bug"
)
case
'Z'
:
// pickle: tuples are represented by picklet.Tuple
t
,
ok
:=
xt
.
(
pickle
.
Tuple
)
return
tuple
(
t
),
ok
case
'M'
:
// msgpack: tuples are encoded as arrays; decoded as []interface{}
t
,
ok
:=
xt
.
([]
interface
{})
return
tuple
(
t
),
ok
}
}
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