Commit 43cab1eb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4a1c56ee
......@@ -381,7 +381,7 @@ Partition Table (general & current-py)
#Np (how-many partitions) #R (replication factor)
Cell
.node (-> .nodeid, .addr)
.state
.cell_state
.backup_tid # last tid this cell has all data for
.replicating # currently replicating up to this (.replicating) tid
......
......@@ -34,11 +34,18 @@ type Master struct {
}
func NewMaster(clusterName string) *Master {
return &Master{clusterName}
// XXX .clusterState = RECOVERING ?
m := &Master{clusterName}
m.SetClusterState(RECOVERING) // XXX no elections - we are the only master
return m
}
func (m *Master) SetClusterState(state ClusterState) {
m.clusterState = state
// XXX actions ?
}
// ServeLink serves incoming node-node link connection
// XXX +error return?
func (m *Master) ServeLink(ctx context.Context, link *NodeLink) {
......
......@@ -222,7 +222,7 @@ func float64_NEODecode(b []byte) float64 {
return math.Float64frombits(fu)
}
// NOTE original NodeList = []NodeInfo
// NodeInfo is information about a node
type NodeInfo struct {
NodeType
Address
......@@ -244,22 +244,6 @@ type RowInfo struct {
}
type XXXTest struct {
qqq uint32
aaa uint32
Zzz map[int32]string
}
// // XXX link request <-> answer ?
// // XXX naming -> PktHeader ?
// type PktHead struct {
// ConnId be32 // NOTE is .msgid in py
// MsgCode be16
// Len be32 // whole packet length (including header)
// }
// General purpose notification (remote logging)
type Notify struct {
......
// 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
// node management & node table
// Node represents a node from local-node point of view
type Node struct {
Info NodeInfo
Link *NodeLink // link to this node; =nil if not connected
}
// NodeTable represents all known nodes in a cluster from local-node point of view
type NodeTable struct {
}
// 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
// partition table
// PartitionTable represents object space partitioning in a cluster
//
// XXX description:
//
// #Np (how-many partitions) #R (replication factor)
// Cell
// .node (-> .nodeid, .addr)
// .cell_state
//
// .backup_tid # last tid this cell has all data for
// .replicating # currently replicating up to this (.replicating) tid
//
// PT
// .id↑
// .partition_list [#Np] of []Cell
// .count_dict {} node -> #node_used_in_pt
//
//
// Pt
// +-+
// | |
// +-+ +----------+ +------------+ +-----+
// | | |node,state| |node2,state2| |cell3| ...
// +-+ +----------+ +------------+ +-----+
// Np | |
// +-+
// | |
// +-+ oid -> PTentry (as PT[oid % Np]
// | | tid
// +-+
type PartitionTable struct {
ptTab []...
}
// Operational returns whether all object space is covered by at least some ready-to-serve nodes
func (pt *PartitionalTable) Operational() bool {
}
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