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
Hide 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 {
return
cli
.
talkMaster
(
ctx
)
}
// Close implements zodb.IStorageDriver.
func
(
c
*
Client
)
Close
()
(
err
error
)
{
c
.
talkMasterCancel
()
// XXX wait talkMaster finishes -> XXX return err from that?
...
...
@@ -483,6 +484,7 @@ func (c *Client) flushEventq0() {
// --- user API calls ---
// Sync implements zodb.IStorageDriver.
func
(
c
*
Client
)
Sync
(
ctx
context
.
Context
)
(
_
zodb
.
Tid
,
err
error
)
{
defer
func
()
{
if
err
!=
nil
{
...
...
@@ -507,6 +509,7 @@ func (c *Client) Sync(ctx context.Context) (_ zodb.Tid, err error) {
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
)
{
defer
func
()
{
if
err
!=
nil
{
...
...
@@ -599,15 +602,12 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (buf *mem.Buf, serial z
return
buf
,
resp
.
Serial
,
nil
}
// Iterate implements zodb.IStorageDriver.
func
(
c
*
Client
)
Iterate
(
ctx
context
.
Context
,
tidMin
,
tidMax
zodb
.
Tid
)
zodb
.
ITxnIterator
{
// see notes in ../NOTES:"On iteration"
panic
(
"TODO"
)
}
func
(
c
*
Client
)
Watch
(
ctx
context
.
Context
)
(
zodb
.
Tid
,
[]
zodb
.
Oid
,
error
)
{
panic
(
"TODO"
)
}
// ---- ZODB open/url support ----
...
...
@@ -728,6 +728,7 @@ func openClientByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (
}
}
// URL implements zodb.IStorageDriver.
func
(
c
*
Client
)
URL
()
string
{
// 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)
...
...
go/neo/neo.go
View file @
8e627a24
...
...
@@ -52,9 +52,9 @@ type NodeApp struct {
MasterAddr
string
// address of current master XXX put under StateMu ?
StateMu
sync
.
RWMutex
// <- XXX just embed?
NodeTab
*
NodeTable
// information about nodes in the cluster
PartTab
*
PartitionTable
// information about data distribution in the cluster
ClusterState
proto
.
ClusterState
// master idea about cluster state
NodeTab
*
NodeTable
// information about nodes in the cluster
PartTab
*
PartitionTable
// information about data distribution in the cluster
ClusterState
proto
.
ClusterState
// master idea about cluster state
// should be set by user so NodeApp can notify when master tells this node to shutdown
OnShutdown
func
()
...
...
@@ -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.
// 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
)
{
defer
task
.
Runningf
(
&
ctx
,
"dial %v (%v)"
,
addr
,
peerType
)(
&
err
)
...
...
@@ -177,7 +179,7 @@ func requireIdentifyHello(inner neonet.LinkListener) Listener {
}
type
listener
struct
{
l
neonet
.
LinkListener
l
neonet
.
LinkListener
}
func
(
l
*
listener
)
Accept
(
ctx
context
.
Context
)
(
_
*
neonet
.
Request
,
_
*
proto
.
RequestIdentification
,
err
error
)
{
...
...
go/neo/time.go
View file @
8e627a24
// Copyright (C) 2017 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Copyright (C) 2017
-2021
Nexedi SA and Contributors.
//
Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
...
...
@@ -33,4 +33,5 @@ func monotime() float64 {
return
time
.
Now
()
.
Sub
(
tstart
)
.
Seconds
()
}
// FIXME py retruns it since epoch
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