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
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
b23c7153
Commit
b23c7153
authored
May 30, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
62cc33a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
14 deletions
+38
-14
go/neo/master.go
go/neo/master.go
+4
-14
go/neo/time.go
go/neo/time.go
+34
-0
No files found.
go/neo/master.go
View file @
b23c7153
...
...
@@ -27,17 +27,16 @@ import (
"math"
"os"
"sync"
"time"
)
// Master is a node overseeing and managing how whole NEO cluster works
type
Master
struct
{
clusterName
string
nodeUUID
NodeUUID
// my node uuid; XXX init somewhere
nodeUUID
NodeUUID
// master manages node and partition tables and broadcast their updates
// to all nodes in cluster
stateMu
sync
.
RWMutex
stateMu
sync
.
RWMutex
// XXX recheck: needed ?
nodeTab
NodeTable
partTab
PartitionTable
clusterState
ClusterState
...
...
@@ -45,7 +44,8 @@ type Master struct {
// channels from various workers to main driver
nodeCome
chan
nodeCome
// node connected
nodeLeave
chan
nodeLeave
// node disconnected
storRecovery
chan
storRecovery
// storage node passed recovery
storRecovery
chan
storRecovery
// storage node passed recovery XXX better explicitly pass to worker as arg?
}
...
...
@@ -82,16 +82,6 @@ func (m *Master) SetClusterState(state ClusterState) {
// XXX actions ?
}
// monotime returns time passed since program start
// it uses monothonic time and is robust to OS clock adjustments
// XXX place?
func
monotime
()
float64
{
// time.Sub uses monotonic clock readings for the difference
return
time
.
Now
()
.
Sub
(
tstart
)
.
Seconds
()
}
var
tstart
time
.
Time
=
time
.
Now
()
// run implements main master cluster management logic: node tracking, cluster
// state updates, scheduling data movement between storage nodes etc
func
(
m
*
Master
)
run
(
ctx
context
.
Context
)
{
...
...
go/neo/time.go
0 → 100644
View file @
b23c7153
// Copyright (C) 2017 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
// option) any later version, as published by the Free Software Foundation.
//
// You can also Link and Combine this program with other software covered by
// the terms of any of the Open Source Initiative approved licenses and Convey
// the resulting work. Corresponding source of such a combination shall include
// the source code for all other software used.
//
// This program is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// See COPYING file for full licensing terms.
package
neo
// time related utilities
import
(
"time"
)
// monotime returns time passed since program start
// it uses monothonic time for measurments and is robust to OS clock adjustments
//
// XXX better return time.Duration?
func
monotime
()
float64
{
// time.Sub uses monotonic clock readings for the difference
return
time
.
Now
()
.
Sub
(
tstart
)
.
Seconds
()
}
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