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
8e627a24
Commit
8e627a24
authored
Jan 20, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e956f33c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
+14
-10
go/neo/client.go
go/neo/client.go
+5
-4
go/neo/neo.go
go/neo/neo.go
+6
-4
go/neo/time.go
go/neo/time.go
+3
-2
No files found.
go/neo/client.go
View file @
8e627a24
...
@@ -112,6 +112,7 @@ func (cli *Client) Run(ctx context.Context) error {
...
@@ -112,6 +112,7 @@ func (cli *Client) Run(ctx context.Context) error {
return
cli
.
talkMaster
(
ctx
)
return
cli
.
talkMaster
(
ctx
)
}
}
// Close implements zodb.IStorageDriver.
func
(
c
*
Client
)
Close
()
(
err
error
)
{
func
(
c
*
Client
)
Close
()
(
err
error
)
{
c
.
talkMasterCancel
()
c
.
talkMasterCancel
()
// XXX wait talkMaster finishes -> XXX return err from that?
// XXX wait talkMaster finishes -> XXX return err from that?
...
@@ -483,6 +484,7 @@ func (c *Client) flushEventq0() {
...
@@ -483,6 +484,7 @@ func (c *Client) flushEventq0() {
// --- user API calls ---
// --- user API calls ---
// Sync implements zodb.IStorageDriver.
func
(
c
*
Client
)
Sync
(
ctx
context
.
Context
)
(
_
zodb
.
Tid
,
err
error
)
{
func
(
c
*
Client
)
Sync
(
ctx
context
.
Context
)
(
_
zodb
.
Tid
,
err
error
)
{
defer
func
()
{
defer
func
()
{
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -507,6 +509,7 @@ func (c *Client) Sync(ctx context.Context) (_ zodb.Tid, err error) {
...
@@ -507,6 +509,7 @@ func (c *Client) Sync(ctx context.Context) (_ zodb.Tid, err error) {
return
reply
.
Tid
,
nil
return
reply
.
Tid
,
nil
}
}
// Load implements zodb.IStorageDriver.
func
(
c
*
Client
)
Load
(
ctx
context
.
Context
,
xid
zodb
.
Xid
)
(
buf
*
mem
.
Buf
,
serial
zodb
.
Tid
,
err
error
)
{
func
(
c
*
Client
)
Load
(
ctx
context
.
Context
,
xid
zodb
.
Xid
)
(
buf
*
mem
.
Buf
,
serial
zodb
.
Tid
,
err
error
)
{
defer
func
()
{
defer
func
()
{
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -599,15 +602,12 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (buf *mem.Buf, serial z
...
@@ -599,15 +602,12 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (buf *mem.Buf, serial z
return
buf
,
resp
.
Serial
,
nil
return
buf
,
resp
.
Serial
,
nil
}
}
// Iterate implements zodb.IStorageDriver.
func
(
c
*
Client
)
Iterate
(
ctx
context
.
Context
,
tidMin
,
tidMax
zodb
.
Tid
)
zodb
.
ITxnIterator
{
func
(
c
*
Client
)
Iterate
(
ctx
context
.
Context
,
tidMin
,
tidMax
zodb
.
Tid
)
zodb
.
ITxnIterator
{
// see notes in ../NOTES:"On iteration"
// see notes in ../NOTES:"On iteration"
panic
(
"TODO"
)
panic
(
"TODO"
)
}
}
func
(
c
*
Client
)
Watch
(
ctx
context
.
Context
)
(
zodb
.
Tid
,
[]
zodb
.
Oid
,
error
)
{
panic
(
"TODO"
)
}
// ---- ZODB open/url support ----
// ---- ZODB open/url support ----
...
@@ -728,6 +728,7 @@ func openClientByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (
...
@@ -728,6 +728,7 @@ func openClientByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (
}
}
}
}
// URL implements zodb.IStorageDriver.
func
(
c
*
Client
)
URL
()
string
{
func
(
c
*
Client
)
URL
()
string
{
// XXX options if such were given to open are discarded
// XXX options if such were given to open are discarded
// (but we need to be able to construct URL if Client was created via NewClient directly)
// (but we need to be able to construct URL if Client was created via NewClient directly)
...
...
go/neo/neo.go
View file @
8e627a24
...
@@ -86,6 +86,8 @@ func NewNodeApp(net xnet.Networker, typ proto.NodeType, clusterName, masterAddr
...
@@ -86,6 +86,8 @@ func NewNodeApp(net xnet.Networker, typ proto.NodeType, clusterName, masterAddr
//
//
// Dial does not update .NodeTab or its node entries in any way.
// Dial does not update .NodeTab or its node entries in any way.
// For establishing links to peers present in .NodeTab use Node.Dial.
// For establishing links to peers present in .NodeTab use Node.Dial.
//
// XXX unexport
func
(
app
*
NodeApp
)
Dial
(
ctx
context
.
Context
,
peerType
proto
.
NodeType
,
addr
string
)
(
_
*
neonet
.
NodeLink
,
_
*
proto
.
AcceptIdentification
,
err
error
)
{
func
(
app
*
NodeApp
)
Dial
(
ctx
context
.
Context
,
peerType
proto
.
NodeType
,
addr
string
)
(
_
*
neonet
.
NodeLink
,
_
*
proto
.
AcceptIdentification
,
err
error
)
{
defer
task
.
Runningf
(
&
ctx
,
"dial %v (%v)"
,
addr
,
peerType
)(
&
err
)
defer
task
.
Runningf
(
&
ctx
,
"dial %v (%v)"
,
addr
,
peerType
)(
&
err
)
...
...
go/neo/time.go
View file @
8e627a24
// Copyright (C) 2017 Nexedi SA and Contributors.
// Copyright (C) 2017
-2021
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
...
@@ -33,4 +33,5 @@ func monotime() float64 {
...
@@ -33,4 +33,5 @@ func monotime() float64 {
return
time
.
Now
()
.
Sub
(
tstart
)
.
Seconds
()
return
time
.
Now
()
.
Sub
(
tstart
)
.
Seconds
()
}
}
// FIXME py retruns it since epoch
var
tstart
time
.
Time
=
time
.
Now
()
var
tstart
time
.
Time
=
time
.
Now
()
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