Commit f4f787ee authored by Kirill Smelkov's avatar Kirill Smelkov

X Surprisingly inline struct worked out of the box

parent bdfc7f26
...@@ -251,3 +251,24 @@ func (p *NotifyPartitionTable) NEODecode(data []byte) (int, error) { ...@@ -251,3 +251,24 @@ func (p *NotifyPartitionTable) NEODecode(data []byte) (int, error) {
} }
return 0 /* + TODO variable part */, nil return 0 /* + TODO variable part */, nil
} }
func (p *PartitionChanges) NEODecode(data []byte) (int, error) {
p.PTid = BigEndian.Uint64(data[0:])
{
l := BigEndian.Uint32(data[8:])
data = data[12:]
p.CellList = make([]struct {
Offset uint32
UUID neo.UUID
CellState neo.CellState
}, l)
for i := 0; i < l; i++ {
a := &p.CellList[i]
a.Offset = BigEndian.Uint32(data[0:])
a.UUID = int32(BigEndian.Uint32(data[4:]))
a.CellState = int32(BigEndian.Uint32(data[8:]))
data = data[12:]
}
}
return 0 /* + TODO variable part */, nil
}
...@@ -286,7 +286,6 @@ type NotifyPartitionTable struct { ...@@ -286,7 +286,6 @@ type NotifyPartitionTable struct {
RowList []RowInfo RowList []RowInfo
} }
/*
// Notify a subset of a partition table. This is used to notify changes. // Notify a subset of a partition table. This is used to notify changes.
// PM -> S, C. // PM -> S, C.
type PartitionChanges struct { type PartitionChanges struct {
...@@ -299,6 +298,7 @@ type PartitionChanges struct { ...@@ -299,6 +298,7 @@ type PartitionChanges struct {
} }
} }
/*
// Tell a storage nodes to start an operation. Until a storage node receives // Tell a storage nodes to start an operation. Until a storage node receives
// this message, it must not serve client nodes. PM -> S. // this message, it must not serve client nodes. PM -> S.
type StartOperation struct { type StartOperation struct {
......
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