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
915cb69a
Commit
915cb69a
authored
Sep 01, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
03a6d5f4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
go/neo/proto.go
go/neo/proto.go
+6
-4
go/neo/server/master.go
go/neo/server/master.go
+10
-6
go/neo/server/storage.go
go/neo/server/storage.go
+2
-1
No files found.
go/neo/proto.go
View file @
915cb69a
...
...
@@ -125,10 +125,12 @@ const (
// NodeUUID is a node identifier, 4-bytes signed integer
//
// High-order byte:
//
// 7 6 5 4 3 2 1 0
// | | | | +-+-+-+-- reserved (0)
// | +-+-+---------- node type
// +---------------- temporary if negative
//
// UUID namespaces are required to prevent conflicts when the master generate
// new uuid before it knows uuid of existing storage nodes. So only the high
// order bit is really important and the 31 other bits could be random.
...
...
go/neo/server/master.go
View file @
915cb69a
...
...
@@ -68,6 +68,7 @@ type Master struct {
// 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
.
Networker
)
*
Master
{
m
:=
&
Master
{
...
...
@@ -86,19 +87,22 @@ func NewMaster(clusterName, serveAddr string, net xnet.Networker) *Master {
return
m
}
// Start requests cluster to eventually transition into running state
// it returns an error if such transition is not currently possible to begin (e.g. partition table is not operational)
// it returns nil if the transition began.
// Start requests cluster to eventually transition into running state.
//
// It returns an error if such transition is not currently possible to begin
// (e.g. partition table is not operational).
// It returns nil if the transition began.
//
// NOTE upon successful return cluster is not yet in running state - the transition will
// take time and could be also automatically aborted due to cluster environment change (e.g.
//
a storage node goes down)
//
a storage node goes down).
func
(
m
*
Master
)
Start
()
error
{
ech
:=
make
(
chan
error
)
m
.
ctlStart
<-
ech
return
<-
ech
}
// Stop requests cluster to eventually transition into recovery state
// Stop requests cluster to eventually transition into recovery state
.
func
(
m
*
Master
)
Stop
()
{
ech
:=
make
(
chan
struct
{})
m
.
ctlStop
<-
ech
...
...
go/neo/server/storage.go
View file @
915cb69a
...
...
@@ -37,7 +37,7 @@ import (
"lab.nexedi.com/kirr/go123/xerr"
)
// Storage is NEO node that keeps data and provides read/write access to it
// Storage is NEO node that keeps data and provides read/write access to it
via network.
type
Storage
struct
{
node
*
neo
.
NodeApp
...
...
@@ -59,6 +59,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.
// Use Run to actually start running the node.
func
NewStorage
(
clusterName
,
masterAddr
,
serveAddr
string
,
net
xnet
.
Networker
,
zstor
zodb
.
IStorage
)
*
Storage
{
...
...
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