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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
19c56736
Commit
19c56736
authored
Feb 21, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a18daaa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
t/neo/storage/fs1/filestorage.go
t/neo/storage/fs1/filestorage.go
+1
-1
t/neo/zodb/zodb.go
t/neo/zodb/zodb.go
+14
-2
No files found.
t/neo/storage/fs1/filestorage.go
View file @
19c56736
...
...
@@ -139,7 +139,7 @@ func (e *ErrOidLoad) Error() string {
return
fmt
.
Sprintf
(
"loading oid %v: %v"
,
e
.
Oid
,
e
.
Err
)
}
func
(
fs
*
FileStorage
)
Load
Before
(
oid
zodb
.
Oid
,
beforeTid
zodb
.
T
id
)
(
data
[]
byte
,
tid
zodb
.
Tid
,
err
error
)
{
func
(
fs
*
FileStorage
)
Load
(
xid
zodb
.
X
id
)
(
data
[]
byte
,
tid
zodb
.
Tid
,
err
error
)
{
// lookup in index position of oid data record within latest transaction who changed this oid
dataPos
,
ok
:=
fs
.
index
.
Get
(
oid
)
if
!
ok
{
...
...
t/neo/zodb/zodb.go
View file @
19c56736
...
...
@@ -46,16 +46,28 @@ func (oid Oid) String() string {
return
fmt
.
Sprintf
(
"%016x"
,
uint64
(
oid
))
}
// XXX move me out of here
// XXX naming -> bint ?
func
bool2int
(
b
bool
)
int
{
if
b
{
return
1
}
else
{
return
0
}
}
func
(
xtid
XTid
)
String
()
string
{
// XXX also print "tid:" prefix ?
/*
s := ""
if xtid.TidBefore {
s = "<"
} else {
s = "="
}
*/
return
s
+
xtid
.
Tid
.
String
(
)
return
fmt
.
Sprintf
(
"%c%v"
,
"=<"
[
bool2int
(
xtid
.
TidBefore
)],
xtid
)
}
func
(
xid
Xid
)
String
()
string
{
...
...
@@ -134,7 +146,7 @@ type IStorage interface {
LastTid
()
Tid
// XXX -> Tid, ok ?
// TODO data []byte -> something allocated from slab ?
Load
(
x
oid
XO
id
)
(
data
[]
byte
,
tid
Tid
,
err
error
)
Load
(
x
id
X
id
)
(
data
[]
byte
,
tid
Tid
,
err
error
)
/* generalized ^^^
LoadBefore(oid Oid, beforeTid Tid) (data []byte, tid Tid, err error)
...
...
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