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

.

parent ff41fbb4
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
package neo 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 // XXX move imports out of here
import ( import (
"../zodb" "../zodb"
...@@ -661,6 +666,8 @@ type AnswerPartitionList struct { ...@@ -661,6 +666,8 @@ type AnswerPartitionList struct {
// Ask information about nodes // Ask information about nodes
// Answer information about nodes // Answer information about nodes
//
// XXX neoctl -> A (A just extracts data from its nodetab)
type NodeList struct { type NodeList struct {
NodeType NodeType
} }
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
package neo package neo
// node management & node table // node management & node table
import (
"sync"
)
// Node represents a node from local-node point of view // Node represents a node from local-node point of view
type Node struct { type Node struct {
Info NodeInfo Info NodeInfo
...@@ -29,4 +33,18 @@ type Node struct { ...@@ -29,4 +33,18 @@ type Node struct {
// NodeTable represents all known nodes in a cluster from local-node point of view // NodeTable represents all known nodes in a cluster from local-node point of view
type NodeTable struct { 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): ...@@ -210,7 +210,7 @@ class PartitionTable(object):
if offset >= self.getPartitions(): if offset >= self.getPartitions():
raise IndexError raise IndexError
for uuid, state in row: 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 # the node must be known by the node manager
assert node is not None assert node is not None
self._setCell(offset, node, state) self._setCell(offset, node, state)
...@@ -231,7 +231,7 @@ class PartitionTable(object): ...@@ -231,7 +231,7 @@ class PartitionTable(object):
break break
readable_list += row readable_list += row
for offset, uuid, state in cell_list: 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) assert node is not None, 'No node found for uuid ' + uuid_str(uuid)
self._setCell(offset, node, state) self._setCell(offset, node, state)
self.logUpdated() 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