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
92fd18ce
Commit
92fd18ce
authored
May 05, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ff41fbb4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
go/neo/proto.go
go/neo/proto.go
+7
-0
go/nodetab.go
go/nodetab.go
+18
-0
neo/lib/pt.py
neo/lib/pt.py
+2
-2
No files found.
go/neo/proto.go
View file @
92fd18ce
...
...
@@ -4,6 +4,11 @@
package
neo
// NOTE for some packets it is possible to decode raw packet -> go version from
// PktBuf in place. E.g. for GetObject.
//
// TODO work this out
// XXX move imports out of here
import
(
"../zodb"
...
...
@@ -661,6 +666,8 @@ type AnswerPartitionList struct {
// Ask information about nodes
// Answer information about nodes
//
// XXX neoctl -> A (A just extracts data from its nodetab)
type
NodeList
struct
{
NodeType
}
...
...
go/nodetab.go
View file @
92fd18ce
...
...
@@ -18,6 +18,10 @@
package
neo
// node management & node table
import
(
"sync"
)
// Node represents a node from local-node point of view
type
Node
struct
{
Info
NodeInfo
...
...
@@ -29,4 +33,18 @@ type Node struct {
// NodeTable represents all known nodes in a cluster from local-node point of view
type
NodeTable
struct
{
// users have to care locking explicitly
sync
.
Mutex
// XXX -> RWMutex ?
}
// UpdateNode updates information about a node
func
(
nt
*
NodeTable
)
UpdateNode
(
nodeInfo
NodeInfo
)
{
// TODO
}
// XXX ? ^^^ UpdateNode is enough ?
func
(
nt
*
NodeTable
)
Add
(
node
*
Node
)
{
// TODO
}
// TODO subscribe for changes on Add ? (notification via channel)
neo/lib/pt.py
View file @
92fd18ce
...
...
@@ -210,7 +210,7 @@ class PartitionTable(object):
if
offset
>=
self
.
getPartitions
():
raise
IndexError
for
uuid
,
state
in
row
:
node
=
nm
.
getByUUID
(
uuid
)
node
=
nm
.
getByUUID
(
uuid
)
# NOTE pt <-> nm interrelation
# the node must be known by the node manager
assert
node
is
not
None
self
.
_setCell
(
offset
,
node
,
state
)
...
...
@@ -231,7 +231,7 @@ class PartitionTable(object):
break
readable_list
+=
row
for
offset
,
uuid
,
state
in
cell_list
:
node
=
nm
.
getByUUID
(
uuid
)
node
=
nm
.
getByUUID
(
uuid
)
# NOTE pt <-> nm interrelation
assert
node
is
not
None
,
'No node found for uuid '
+
uuid_str
(
uuid
)
self
.
_setCell
(
offset
,
node
,
state
)
self
.
logUpdated
()
...
...
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