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
a3127b62
Commit
a3127b62
authored
Feb 20, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ec815f60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
t/neo/proto_test.go
t/neo/proto_test.go
+5
-3
t/neo/zodb/zodb.go
t/neo/zodb/zodb.go
+19
-5
No files found.
t/neo/proto_test.go
View file @
a3127b62
...
@@ -23,6 +23,8 @@ import (
...
@@ -23,6 +23,8 @@ import (
"strings"
"strings"
"testing"
"testing"
"unsafe"
"unsafe"
"./zodb"
)
)
// decode string as hex; panic on error
// decode string as hex; panic on error
...
@@ -192,9 +194,9 @@ func TestPktMarshal(t *testing.T) {
...
@@ -192,9 +194,9 @@ func TestPktMarshal(t *testing.T) {
// map[Oid]struct {Tid,Tid,bool}
// map[Oid]struct {Tid,Tid,bool}
{
&
AnswerObjectUndoSerial
{
{
&
AnswerObjectUndoSerial
{
ObjectTIDDict
:
map
[
Oid
]
struct
{
ObjectTIDDict
:
map
[
zodb
.
Oid
]
struct
{
CurrentSerial
Tid
CurrentSerial
zodb
.
Tid
UndoSerial
Tid
UndoSerial
zodb
.
Tid
IsCurrent
bool
IsCurrent
bool
}
{
}
{
1
:
{
1
,
0
,
false
},
1
:
{
1
,
0
,
false
},
...
...
t/neo/zodb/zodb.go
View file @
a3127b62
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
// Package zodb defines types and interfaces used in ZODB databases
// Package zodb defines types and interfaces used in ZODB databases
// XXX partly based on ZODB/py
package
zodb
package
zodb
// ZODB types
// ZODB types
...
@@ -27,8 +29,15 @@ const (
...
@@ -27,8 +29,15 @@ const (
// ----------------------------------------
// ----------------------------------------
// TxnStatus represents status of a transaction
type
TxnStatus
byte
type
TxnStatus
byte
const
(
TxnComplete
TxnStatus
=
' '
// completed transaction that hasn't been packed
TxnPacked
=
'p'
// completed transaction that has been packed
TxnInprogress
=
'c'
// checkpoint -- a transaction in progress; it's been thru vote() but not finish()
)
// TODO Tid.String(), Oid.String() +verbose, scanning (?)
// TODO Tid.String(), Oid.String() +verbose, scanning (?)
// Information about single storage transaction
// Information about single storage transaction
...
@@ -59,13 +68,18 @@ type StorageRecordInformation struct {
...
@@ -59,13 +68,18 @@ type StorageRecordInformation struct {
type
IStorage
interface
{
type
IStorage
interface
{
Close
()
error
Close
()
error
// TODO:
// Name returns storage name
// Name()
Name
()
string
// History(oid, size=1)
// History(oid, size=1)
// LastTid()
// LoadBefore(oid Oid, beforeTid Tid) (data []bytes, tid Tid, err error)
// LastTid returns the id of the last committed transaction.
// LoadSerial(oid Oid, serial Tid) (data []bytes, err error)
// if not transactions have been committed yet, LastTid returns Tid zero value
// XXX ^^^ ok ?
LastTid
()
Tid
// XXX -> Tid, ok ?
LoadBefore
(
oid
Oid
,
beforeTid
Tid
)
(
data
[]
byte
,
tid
Tid
,
err
error
)
LoadSerial
(
oid
Oid
,
serial
Tid
)
(
data
[]
byte
,
err
error
)
// PrefetchBefore(oidv []Oid, beforeTid Tid) error (?)
// PrefetchBefore(oidv []Oid, beforeTid Tid) error (?)
// Store(oid Oid, serial Tid, data []byte, txn ITransaction) error
// Store(oid Oid, serial Tid, data []byte, txn ITransaction) 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