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
60682993
Commit
60682993
authored
Mar 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/zodb/*: Cosmetics, typos, ...
parent
bae8fda6
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
10 deletions
+20
-10
go/zodb/cache.go
go/zodb/cache.go
+1
-1
go/zodb/connection.go
go/zodb/connection.go
+1
-1
go/zodb/persistent.go
go/zodb/persistent.go
+2
-1
go/zodb/persistent_test.go
go/zodb/persistent_test.go
+10
-1
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+1
-1
go/zodb/storage/zeo/zeo.go
go/zodb/storage/zeo/zeo.go
+1
-1
go/zodb/storage/zeo/zrpc.go
go/zodb/storage/zeo/zrpc.go
+3
-3
go/zodb/zodb.go
go/zodb/zodb.go
+1
-1
No files found.
go/zodb/cache.go
View file @
60682993
...
@@ -55,7 +55,7 @@ type Cache struct {
...
@@ -55,7 +55,7 @@ type Cache struct {
mu
sync
.
RWMutex
mu
sync
.
RWMutex
// cache is
ful
ly synchronized with storage for transactions with tid <= head.
// cache is
current
ly synchronized with storage for transactions with tid <= head.
// XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head)
// XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head)
head
Tid
head
Tid
...
...
go/zodb/connection.go
View file @
60682993
...
@@ -274,7 +274,7 @@ func (conn *Connection) checkTxnCtx(ctx context.Context, who string) {
...
@@ -274,7 +274,7 @@ func (conn *Connection) checkTxnCtx(ctx context.Context, who string) {
// checkTxn asserts that specified "current" transaction is the same as conn.txn .
// checkTxn asserts that specified "current" transaction is the same as conn.txn .
func
(
conn
*
Connection
)
checkTxn
(
txn
transaction
.
Transaction
,
who
string
)
{
func
(
conn
*
Connection
)
checkTxn
(
txn
transaction
.
Transaction
,
who
string
)
{
if
txn
!=
conn
.
txn
{
if
txn
!=
conn
.
txn
{
panic
(
"connection: "
+
who
+
"current transaction is different from connection transaction"
)
panic
(
"connection: "
+
who
+
"
:
current transaction is different from connection transaction"
)
}
}
}
}
...
...
go/zodb/persistent.go
View file @
60682993
...
@@ -59,6 +59,7 @@ import (
...
@@ -59,6 +59,7 @@ import (
type
Persistent
struct
{
type
Persistent
struct
{
// ZODB class of this object.
// ZODB class of this object.
// XXX it could be deduced via typeTab[reflect.TypeOf(.instance)]
// XXX it could be deduced via typeTab[reflect.TypeOf(.instance)]
// XXX or better drop .instance and deduce it via casting to .zclass.typ
zclass
*
zclass
zclass
*
zclass
jar
*
Connection
jar
*
Connection
...
@@ -370,7 +371,7 @@ var rPyStateful = reflect.TypeOf((*PyStateful)(nil)).Elem() // typeof(PyStatef
...
@@ -370,7 +371,7 @@ var rPyStateful = reflect.TypeOf((*PyStateful)(nil)).Elem() // typeof(PyStatef
//
//
// Only registered classes can be saved to database, and are converted to
// Only registered classes can be saved to database, and are converted to
// corresponding application-level objects on load. When ZODB loads an object
// corresponding application-level objects on load. When ZODB loads an object
// whose class is not know, it will represent it as Broken object.
// whose class is not know
n
, it will represent it as Broken object.
//
//
// class is a full class path for registered class, e.g. "BTrees.LOBTree.LOBucket".
// class is a full class path for registered class, e.g. "BTrees.LOBTree.LOBucket".
// typ is Go type corresponding to class.
// typ is Go type corresponding to class.
...
...
go/zodb/persistent_test.go
View file @
60682993
...
@@ -65,7 +65,7 @@ func (o *myObjectState) PyGetState() interface{} {
...
@@ -65,7 +65,7 @@ func (o *myObjectState) PyGetState() interface{} {
return
o
.
value
return
o
.
value
}
}
// Peristent that is not registered to ZODB.
// Per
s
istent that is not registered to ZODB.
type
Unregistered
struct
{
type
Unregistered
struct
{
Persistent
Persistent
}
}
...
@@ -599,3 +599,12 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
...
@@ -599,3 +599,12 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
}
}
// TODO Map & List tests.
// TODO Map & List tests.
// TODO PyGetState vs PySetState tests (general - for any type):
//
// db1: produced by zodb/py
// go: load db1
// go: commit -> db2 (resave)
// go: load db2
// go: check (loaded from db2) == (loaded from db1)
go/zodb/storage/fs1/filestorage_test.go
View file @
60682993
...
@@ -155,7 +155,7 @@ func TestLoad(t *testing.T) {
...
@@ -155,7 +155,7 @@ func TestLoad(t *testing.T) {
}
}
// load at ∞ with TidMax
// load at ∞ with TidMax
// XXX should we get "no such transaction" with at > head?
// XXX should we get "no such transaction" with at > head?
- yes
for
oid
,
expect
:=
range
before
{
for
oid
,
expect
:=
range
before
{
xid
:=
zodb
.
Xid
{
zodb
.
TidMax
,
oid
}
xid
:=
zodb
.
Xid
{
zodb
.
TidMax
,
oid
}
checkLoad
(
t
,
fs
,
xid
,
expect
)
checkLoad
(
t
,
fs
,
xid
,
expect
)
...
...
go/zodb/storage/zeo/zeo.go
View file @
60682993
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
// See COPYING file for full licensing terms.
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
// See https://www.nexedi.com/licensing for rationale and options.
// Package zeo provides simple ZEO client
// Package zeo provides simple ZEO client
.
package
zeo
package
zeo
import
(
import
(
...
...
go/zodb/storage/zeo/zrpc.go
View file @
60682993
// Copyright (C) 2018 Nexedi SA and Contributors.
// Copyright (C) 2018
-2019
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// This program is free software: you can Use, Study, Modify and Redistribute
...
@@ -216,7 +216,7 @@ func pktDecode(pkb *pktBuf) (msg, error) {
...
@@ -216,7 +216,7 @@ func pktDecode(pkb *pktBuf) (msg, error) {
}
}
//
c
all makes 1 RPC call to server, waits for reply and returns it.
//
C
all makes 1 RPC call to server, waits for reply and returns it.
func
(
zl
*
zLink
)
Call
(
ctx
context
.
Context
,
method
string
,
argv
...
interface
{})
(
reply
msg
,
_
error
)
{
func
(
zl
*
zLink
)
Call
(
ctx
context
.
Context
,
method
string
,
argv
...
interface
{})
(
reply
msg
,
_
error
)
{
// defer func() ...
// defer func() ...
reply
,
err
:=
zl
.
_call
(
ctx
,
method
,
argv
...
)
reply
,
err
:=
zl
.
_call
(
ctx
,
method
,
argv
...
)
...
...
go/zodb/zodb.go
View file @
60682993
...
@@ -440,7 +440,7 @@ type Event interface {
...
@@ -440,7 +440,7 @@ type Event interface {
func
(
_
*
EventError
)
event
()
{}
func
(
_
*
EventError
)
event
()
{}
func
(
_
*
EventCommit
)
event
()
{}
func
(
_
*
EventCommit
)
event
()
{}
// EventError is event descrbing an error observed by watcher.
// EventError is event descr
i
bing an error observed by watcher.
type
EventError
struct
{
type
EventError
struct
{
Err
error
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