Commit 92fd18ce authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ff41fbb4
......@@ -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
}
......
......@@ -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)
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment