Commit 5247f617 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ddadb8b1
...@@ -43,7 +43,7 @@ import ( ...@@ -43,7 +43,7 @@ import (
// //
// rule. The `oid % Np` is known as partition identifier of oid. // rule. The `oid % Np` is known as partition identifier of oid.
// //
// There is also externally set "redundancy factor" R which describes the minimum // There is also externally set "replication factor" R which describes the minimum
// amount of separate nodes a particular object data should be stored into at the same time. // amount of separate nodes a particular object data should be stored into at the same time.
// //
// Given Np, R and []Storage PartitionTable tries to organize // Given Np, R and []Storage PartitionTable tries to organize
...@@ -52,11 +52,12 @@ import ( ...@@ -52,11 +52,12 @@ import (
// //
// mapping so that // mapping so that
// //
// - redundancy level set by R is met // - replication level set by R is met
// - storages associated with adjacent pids are different // - storages associated with adjacent pids are different
// //
// when such organization is reached the partition table is called operational // when such organization is reached, and enough storage nodes are in "running"
// and non-operational otherwise. XXX and if storages are ready // state, the partition table is called operational and non-operational
// otherwise.
// //
// The PartitionTable can auto-adjust to storage nodes coming and going. // The PartitionTable can auto-adjust to storage nodes coming and going.
// Let's consider cluster change from Ns1 to Ns2 storage nodes: if we pick // Let's consider cluster change from Ns1 to Ns2 storage nodes: if we pick
...@@ -115,14 +116,11 @@ import ( ...@@ -115,14 +116,11 @@ import (
// //
// PartitionTable zero value is valid empty partition table. // PartitionTable zero value is valid empty partition table.
type PartitionTable struct { type PartitionTable struct {
// XXX do we need sync.Mutex here for updates ? PTid proto.PTid // ↑ for versioning
tab [][]Cell // [#Np] pid -> []Cell
tab [][]Cell // [#Np] pid -> []Cell
PTid proto.PTid // ↑ for versioning XXX -> ver ? XXX move out of here?
} }
// Cell describes one storage in a pid entry in partition table // Cell describes one storage in a pid entry in partition table.
type Cell struct { type Cell struct {
proto.CellInfo // .nid + .state proto.CellInfo // .nid + .state
...@@ -181,8 +179,6 @@ func MakePartTab(np int, nodev []*PeerNode) *PartitionTable { ...@@ -181,8 +179,6 @@ func MakePartTab(np int, nodev []*PeerNode) *PartitionTable {
// - whether there are corresponding storage nodes that are up // - whether there are corresponding storage nodes that are up
// //
// information about nodes being up or down is obtained from supplied NodeTable // information about nodes being up or down is obtained from supplied NodeTable
//
// XXX or keep not only NodeID in Cell - add *Node ?
func (pt *PartitionTable) OperationalWith(nt *NodeTable) bool { func (pt *PartitionTable) OperationalWith(nt *NodeTable) bool {
// empty partition table is never operational // empty partition table is never operational
if len(pt.tab) == 0 { if len(pt.tab) == 0 {
......
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