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
e72a5d80
Commit
e72a5d80
authored
Feb 23, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
53b772dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
13 deletions
+30
-13
t/neo/storage/fs1/filestorage.go
t/neo/storage/fs1/filestorage.go
+1
-1
t/neo/storage/fs1/filestorage_test.go
t/neo/storage/fs1/filestorage_test.go
+14
-0
t/neo/zodb/zodb.go
t/neo/zodb/zodb.go
+15
-12
No files found.
t/neo/storage/fs1/filestorage.go
View file @
e72a5d80
...
@@ -249,7 +249,7 @@ func (fs *FileStorage) StorageName() string {
...
@@ -249,7 +249,7 @@ func (fs *FileStorage) StorageName() string {
}
}
func
(
fs
*
FileStorage
)
Iterate
(
tidMin
,
tidMax
zodb
.
Tid
)
zodb
.
IStorageIterator
{
func
(
fs
*
FileStorage
)
Iterate
(
tidMin
,
tidMax
zodb
.
Tid
)
zodb
.
IStorageIterator
{
if
tidMin
!=
zodb
.
Tid
0
||
tidMax
!=
zodb
.
TidMax
{
if
tidMin
!=
zodb
.
Tid
(
0
)
||
tidMax
!=
zodb
.
TidMax
{
panic
(
"TODO tidMin/tidMax support"
)
panic
(
"TODO tidMin/tidMax support"
)
}
}
...
...
t/neo/storage/fs1/filestorage_test.go
View file @
e72a5d80
...
@@ -108,6 +108,20 @@ func TestLoad(t *testing.T) {
...
@@ -108,6 +108,20 @@ func TestLoad(t *testing.T) {
if
tidMin
>
tidMax
{
if
tidMin
>
tidMax
{
// expect error / panic or empty iteration ?
// expect error / panic or empty iteration ?
}
}
txni
:=
zodb
.
TxnInfo
{}
datai
:=
zodb
.
StorageRecordInformation
{}
for
{
ok
,
err
:=
iter
.
NextTxn
(
&
txni
)
if
err
!=
nil
{
panic
(
err
)
// XXX err
}
if
!
ok
{
break
}
}
}
}
}
}
}
}
t/neo/zodb/zodb.go
View file @
e72a5d80
...
@@ -21,19 +21,19 @@ type XTid struct {
...
@@ -21,19 +21,19 @@ type XTid struct {
TidBefore
bool
// XXX merge into Tid itself (high bit) ?
TidBefore
bool
// XXX merge into Tid itself (high bit) ?
}
}
// Xid is "extended" oid
-
oid + serial/beforeTid, completely specifying object revision XXX text
// Xid is "extended" oid
=
oid + serial/beforeTid, completely specifying object revision XXX text
type
Xid
struct
{
type
Xid
struct
{
XTid
XTid
Oid
Oid
}
}
const
(
const
(
Tid0
Tid
=
0
// XXX or
simply Tid(0) ?
//Tid0 Tid = 0 // XXX ->
simply Tid(0) ?
TidMax
Tid
=
1
<<
63
-
1
// 0x7fffffffffffffff
TidMax
Tid
=
1
<<
63
-
1
// 0x7fffffffffffffff
// ZODB defines maxtid to be max signed int64 since baee84a6 (Jun 7 2016)
// ZODB defines maxtid to be max signed int64 since baee84a6 (Jun 7 2016)
// (XXX in neo: SQLite does not accept numbers above 2^63-1)
// (XXX in neo: SQLite does not accept numbers above 2^63-1)
Oid0
Oid
=
0
//Oid0 Oid = 0 // XXX -> simply Oid(0)
)
)
func
(
tid
Tid
)
String
()
string
{
func
(
tid
Tid
)
String
()
string
{
...
@@ -62,7 +62,7 @@ func (xtid XTid) String() string {
...
@@ -62,7 +62,7 @@ func (xtid XTid) String() string {
}
}
func
(
xid
Xid
)
String
()
string
{
func
(
xid
Xid
)
String
()
string
{
return
xid
.
XTid
.
String
()
+
":"
+
xid
.
Oid
.
String
()
return
xid
.
XTid
.
String
()
+
":"
+
xid
.
Oid
.
String
()
// XXX use "·" instead of ":" ?
}
}
// ----------------------------------------
// ----------------------------------------
...
@@ -83,7 +83,7 @@ type ErrXidMissing struct {
...
@@ -83,7 +83,7 @@ type ErrXidMissing struct {
}
}
func
(
e
*
ErrXidMissing
)
Error
()
string
{
func
(
e
*
ErrXidMissing
)
Error
()
string
{
return
fmt
.
Sprintf
(
"%v: no matching data record found"
,
e
.
Xid
)
// XXX ok?
return
fmt
.
Sprintf
(
"%v: no matching data record found"
,
e
.
Xid
)
}
}
// ----------------------------------------
// ----------------------------------------
...
@@ -97,12 +97,11 @@ const (
...
@@ -97,12 +97,11 @@ const (
TxnInprogress
=
'c'
// checkpoint -- a transaction in progress; it's been thru vote() but not finish()
TxnInprogress
=
'c'
// checkpoint -- a transaction in progress; it's been thru vote() but not finish()
)
)
// TODO Tid.String(), Oid.String() +verbose, scanning (?)
// Information about single transaction
// Information about single storage transaction
// XXX -> storage.ITransactionInformation
// XXX -> storage.ITransactionInformation
//type IStorageTransactionInformation interface {
//type IStorageTransactionInformation interface {
type
StorageTransactionInformation
struct
{
//type StorageTransactionInformation struct {
type
TxnInfo
struct
{
Tid
Tid
Tid
Tid
Status
TxnStatus
Status
TxnStatus
User
[]
byte
User
[]
byte
...
@@ -114,6 +113,7 @@ type StorageTransactionInformation struct {
...
@@ -114,6 +113,7 @@ type StorageTransactionInformation struct {
}
}
// Information about single storage record
// Information about single storage record
// XXX naming
type
StorageRecordInformation
struct
{
type
StorageRecordInformation
struct
{
Oid
Oid
Oid
Oid
Tid
Tid
Tid
Tid
...
@@ -157,10 +157,13 @@ type IStorage interface {
...
@@ -157,10 +157,13 @@ type IStorage interface {
}
}
type
IStorageIterator
interface
{
type
IStorageIterator
interface
{
Next
()
(
*
StorageTransactionInformation
,
error
)
// XXX -> NextTxn() ?
// NextTxn puts information about next storage transaction into *txnInfo.
// data put into *txnInfo stays valid until next call to NextTxn().
NextTxn
(
txnInfo
*
TxnInfo
)
(
ok
bool
,
err
error
)
// XXX ok -> stop ?
}
}
type
IStorageRecordIterator
interface
{
// XXX naming -> IRecordIterator
type
IStorageRecordIterator
interface
{
// XXX naming -> IRecordIterator
Next
()
(
*
StorageRecordInformation
,
error
)
// XXX vs ptr & nil ?
// NextData puts information about next storage data record into *dataInfo.
// XXX -> NextTxnObject() ?
// data put into *dataInfo stays vaild until next call to NextData().
NextData
(
dataInfo
*
StorageRecordInformation
)
(
ok
bool
,
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