Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
97e2f8df
Commit
97e2f8df
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c9a5f7ac
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
113 deletions
+72
-113
go/neo/proto.go
go/neo/proto.go
+3
-2
go/neo/py/pyneo-gen-testdata
go/neo/py/pyneo-gen-testdata
+4
-2
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+63
-107
go/neo/ztestdata_proto_py_test.go
go/neo/ztestdata_proto_py_test.go
+2
-2
No files found.
go/neo/proto.go
View file @
97e2f8df
...
...
@@ -735,10 +735,12 @@ type TweakPartitionTable struct {
// XXX _answer = Error
}
/*
// Ask node information
type NodeInformation struct {
// XXX _answer = PFEmpty
}
*/
// Set the cluster state
type
SetClusterState
struct
{
...
...
@@ -747,7 +749,7 @@ type SetClusterState struct {
// XXX _answer = Error
}
//
XXX only helper: should not be presented as packet
//
neo:proto typeonly
type
repairFlags
struct
{
DryRun
bool
// pruneOrphan bool
...
...
@@ -767,7 +769,6 @@ type RepairOne struct {
}
// Notify information about the cluster state
// XXX = NotifyClusterInformation in py
type
NotifyClusterState
struct
{
State
ClusterState
}
...
...
go/neo/py/pyneo-gen-testdata
View file @
97e2f8df
...
...
@@ -49,6 +49,8 @@ noask('NodeList')
_
=
renames
_
[
'AskPrimary'
]
=
'PrimaryMaster'
_
[
'AskObject'
]
=
'GetObject'
_
[
'NotifyRepair'
]
=
'RepairOne'
# XXX ok?
_
[
'NotifyClusterInformation'
]
=
'NotifyClusterState'
def
main
():
...
...
go/neo/zproto-marshal.go
View file @
97e2f8df
...
...
@@ -2589,27 +2589,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 65. NodeInformation
func
(
*
NodeInformation
)
neoMsgCode
()
uint16
{
return
65
}
func
(
p
*
NodeInformation
)
neoMsgEncodedLen
()
int
{
return
0
}
func
(
p
*
NodeInformation
)
neoMsgEncode
(
data
[]
byte
)
{
}
func
(
p
*
NodeInformation
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
return
0
,
nil
}
// 66. SetClusterState
// 65. SetClusterState
func
(
*
SetClusterState
)
neoMsgCode
()
uint16
{
return
6
6
return
6
5
}
func
(
p
*
SetClusterState
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2631,35 +2614,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 67. repairFlags
func
(
*
repairFlags
)
neoMsgCode
()
uint16
{
return
67
}
func
(
p
*
repairFlags
)
neoMsgEncodedLen
()
int
{
return
1
}
func
(
p
*
repairFlags
)
neoMsgEncode
(
data
[]
byte
)
{
(
data
[
0
:
])[
0
]
=
bool2byte
(
p
.
DryRun
)
}
func
(
p
*
repairFlags
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
1
{
goto
overflow
}
p
.
DryRun
=
byte2bool
((
data
[
0
:
])[
0
])
return
1
,
nil
overflow
:
return
0
,
ErrDecodeOverflow
}
// 68. Repair
// 66. Repair
func
(
*
Repair
)
neoMsgCode
()
uint16
{
return
6
8
return
6
6
}
func
(
p
*
Repair
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2706,10 +2664,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 6
9
. RepairOne
// 6
7
. RepairOne
func
(
*
RepairOne
)
neoMsgCode
()
uint16
{
return
6
9
return
6
7
}
func
(
p
*
RepairOne
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2731,10 +2689,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
//
70
. NotifyClusterState
//
68
. NotifyClusterState
func
(
*
NotifyClusterState
)
neoMsgCode
()
uint16
{
return
70
return
68
}
func
(
p
*
NotifyClusterState
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2756,10 +2714,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
//
71
. AskClusterState
//
69
. AskClusterState
func
(
*
AskClusterState
)
neoMsgCode
()
uint16
{
return
71
return
69
}
func
(
p
*
AskClusterState
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2773,10 +2731,10 @@ func (p *AskClusterState) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
}
// 7
2
. AnswerClusterState
// 7
0
. AnswerClusterState
func
(
*
AnswerClusterState
)
neoMsgCode
()
uint16
{
return
7
2
|
answerBit
return
7
0
|
answerBit
}
func
(
p
*
AnswerClusterState
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2798,10 +2756,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 7
3
. ObjectUndoSerial
// 7
1
. ObjectUndoSerial
func
(
*
ObjectUndoSerial
)
neoMsgCode
()
uint16
{
return
7
3
return
7
1
}
func
(
p
*
ObjectUndoSerial
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2852,10 +2810,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 7
4
. AnswerObjectUndoSerial
// 7
2
. AnswerObjectUndoSerial
func
(
*
AnswerObjectUndoSerial
)
neoMsgCode
()
uint16
{
return
7
4
|
answerBit
return
7
2
|
answerBit
}
func
(
p
*
AnswerObjectUndoSerial
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2920,10 +2878,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 7
5
. CheckCurrentSerial
// 7
3
. CheckCurrentSerial
func
(
*
CheckCurrentSerial
)
neoMsgCode
()
uint16
{
return
7
5
return
7
3
}
func
(
p
*
CheckCurrentSerial
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2949,10 +2907,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 7
6
. Pack
// 7
4
. Pack
func
(
*
Pack
)
neoMsgCode
()
uint16
{
return
7
6
return
7
4
}
func
(
p
*
Pack
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2974,10 +2932,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 7
7
. AnswerPack
// 7
5
. AnswerPack
func
(
*
AnswerPack
)
neoMsgCode
()
uint16
{
return
7
7
|
answerBit
return
7
5
|
answerBit
}
func
(
p
*
AnswerPack
)
neoMsgEncodedLen
()
int
{
...
...
@@ -2999,10 +2957,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 7
8
. CheckReplicas
// 7
6
. CheckReplicas
func
(
*
CheckReplicas
)
neoMsgCode
()
uint16
{
return
7
8
return
7
6
}
func
(
p
*
CheckReplicas
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3057,10 +3015,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 7
9
. CheckPartition
// 7
7
. CheckPartition
func
(
*
CheckPartition
)
neoMsgCode
()
uint16
{
return
7
9
return
7
7
}
func
(
p
*
CheckPartition
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3123,10 +3081,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
//
80
. CheckTIDRange
//
78
. CheckTIDRange
func
(
*
CheckTIDRange
)
neoMsgCode
()
uint16
{
return
80
return
78
}
func
(
p
*
CheckTIDRange
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3154,10 +3112,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
//
81
. AnswerCheckTIDRange
//
79
. AnswerCheckTIDRange
func
(
*
AnswerCheckTIDRange
)
neoMsgCode
()
uint16
{
return
81
|
answerBit
return
79
|
answerBit
}
func
(
p
*
AnswerCheckTIDRange
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3183,10 +3141,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 8
2
. CheckSerialRange
// 8
0
. CheckSerialRange
func
(
*
CheckSerialRange
)
neoMsgCode
()
uint16
{
return
8
2
return
8
0
}
func
(
p
*
CheckSerialRange
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3216,10 +3174,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 8
3
. AnswerCheckSerialRange
// 8
1
. AnswerCheckSerialRange
func
(
*
AnswerCheckSerialRange
)
neoMsgCode
()
uint16
{
return
8
3
|
answerBit
return
8
1
|
answerBit
}
func
(
p
*
AnswerCheckSerialRange
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3249,10 +3207,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 8
4
. PartitionCorrupted
// 8
2
. PartitionCorrupted
func
(
*
PartitionCorrupted
)
neoMsgCode
()
uint16
{
return
8
4
return
8
2
}
func
(
p
*
PartitionCorrupted
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3299,10 +3257,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 8
5
. LastTransaction
// 8
3
. LastTransaction
func
(
*
LastTransaction
)
neoMsgCode
()
uint16
{
return
8
5
return
8
3
}
func
(
p
*
LastTransaction
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3316,10 +3274,10 @@ func (p *LastTransaction) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
}
// 8
6
. AnswerLastTransaction
// 8
4
. AnswerLastTransaction
func
(
*
AnswerLastTransaction
)
neoMsgCode
()
uint16
{
return
8
6
|
answerBit
return
8
4
|
answerBit
}
func
(
p
*
AnswerLastTransaction
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3341,10 +3299,10 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 8
7
. NotifyReady
// 8
5
. NotifyReady
func
(
*
NotifyReady
)
neoMsgCode
()
uint16
{
return
8
7
return
8
5
}
func
(
p
*
NotifyReady
)
neoMsgEncodedLen
()
int
{
...
...
@@ -3425,27 +3383,25 @@ var msgTypeRegistry = map[uint16]reflect.Type{
62
:
reflect
.
TypeOf
(
SetNodeState
{}),
63
:
reflect
.
TypeOf
(
AddPendingNodes
{}),
64
:
reflect
.
TypeOf
(
TweakPartitionTable
{}),
65
:
reflect
.
TypeOf
(
NodeInformation
{}),
66
:
reflect
.
TypeOf
(
SetClusterState
{}),
67
:
reflect
.
TypeOf
(
repairFlags
{}),
68
:
reflect
.
TypeOf
(
Repair
{}),
69
:
reflect
.
TypeOf
(
RepairOne
{}),
70
:
reflect
.
TypeOf
(
NotifyClusterState
{}),
71
:
reflect
.
TypeOf
(
AskClusterState
{}),
72
|
answerBit
:
reflect
.
TypeOf
(
AnswerClusterState
{}),
73
:
reflect
.
TypeOf
(
ObjectUndoSerial
{}),
74
|
answerBit
:
reflect
.
TypeOf
(
AnswerObjectUndoSerial
{}),
75
:
reflect
.
TypeOf
(
CheckCurrentSerial
{}),
76
:
reflect
.
TypeOf
(
Pack
{}),
77
|
answerBit
:
reflect
.
TypeOf
(
AnswerPack
{}),
78
:
reflect
.
TypeOf
(
CheckReplicas
{}),
79
:
reflect
.
TypeOf
(
CheckPartition
{}),
80
:
reflect
.
TypeOf
(
CheckTIDRange
{}),
81
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckTIDRange
{}),
82
:
reflect
.
TypeOf
(
CheckSerialRange
{}),
83
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckSerialRange
{}),
84
:
reflect
.
TypeOf
(
PartitionCorrupted
{}),
85
:
reflect
.
TypeOf
(
LastTransaction
{}),
86
|
answerBit
:
reflect
.
TypeOf
(
AnswerLastTransaction
{}),
87
:
reflect
.
TypeOf
(
NotifyReady
{}),
65
:
reflect
.
TypeOf
(
SetClusterState
{}),
66
:
reflect
.
TypeOf
(
Repair
{}),
67
:
reflect
.
TypeOf
(
RepairOne
{}),
68
:
reflect
.
TypeOf
(
NotifyClusterState
{}),
69
:
reflect
.
TypeOf
(
AskClusterState
{}),
70
|
answerBit
:
reflect
.
TypeOf
(
AnswerClusterState
{}),
71
:
reflect
.
TypeOf
(
ObjectUndoSerial
{}),
72
|
answerBit
:
reflect
.
TypeOf
(
AnswerObjectUndoSerial
{}),
73
:
reflect
.
TypeOf
(
CheckCurrentSerial
{}),
74
:
reflect
.
TypeOf
(
Pack
{}),
75
|
answerBit
:
reflect
.
TypeOf
(
AnswerPack
{}),
76
:
reflect
.
TypeOf
(
CheckReplicas
{}),
77
:
reflect
.
TypeOf
(
CheckPartition
{}),
78
:
reflect
.
TypeOf
(
CheckTIDRange
{}),
79
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckTIDRange
{}),
80
:
reflect
.
TypeOf
(
CheckSerialRange
{}),
81
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckSerialRange
{}),
82
:
reflect
.
TypeOf
(
PartitionCorrupted
{}),
83
:
reflect
.
TypeOf
(
LastTransaction
{}),
84
|
answerBit
:
reflect
.
TypeOf
(
AnswerLastTransaction
{}),
85
:
reflect
.
TypeOf
(
NotifyReady
{}),
}
go/neo/ztestdata_proto_py_test.go
View file @
97e2f8df
...
...
@@ -44,8 +44,8 @@ var pyMsgRegistry = map[uint16]string{
64
:
"TweakPartitionTable"
,
65
:
"SetClusterState"
,
66
:
"Repair"
,
67
:
"
NotifyRepair
"
,
68
:
"NotifyCluster
Information
"
,
67
:
"
RepairOne
"
,
68
:
"NotifyCluster
State
"
,
69
:
"AskClusterState"
,
71
:
"AskObjectUndoSerial"
,
73
:
"AskTIDsFrom"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment