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
890290e6
Commit
890290e6
authored
Mar 26, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/*: Cosmetics
parent
25a8766b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
10 deletions
+13
-10
go/neo/neonet/newlink.go
go/neo/neonet/newlink.go
+1
-1
go/neo/proto/proto.go
go/neo/proto/proto.go
+1
-1
go/zodb/storage.go
go/zodb/storage.go
+1
-1
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+3
-0
go/zodb/storage/zeo/zeo.go
go/zodb/storage/zeo/zeo.go
+2
-2
go/zodb/storage/zeo/zeo_test.go
go/zodb/storage/zeo/zeo_test.go
+3
-3
go/zodb/zodb.go
go/zodb/zodb.go
+2
-2
No files found.
go/neo/neonet/newlink.go
View file @
890290e6
go/neo/proto/proto.go
View file @
890290e6
...
@@ -438,7 +438,7 @@ type Pong struct{}
...
@@ -438,7 +438,7 @@ type Pong struct{}
type
CloseClient
struct
{
type
CloseClient
struct
{
}
}
// Ask node identier of the current primary master.
// Ask node identi
fi
er of the current primary master.
//
//
//neo:nodes ctl -> A
//neo:nodes ctl -> A
type
PrimaryMaster
struct
{
type
PrimaryMaster
struct
{
...
...
go/zodb/storage.go
View file @
890290e6
...
@@ -396,7 +396,7 @@ func (s *storage) _watcher() error {
...
@@ -396,7 +396,7 @@ func (s *storage) _watcher() error {
func
(
s
*
storage
)
AddWatch
(
watchq
chan
<-
Event
)
(
at0
Tid
)
{
func
(
s
*
storage
)
AddWatch
(
watchq
chan
<-
Event
)
(
at0
Tid
)
{
ack
:=
make
(
chan
Tid
)
ack
:=
make
(
chan
Tid
)
select
{
select
{
// no longer operational: behave if watchq was registered before that
// no longer operational: behave
as
if watchq was registered before that
// and then seen down/close events. Interact with DelWatch directly.
// and then seen down/close events. Interact with DelWatch directly.
case
<-
s
.
down
:
case
<-
s
.
down
:
s
.
headMu
.
Lock
()
// shutdown may be due to Close call and watcher might be
s
.
headMu
.
Lock
()
// shutdown may be due to Close call and watcher might be
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
890290e6
...
@@ -108,6 +108,7 @@ func TestLoad(t *testing.T) {
...
@@ -108,6 +108,7 @@ func TestLoad(t *testing.T) {
}
}
// iterate tidMin..tidMax and expect db entries in expectv
// iterate tidMin..tidMax and expect db entries in expectv
// TODO -> xtesting
func
testIterate
(
t
*
testing
.
T
,
fs
*
FileStorage
,
tidMin
,
tidMax
zodb
.
Tid
,
expectv
[]
dbEntry
)
{
func
testIterate
(
t
*
testing
.
T
,
fs
*
FileStorage
,
tidMin
,
tidMax
zodb
.
Tid
,
expectv
[]
dbEntry
)
{
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
iter
:=
fs
.
Iterate
(
ctx
,
tidMin
,
tidMax
)
iter
:=
fs
.
Iterate
(
ctx
,
tidMin
,
tidMax
)
...
@@ -218,6 +219,7 @@ func testIterate(t *testing.T, fs *FileStorage, tidMin, tidMax zodb.Tid, expectv
...
@@ -218,6 +219,7 @@ func testIterate(t *testing.T, fs *FileStorage, tidMin, tidMax zodb.Tid, expectv
}
}
}
}
// TODO -> xtesting
func
TestIterate
(
t
*
testing
.
T
)
{
func
TestIterate
(
t
*
testing
.
T
)
{
fs
,
_
:=
xfsopen
(
t
,
"testdata/1.fs"
)
fs
,
_
:=
xfsopen
(
t
,
"testdata/1.fs"
)
defer
exc
.
XRun
(
fs
.
Close
)
defer
exc
.
XRun
(
fs
.
Close
)
...
@@ -254,6 +256,7 @@ func TestIterate(t *testing.T) {
...
@@ -254,6 +256,7 @@ func TestIterate(t *testing.T) {
testIterate
(
t
,
fs
,
0
,
zodb
.
TidMax
,
_1fs_dbEntryv
[
:
])
testIterate
(
t
,
fs
,
0
,
zodb
.
TidMax
,
_1fs_dbEntryv
[
:
])
}
}
// TODO -> xtesting
func
BenchmarkIterate
(
b
*
testing
.
B
)
{
func
BenchmarkIterate
(
b
*
testing
.
B
)
{
fs
,
_
:=
xfsopen
(
b
,
"testdata/1.fs"
)
fs
,
_
:=
xfsopen
(
b
,
"testdata/1.fs"
)
defer
exc
.
XRun
(
fs
.
Close
)
defer
exc
.
XRun
(
fs
.
Close
)
...
...
go/zodb/storage/zeo/zeo.go
View file @
890290e6
...
@@ -279,7 +279,7 @@ func (r rpc) call(ctx context.Context, argv ...interface{}) (interface{}, error)
...
@@ -279,7 +279,7 @@ func (r rpc) call(ctx context.Context, argv ...interface{}) (interface{}, error)
// excError returns error corresponding to an exception.
// excError returns error corresponding to an exception.
//
//
// well-known exceptions are mapped to corresponding well-known errors - e.g.
// well-known exceptions are mapped to corresponding well-known errors - e.g.
// POSKeyError -> zodb.NoObjectError, and rest are returned wrappe
r
into rpcExcept.
// POSKeyError -> zodb.NoObjectError, and rest are returned wrappe
d
into rpcExcept.
func
(
r
rpc
)
excError
(
exc
string
,
argv
tuple
)
error
{
func
(
r
rpc
)
excError
(
exc
string
,
argv
tuple
)
error
{
// translate well-known exceptions
// translate well-known exceptions
switch
exc
{
switch
exc
{
...
@@ -409,7 +409,7 @@ func (r rpc) ereplyf(format string, argv ...interface{}) *errorUnexpectedReply {
...
@@ -409,7 +409,7 @@ func (r rpc) ereplyf(format string, argv ...interface{}) *errorUnexpectedReply {
func
openByURL
(
ctx
context
.
Context
,
u
*
url
.
URL
,
opt
*
zodb
.
DriverOptions
)
(
_
zodb
.
IStorageDriver
,
at0
zodb
.
Tid
,
err
error
)
{
func
openByURL
(
ctx
context
.
Context
,
u
*
url
.
URL
,
opt
*
zodb
.
DriverOptions
)
(
_
zodb
.
IStorageDriver
,
at0
zodb
.
Tid
,
err
error
)
{
url
:=
u
.
String
()
url
:=
u
.
String
()
defer
xerr
.
Contextf
(
&
err
,
"open %s"
,
url
)
defer
xerr
.
Contextf
(
&
err
,
"
zeo:
open %s"
,
url
)
// zeo://host:port/path?storage=...&...
// zeo://host:port/path?storage=...&...
var
net
xnet
.
Networker
var
net
xnet
.
Networker
...
...
go/zodb/storage/zeo/zeo_test.go
View file @
890290e6
...
@@ -34,7 +34,6 @@ import (
...
@@ -34,7 +34,6 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb"
_
"lab.nexedi.com/kirr/neo/go/zodb/storage/fs1"
_
"lab.nexedi.com/kirr/neo/go/zodb/storage/fs1"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/go123/xnet"
)
)
...
@@ -139,7 +138,7 @@ func (z *ZEOPySrv) Close() (err error) {
...
@@ -139,7 +138,7 @@ func (z *ZEOPySrv) Close() (err error) {
<-
z
.
done
<-
z
.
done
err
=
z
.
errExit
err
=
z
.
errExit
if
_
,
ok
:=
err
.
(
*
exec
.
ExitError
);
ok
{
if
_
,
ok
:=
err
.
(
*
exec
.
ExitError
);
ok
{
err
=
nil
// ignore exit statu
e
- it is always !0 on kill
err
=
nil
// ignore exit statu
s
- it is always !0 on kill
}
}
return
err
return
err
}
}
...
@@ -154,6 +153,7 @@ func (z *ZEOPySrv) Encoding() encoding {
...
@@ -154,6 +153,7 @@ func (z *ZEOPySrv) Encoding() encoding {
// ----------------
// ----------------
// tOptions represents options for testing.
// tOptions represents options for testing.
// TODO -> xtesting
type
tOptions
struct
{
type
tOptions
struct
{
Preload
string
// preload database with data from this location
Preload
string
// preload database with data from this location
}
}
...
@@ -253,7 +253,7 @@ func TestEmptyDB(t *testing.T) {
...
@@ -253,7 +253,7 @@ func TestEmptyDB(t *testing.T) {
}
}
func
TestLoad
(
t
*
testing
.
T
)
{
func
TestLoad
(
t
*
testing
.
T
)
{
X
:=
exc
.
Raiseif
X
:=
xtesting
.
FatalIf
(
t
)
data
:=
"../fs1/testdata/1.fs"
data
:=
"../fs1/testdata/1.fs"
txnvOk
,
err
:=
xtesting
.
LoadDBHistory
(
data
);
X
(
err
)
txnvOk
,
err
:=
xtesting
.
LoadDBHistory
(
data
);
X
(
err
)
...
...
go/zodb/zodb.go
View file @
890290e6
// Copyright (C) 2016-202
0
Nexedi SA and Contributors.
// Copyright (C) 2016-202
1
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
...
@@ -327,7 +327,7 @@ type IStorage interface {
...
@@ -327,7 +327,7 @@ type IStorage interface {
Loader
Loader
Iterator
Iterator
// similar to IStorage
// similar to IStorage
Driver
// Sync syncs to storage and updates current view of it.
// Sync syncs to storage and updates current view of it.
//
//
...
...
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