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
2bfd266f
Commit
2bfd266f
authored
Jun 14, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aaae4b15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
go/neo/server/master.go
go/neo/server/master.go
+17
-7
go/neo/server/storage.go
go/neo/server/storage.go
+1
-1
No files found.
go/neo/server/master.go
View file @
2bfd266f
...
...
@@ -38,10 +38,10 @@ type Master struct {
// XXX move -> nodeCommon?
// ---- 8< ----
myInfo
neo
.
NodeInfo
clusterName
string
clusterName
string
net
xnet
.
Network
// network we are sending/receiving on
masterAddr
string
// address of master
masterAddr
string
// address of
current primary
master
// ---- 8< ----
// last allocated oid & tid
...
...
@@ -82,16 +82,25 @@ type nodeLeave struct {
link
*
neo
.
NodeLink
// XXX better use uuid allocated on nodeCome ?
}
// NewMaster creates new master node that
is listening
on serveAddr
//
XXX ... call Run
// NewMaster creates new master node that
will listen
on serveAddr
//
Use Run to actually start running the node.
func
NewMaster
(
clusterName
,
serveAddr
string
,
net
xnet
.
Network
)
*
Master
{
// XXX serveAddr + net
// convert serveAddr into neo format
addr
,
err
:=
neo
.
AddrString
(
net
.
Network
(),
serveAddr
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
m
:=
&
Master
{
myInfo
:
neo
.
NodeInfo
{
NodeType
:
neo
.
MASTER
,
Address
:
addr
},
clusterName
:
clusterName
,
net
:
net
,
masterAddr
:
serveAddr
,
// XXX ok?
}
m
:=
&
Master
{
clusterName
:
clusterName
}
m
.
myInfo
.
NodeUUID
=
m
.
allocUUID
(
neo
.
MASTER
)
// TODO update nodeTab with self
m
.
clusterState
=
neo
.
ClusterRecovering
// XXX no elections - we are the only master
// go m.run(context.TODO()) // XXX ctx
return
m
}
...
...
@@ -116,6 +125,7 @@ func (m *Master) Run(ctx context.Context) error {
}
m
.
myInfo
.
Address
=
addr
m
.
masterAddr
=
l
.
Addr
()
.
String
()
wg
:=
sync
.
WaitGroup
{}
...
...
go/neo/server/storage.go
View file @
2bfd266f
...
...
@@ -47,7 +47,7 @@ type Storage struct {
// NewStorage creates new storage node that will listen on serveAddr and talk to master on masterAddr
// The storage uses zstor as underlying backend for storing data.
//
To actually start running the node - call Run. XXX text
//
Use Run to actually start running the node.
func
NewStorage
(
cluster
,
masterAddr
,
serveAddr
string
,
net
xnet
.
Network
,
zstor
zodb
.
IStorage
)
*
Storage
{
// convert serveAddr into neo format
addr
,
err
:=
neo
.
AddrString
(
net
.
Network
(),
serveAddr
)
...
...
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