Commit 27a78346 authored by Levin Zimmermann's avatar Levin Zimmermann

go/neo/proto: Update msgcode increment logic to new protocol

In pre-msgpack protocol, the msgcode increment logic is like this:

Notify 	 add +1 to next msgcode
Request  add +0 to next msgcode   (next msg is answer & should therefore be the same)
Answer 	 add +1 to next msgcode

('Answer' msgcode is adjusted by 'AnswerBit')

In post-msgpack protocol, the logic is a bit different:

Notify 	 add +1 to next msgcode
Request  add +0 to next msgcode   (next msg is answer & should therefore be the same)
Answer 	 add +2 to next msgcode

So here we produce gaps after Request/Answer pairs.
parent 94a43764
......@@ -371,12 +371,18 @@ import (
// generate code for this type to implement neo.Msg
var msgCode MsgCode
msgCode.answer = specAnnotation.answer || strings.HasPrefix(typename, "Answer")
msgCode.msgSerial = msgSerial
// increment msgSerial only by +1 when going from
// request1->request2 in `Request1 Answer1 Request2`.
// Unlike as it was in pre-msgpack protocol, the global
// increment is still +1, only for the answer packet
// itself it's the same as the request packet. This means
// in the post-msgpack protocol there are gaps.
if msgCode.answer && typename != "Error" {
msgSerial--
msgCode.msgSerial = msgSerial - 1
}
msgCode.msgSerial = msgSerial
fmt.Fprintf(&buf, "// %s. %s\n\n", msgCode, typename)
......
......@@ -558,10 +558,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 2. Ping
// 3. Ping
func (*Ping) neoMsgCode() uint16 {
return 2
return 3
}
func (p *Ping) neoMsgEncodedLenN() int {
......@@ -596,10 +596,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 2 | answerBit. Pong
// 3 | answerBit. Pong
func (*Pong) neoMsgCode() uint16 {
return 2 | answerBit
return 3 | answerBit
}
func (p *Pong) neoMsgEncodedLenN() int {
......@@ -634,10 +634,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 3. CloseClient
// 5. CloseClient
func (*CloseClient) neoMsgCode() uint16 {
return 3
return 5
}
func (p *CloseClient) neoMsgEncodedLenN() int {
......@@ -672,10 +672,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 4. PrimaryMaster
// 6. PrimaryMaster
func (*PrimaryMaster) neoMsgCode() uint16 {
return 4
return 6
}
func (p *PrimaryMaster) neoMsgEncodedLenN() int {
......@@ -710,10 +710,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 4 | answerBit. AnswerPrimary
// 6 | answerBit. AnswerPrimary
func (*AnswerPrimary) neoMsgCode() uint16 {
return 4 | answerBit
return 6 | answerBit
}
func (p *AnswerPrimary) neoMsgEncodedLenN() int {
......@@ -771,10 +771,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 5. NotPrimaryMaster
// 8. NotPrimaryMaster
func (*NotPrimaryMaster) neoMsgCode() uint16 {
return 5
return 8
}
func (p *NotPrimaryMaster) neoMsgEncodedLenN() int {
......@@ -933,10 +933,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 6. NotifyNodeInformation
// 9. NotifyNodeInformation
func (*NotifyNodeInformation) neoMsgCode() uint16 {
return 6
return 9
}
func (p *NotifyNodeInformation) neoMsgEncodedLenN() int {
......@@ -1197,10 +1197,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 7. Recovery
// 10. Recovery
func (*Recovery) neoMsgCode() uint16 {
return 7
return 10
}
func (p *Recovery) neoMsgEncodedLenN() int {
......@@ -1235,10 +1235,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 7 | answerBit. AnswerRecovery
// 10 | answerBit. AnswerRecovery
func (*AnswerRecovery) neoMsgCode() uint16 {
return 7 | answerBit
return 10 | answerBit
}
func (p *AnswerRecovery) neoMsgEncodedLenN() int {
......@@ -1323,10 +1323,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 8. LastIDs
// 12. LastIDs
func (*LastIDs) neoMsgCode() uint16 {
return 8
return 12
}
func (p *LastIDs) neoMsgEncodedLenN() int {
......@@ -1361,10 +1361,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 8 | answerBit. AnswerLastIDs
// 12 | answerBit. AnswerLastIDs
func (*AnswerLastIDs) neoMsgCode() uint16 {
return 8 | answerBit
return 12 | answerBit
}
func (p *AnswerLastIDs) neoMsgEncodedLenN() int {
......@@ -1429,10 +1429,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 9. AskPartitionTable
// 14. AskPartitionTable
func (*AskPartitionTable) neoMsgCode() uint16 {
return 9
return 14
}
func (p *AskPartitionTable) neoMsgEncodedLenN() int {
......@@ -1467,10 +1467,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 9 | answerBit. AnswerPartitionTable
// 14 | answerBit. AnswerPartitionTable
func (*AnswerPartitionTable) neoMsgCode() uint16 {
return 9 | answerBit
return 14 | answerBit
}
func (p *AnswerPartitionTable) neoMsgEncodedLenN() int {
......@@ -1699,10 +1699,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 10. SendPartitionTable
// 16. SendPartitionTable
func (*SendPartitionTable) neoMsgCode() uint16 {
return 10
return 16
}
func (p *SendPartitionTable) neoMsgEncodedLenN() int {
......@@ -1931,10 +1931,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 11. NotifyPartitionChanges
// 17. NotifyPartitionChanges
func (*NotifyPartitionChanges) neoMsgCode() uint16 {
return 11
return 17
}
func (p *NotifyPartitionChanges) neoMsgEncodedLenN() int {
......@@ -2134,10 +2134,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 12. StartOperation
// 18. StartOperation
func (*StartOperation) neoMsgCode() uint16 {
return 12
return 18
}
func (p *StartOperation) neoMsgEncodedLenN() int {
......@@ -2189,10 +2189,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 13. StopOperation
// 19. StopOperation
func (*StopOperation) neoMsgCode() uint16 {
return 13
return 19
}
func (p *StopOperation) neoMsgEncodedLenN() int {
......@@ -2227,10 +2227,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 14. UnfinishedTransactions
// 20. UnfinishedTransactions
func (*UnfinishedTransactions) neoMsgCode() uint16 {
return 14
return 20
}
func (p *UnfinishedTransactions) neoMsgEncodedLenN() int {
......@@ -2345,10 +2345,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 14 | answerBit. AnswerUnfinishedTransactions
// 20 | answerBit. AnswerUnfinishedTransactions
func (*AnswerUnfinishedTransactions) neoMsgCode() uint16 {
return 14 | answerBit
return 20 | answerBit
}
func (p *AnswerUnfinishedTransactions) neoMsgEncodedLenN() int {
......@@ -2468,10 +2468,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 15. LockedTransactions
// 22. LockedTransactions
func (*LockedTransactions) neoMsgCode() uint16 {
return 15
return 22
}
func (p *LockedTransactions) neoMsgEncodedLenN() int {
......@@ -2506,10 +2506,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 15 | answerBit. AnswerLockedTransactions
// 22 | answerBit. AnswerLockedTransactions
func (*AnswerLockedTransactions) neoMsgCode() uint16 {
return 15 | answerBit
return 22 | answerBit
}
func (p *AnswerLockedTransactions) neoMsgEncodedLenN() int {
......@@ -2635,10 +2635,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 16. FinalTID
// 24. FinalTID
func (*FinalTID) neoMsgCode() uint16 {
return 16
return 24
}
func (p *FinalTID) neoMsgEncodedLenN() int {
......@@ -2691,10 +2691,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 16 | answerBit. AnswerFinalTID
// 24 | answerBit. AnswerFinalTID
func (*AnswerFinalTID) neoMsgCode() uint16 {
return 16 | answerBit
return 24 | answerBit
}
func (p *AnswerFinalTID) neoMsgEncodedLenN() int {
......@@ -2747,10 +2747,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 17. ValidateTransaction
// 26. ValidateTransaction
func (*ValidateTransaction) neoMsgCode() uint16 {
return 17
return 26
}
func (p *ValidateTransaction) neoMsgEncodedLenN() int {
......@@ -2815,10 +2815,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 18. BeginTransaction
// 27. BeginTransaction
func (*BeginTransaction) neoMsgCode() uint16 {
return 18
return 27
}
func (p *BeginTransaction) neoMsgEncodedLenN() int {
......@@ -2871,10 +2871,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 18 | answerBit. AnswerBeginTransaction
// 27 | answerBit. AnswerBeginTransaction
func (*AnswerBeginTransaction) neoMsgCode() uint16 {
return 18 | answerBit
return 27 | answerBit
}
func (p *AnswerBeginTransaction) neoMsgEncodedLenN() int {
......@@ -2927,10 +2927,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 19. FailedVote
// 29. FailedVote
func (*FailedVote) neoMsgCode() uint16 {
return 19
return 29
}
func (p *FailedVote) neoMsgEncodedLenN() int {
......@@ -3048,10 +3048,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 20. FinishTransaction
// 30. FinishTransaction
func (*FinishTransaction) neoMsgCode() uint16 {
return 20
return 30
}
func (p *FinishTransaction) neoMsgEncodedLenN() int {
......@@ -3227,10 +3227,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 20 | answerBit. AnswerTransactionFinished
// 30 | answerBit. AnswerTransactionFinished
func (*AnswerTransactionFinished) neoMsgCode() uint16 {
return 20 | answerBit
return 30 | answerBit
}
func (p *AnswerTransactionFinished) neoMsgEncodedLenN() int {
......@@ -3295,10 +3295,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 21. LockInformation
// 32. LockInformation
func (*LockInformation) neoMsgCode() uint16 {
return 21
return 32
}
func (p *LockInformation) neoMsgEncodedLenN() int {
......@@ -3363,10 +3363,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 21 | answerBit. AnswerInformationLocked
// 32 | answerBit. AnswerInformationLocked
func (*AnswerInformationLocked) neoMsgCode() uint16 {
return 21 | answerBit
return 32 | answerBit
}
func (p *AnswerInformationLocked) neoMsgEncodedLenN() int {
......@@ -3419,10 +3419,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 22. InvalidateObjects
// 34. InvalidateObjects
func (*InvalidateObjects) neoMsgCode() uint16 {
return 22
return 34
}
func (p *InvalidateObjects) neoMsgEncodedLenN() int {
......@@ -3538,10 +3538,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 23. NotifyUnlockInformation
// 35. NotifyUnlockInformation
func (*NotifyUnlockInformation) neoMsgCode() uint16 {
return 23
return 35
}
func (p *NotifyUnlockInformation) neoMsgEncodedLenN() int {
......@@ -3594,10 +3594,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 24. AskNewOIDs
// 36. AskNewOIDs
func (*AskNewOIDs) neoMsgCode() uint16 {
return 24
return 36
}
func (p *AskNewOIDs) neoMsgEncodedLenN() int {
......@@ -3655,10 +3655,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 24 | answerBit. AnswerNewOIDs
// 36 | answerBit. AnswerNewOIDs
func (*AnswerNewOIDs) neoMsgCode() uint16 {
return 24 | answerBit
return 36 | answerBit
}
func (p *AnswerNewOIDs) neoMsgEncodedLenN() int {
......@@ -3762,10 +3762,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 25. NotifyDeadlock
// 38. NotifyDeadlock
func (*NotifyDeadlock) neoMsgCode() uint16 {
return 25
return 38
}
func (p *NotifyDeadlock) neoMsgEncodedLenN() int {
......@@ -3830,10 +3830,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 26. RebaseTransaction
// 39. RebaseTransaction
func (*RebaseTransaction) neoMsgCode() uint16 {
return 26
return 39
}
func (p *RebaseTransaction) neoMsgEncodedLenN() int {
......@@ -3898,10 +3898,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 26 | answerBit. AnswerRebaseTransaction
// 39 | answerBit. AnswerRebaseTransaction
func (*AnswerRebaseTransaction) neoMsgCode() uint16 {
return 26 | answerBit
return 39 | answerBit
}
func (p *AnswerRebaseTransaction) neoMsgEncodedLenN() int {
......@@ -4005,10 +4005,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 27. RebaseObject
// 41. RebaseObject
func (*RebaseObject) neoMsgCode() uint16 {
return 27
return 41
}
func (p *RebaseObject) neoMsgEncodedLenN() int {
......@@ -4073,10 +4073,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 27 | answerBit. AnswerRebaseObject
// 41 | answerBit. AnswerRebaseObject
func (*AnswerRebaseObject) neoMsgCode() uint16 {
return 27 | answerBit
return 41 | answerBit
}
func (p *AnswerRebaseObject) neoMsgEncodedLenN() int {
......@@ -4202,10 +4202,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 28. StoreObject
// 43. StoreObject
func (*StoreObject) neoMsgCode() uint16 {
return 28
return 43
}
func (p *StoreObject) neoMsgEncodedLenN() int {
......@@ -4358,10 +4358,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 28 | answerBit. AnswerStoreObject
// 43 | answerBit. AnswerStoreObject
func (*AnswerStoreObject) neoMsgCode() uint16 {
return 28 | answerBit
return 43 | answerBit
}
func (p *AnswerStoreObject) neoMsgEncodedLenN() int {
......@@ -4414,10 +4414,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 29. AbortTransaction
// 45. AbortTransaction
func (*AbortTransaction) neoMsgCode() uint16 {
return 29
return 45
}
func (p *AbortTransaction) neoMsgEncodedLenN() int {
......@@ -4535,10 +4535,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 30. StoreTransaction
// 46. StoreTransaction
func (*StoreTransaction) neoMsgCode() uint16 {
return 30
return 46
}
func (p *StoreTransaction) neoMsgEncodedLenN() int {
......@@ -4753,10 +4753,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 30 | answerBit. AnswerStoreTransaction
// 46 | answerBit. AnswerStoreTransaction
func (*AnswerStoreTransaction) neoMsgCode() uint16 {
return 30 | answerBit
return 46 | answerBit
}
func (p *AnswerStoreTransaction) neoMsgEncodedLenN() int {
......@@ -4791,10 +4791,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 31. VoteTransaction
// 48. VoteTransaction
func (*VoteTransaction) neoMsgCode() uint16 {
return 31
return 48
}
func (p *VoteTransaction) neoMsgEncodedLenN() int {
......@@ -4847,10 +4847,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 31 | answerBit. AnswerVoteTransaction
// 48 | answerBit. AnswerVoteTransaction
func (*AnswerVoteTransaction) neoMsgCode() uint16 {
return 31 | answerBit
return 48 | answerBit
}
func (p *AnswerVoteTransaction) neoMsgEncodedLenN() int {
......@@ -4885,10 +4885,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 32. GetObject
// 50. GetObject
func (*GetObject) neoMsgCode() uint16 {
return 32
return 50
}
func (p *GetObject) neoMsgEncodedLenN() int {
......@@ -4965,10 +4965,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 32 | answerBit. AnswerObject
// 50 | answerBit. AnswerObject
func (*AnswerObject) neoMsgCode() uint16 {
return 32 | answerBit
return 50 | answerBit
}
func (p *AnswerObject) neoMsgEncodedLenN() int {
......@@ -5121,10 +5121,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 33. AskTIDs
// 52. AskTIDs
func (*AskTIDs) neoMsgCode() uint16 {
return 33
return 52
}
func (p *AskTIDs) neoMsgEncodedLenN() int {
......@@ -5212,10 +5212,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 33 | answerBit. AnswerTIDs
// 52 | answerBit. AnswerTIDs
func (*AnswerTIDs) neoMsgCode() uint16 {
return 33 | answerBit
return 52 | answerBit
}
func (p *AnswerTIDs) neoMsgEncodedLenN() int {
......@@ -5319,10 +5319,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 34. TransactionInformation
// 54. TransactionInformation
func (*TransactionInformation) neoMsgCode() uint16 {
return 34
return 54
}
func (p *TransactionInformation) neoMsgEncodedLenN() int {
......@@ -5375,10 +5375,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 34 | answerBit. AnswerTransactionInformation
// 54 | answerBit. AnswerTransactionInformation
func (*AnswerTransactionInformation) neoMsgCode() uint16 {
return 34 | answerBit
return 54 | answerBit
}
func (p *AnswerTransactionInformation) neoMsgEncodedLenN() int {
......@@ -5608,10 +5608,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 35. ObjectHistory
// 56. ObjectHistory
func (*ObjectHistory) neoMsgCode() uint16 {
return 35
return 56
}
func (p *ObjectHistory) neoMsgEncodedLenN() int {
......@@ -5696,10 +5696,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 35 | answerBit. AnswerObjectHistory
// 56 | answerBit. AnswerObjectHistory
func (*AnswerObjectHistory) neoMsgCode() uint16 {
return 35 | answerBit
return 56 | answerBit
}
func (p *AnswerObjectHistory) neoMsgEncodedLenN() int {
......@@ -5844,10 +5844,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 36. PartitionList
// 58. PartitionList
func (*PartitionList) neoMsgCode() uint16 {
return 36
return 58
}
func (p *PartitionList) neoMsgEncodedLenN() int {
......@@ -5935,10 +5935,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 36 | answerBit. AnswerPartitionList
// 58 | answerBit. AnswerPartitionList
func (*AnswerPartitionList) neoMsgCode() uint16 {
return 36 | answerBit
return 58 | answerBit
}
func (p *AnswerPartitionList) neoMsgEncodedLenN() int {
......@@ -6167,10 +6167,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 37. NodeList
// 60. NodeList
func (*NodeList) neoMsgCode() uint16 {
return 37
return 60
}
func (p *NodeList) neoMsgEncodedLenN() int {
......@@ -6232,10 +6232,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 37 | answerBit. AnswerNodeList
// 60 | answerBit. AnswerNodeList
func (*AnswerNodeList) neoMsgCode() uint16 {
return 37 | answerBit
return 60 | answerBit
}
func (p *AnswerNodeList) neoMsgEncodedLenN() int {
......@@ -6473,10 +6473,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 38. SetNodeState
// 62. SetNodeState
func (*SetNodeState) neoMsgCode() uint16 {
return 38
return 62
}
func (p *SetNodeState) neoMsgEncodedLenN() int {
......@@ -6558,10 +6558,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 39. AddPendingNodes
// 63. AddPendingNodes
func (*AddPendingNodes) neoMsgCode() uint16 {
return 39
return 63
}
func (p *AddPendingNodes) neoMsgEncodedLenN() int {
......@@ -6667,10 +6667,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 40. TweakPartitionTable
// 64. TweakPartitionTable
func (*TweakPartitionTable) neoMsgCode() uint16 {
return 40
return 64
}
func (p *TweakPartitionTable) neoMsgEncodedLenN() int {
......@@ -6787,10 +6787,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 40 | answerBit. AnswerTweakPartitionTable
// 64 | answerBit. AnswerTweakPartitionTable
func (*AnswerTweakPartitionTable) neoMsgCode() uint16 {
return 40 | answerBit
return 64 | answerBit
}
func (p *AnswerTweakPartitionTable) neoMsgEncodedLenN() int {
......@@ -7000,10 +7000,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 41. SetNumReplicas
// 66. SetNumReplicas
func (*SetNumReplicas) neoMsgCode() uint16 {
return 41
return 66
}
func (p *SetNumReplicas) neoMsgEncodedLenN() int {
......@@ -7061,10 +7061,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 42. SetClusterState
// 67. SetClusterState
func (*SetClusterState) neoMsgCode() uint16 {
return 42
return 67
}
func (p *SetClusterState) neoMsgEncodedLenN() int {
......@@ -7126,10 +7126,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 43. Repair
// 68. Repair
func (*Repair) neoMsgCode() uint16 {
return 43
return 68
}
func (p *Repair) neoMsgEncodedLenN() int {
......@@ -7253,10 +7253,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 44. RepairOne
// 69. RepairOne
func (*RepairOne) neoMsgCode() uint16 {
return 44
return 69
}
func (p *RepairOne) neoMsgEncodedLenN() int {
......@@ -7312,10 +7312,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 45. NotifyClusterState
// 70. NotifyClusterState
func (*NotifyClusterState) neoMsgCode() uint16 {
return 45
return 70
}
func (p *NotifyClusterState) neoMsgEncodedLenN() int {
......@@ -7377,10 +7377,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 46. AskClusterState
// 71. AskClusterState
func (*AskClusterState) neoMsgCode() uint16 {
return 46
return 71
}
func (p *AskClusterState) neoMsgEncodedLenN() int {
......@@ -7415,10 +7415,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 46 | answerBit. AnswerClusterState
// 71 | answerBit. AnswerClusterState
func (*AnswerClusterState) neoMsgCode() uint16 {
return 46 | answerBit
return 71 | answerBit
}
func (p *AnswerClusterState) neoMsgEncodedLenN() int {
......@@ -7480,10 +7480,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 47. ObjectUndoSerial
// 73. ObjectUndoSerial
func (*ObjectUndoSerial) neoMsgCode() uint16 {
return 47
return 73
}
func (p *ObjectUndoSerial) neoMsgEncodedLenN() int {
......@@ -7623,10 +7623,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 47 | answerBit. AnswerObjectUndoSerial
// 73 | answerBit. AnswerObjectUndoSerial
func (*AnswerObjectUndoSerial) neoMsgCode() uint16 {
return 47 | answerBit
return 73 | answerBit
}
func (p *AnswerObjectUndoSerial) neoMsgEncodedLenN() int {
......@@ -7799,10 +7799,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 48. AskTIDsFrom
// 75. AskTIDsFrom
func (*AskTIDsFrom) neoMsgCode() uint16 {
return 48
return 75
}
func (p *AskTIDsFrom) neoMsgEncodedLenN() int {
......@@ -7899,10 +7899,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 48 | answerBit. AnswerTIDsFrom
// 75 | answerBit. AnswerTIDsFrom
func (*AnswerTIDsFrom) neoMsgCode() uint16 {
return 48 | answerBit
return 75 | answerBit
}
func (p *AnswerTIDsFrom) neoMsgEncodedLenN() int {
......@@ -8006,10 +8006,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 49. Pack
// 77. Pack
func (*Pack) neoMsgCode() uint16 {
return 49
return 77
}
func (p *Pack) neoMsgEncodedLenN() int {
......@@ -8062,10 +8062,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 49 | answerBit. AnswerPack
// 77 | answerBit. AnswerPack
func (*AnswerPack) neoMsgCode() uint16 {
return 49 | answerBit
return 77 | answerBit
}
func (p *AnswerPack) neoMsgEncodedLenN() int {
......@@ -8117,10 +8117,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 50. CheckReplicas
// 79. CheckReplicas
func (*CheckReplicas) neoMsgCode() uint16 {
return 50
return 79
}
func (p *CheckReplicas) neoMsgEncodedLenN() int {
......@@ -8277,10 +8277,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 51. CheckPartition
// 80. CheckPartition
func (*CheckPartition) neoMsgCode() uint16 {
return 51
return 80
}
func (p *CheckPartition) neoMsgEncodedLenN() int {
......@@ -8459,10 +8459,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 52. CheckTIDRange
// 81. CheckTIDRange
func (*CheckTIDRange) neoMsgCode() uint16 {
return 52
return 81
}
func (p *CheckTIDRange) neoMsgEncodedLenN() int {
......@@ -8562,10 +8562,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 52 | answerBit. AnswerCheckTIDRange
// 81 | answerBit. AnswerCheckTIDRange
func (*AnswerCheckTIDRange) neoMsgCode() uint16 {
return 52 | answerBit
return 81 | answerBit
}
func (p *AnswerCheckTIDRange) neoMsgEncodedLenN() int {
......@@ -8650,10 +8650,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 53. CheckSerialRange
// 83. CheckSerialRange
func (*CheckSerialRange) neoMsgCode() uint16 {
return 53
return 83
}
func (p *CheckSerialRange) neoMsgEncodedLenN() int {
......@@ -8765,10 +8765,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 53 | answerBit. AnswerCheckSerialRange
// 83 | answerBit. AnswerCheckSerialRange
func (*AnswerCheckSerialRange) neoMsgCode() uint16 {
return 53 | answerBit
return 83 | answerBit
}
func (p *AnswerCheckSerialRange) neoMsgEncodedLenN() int {
......@@ -8877,10 +8877,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 54. PartitionCorrupted
// 85. PartitionCorrupted
func (*PartitionCorrupted) neoMsgCode() uint16 {
return 54
return 85
}
func (p *PartitionCorrupted) neoMsgEncodedLenN() int {
......@@ -9001,10 +9001,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 55. NotifyReady
// 86. NotifyReady
func (*NotifyReady) neoMsgCode() uint16 {
return 55
return 86
}
func (p *NotifyReady) neoMsgEncodedLenN() int {
......@@ -9039,10 +9039,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 56. LastTransaction
// 87. LastTransaction
func (*LastTransaction) neoMsgCode() uint16 {
return 56
return 87
}
func (p *LastTransaction) neoMsgEncodedLenN() int {
......@@ -9077,10 +9077,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 56 | answerBit. AnswerLastTransaction
// 87 | answerBit. AnswerLastTransaction
func (*AnswerLastTransaction) neoMsgCode() uint16 {
return 56 | answerBit
return 87 | answerBit
}
func (p *AnswerLastTransaction) neoMsgEncodedLenN() int {
......@@ -9133,10 +9133,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 57. CheckCurrentSerial
// 89. CheckCurrentSerial
func (*CheckCurrentSerial) neoMsgCode() uint16 {
return 57
return 89
}
func (p *CheckCurrentSerial) neoMsgEncodedLenN() int {
......@@ -9213,10 +9213,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 57 | answerBit. AnswerCheckCurrentSerial
// 89 | answerBit. AnswerCheckCurrentSerial
func (*AnswerCheckCurrentSerial) neoMsgCode() uint16 {
return 57 | answerBit
return 89 | answerBit
}
func (p *AnswerCheckCurrentSerial) neoMsgEncodedLenN() int {
......@@ -9273,10 +9273,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 58. NotifyTransactionFinished
// 91. NotifyTransactionFinished
func (*NotifyTransactionFinished) neoMsgCode() uint16 {
return 58
return 91
}
func (p *NotifyTransactionFinished) neoMsgEncodedLenN() int {
......@@ -9341,10 +9341,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 59. Replicate
// 92. Replicate
func (*Replicate) neoMsgCode() uint16 {
return 59
return 92
}
func (p *Replicate) neoMsgEncodedLenN() int {
......@@ -9539,10 +9539,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 60. ReplicationDone
// 93. ReplicationDone
func (*ReplicationDone) neoMsgCode() uint16 {
return 60
return 93
}
func (p *ReplicationDone) neoMsgEncodedLenN() int {
......@@ -9615,10 +9615,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 61. FetchTransactions
// 94. FetchTransactions
func (*FetchTransactions) neoMsgCode() uint16 {
return 61
return 94
}
func (p *FetchTransactions) neoMsgEncodedLenN() int {
......@@ -9780,10 +9780,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 61 | answerBit. AnswerFetchTransactions
// 94 | answerBit. AnswerFetchTransactions
func (*AnswerFetchTransactions) neoMsgCode() uint16 {
return 61 | answerBit
return 94 | answerBit
}
func (p *AnswerFetchTransactions) neoMsgEncodedLenN() int {
......@@ -9911,10 +9911,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 62. FetchObjects
// 96. FetchObjects
func (*FetchObjects) neoMsgCode() uint16 {
return 62
return 96
}
func (p *FetchObjects) neoMsgEncodedLenN() int {
......@@ -10167,10 +10167,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 62 | answerBit. AnswerFetchObjects
// 96 | answerBit. AnswerFetchObjects
func (*AnswerFetchObjects) neoMsgCode() uint16 {
return 62 | answerBit
return 96 | answerBit
}
func (p *AnswerFetchObjects) neoMsgEncodedLenN() int {
......@@ -10389,10 +10389,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 63. AddTransaction
// 98. AddTransaction
func (*AddTransaction) neoMsgCode() uint16 {
return 63
return 98
}
func (p *AddTransaction) neoMsgEncodedLenN() int {
......@@ -10634,10 +10634,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 64. AddObject
// 99. AddObject
func (*AddObject) neoMsgCode() uint16 {
return 64
return 99
}
func (p *AddObject) neoMsgEncodedLenN() int {
......@@ -10778,10 +10778,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 65. Truncate
// 100. Truncate
func (*Truncate) neoMsgCode() uint16 {
return 65
return 100
}
func (p *Truncate) neoMsgEncodedLenN() int {
......@@ -10834,10 +10834,10 @@ overflow:
return 0, ErrDecodeOverflow
}
// 66. FlushLog
// 101. FlushLog
func (*FlushLog) neoMsgCode() uint16 {
return 66
return 101
}
func (p *FlushLog) neoMsgEncodedLenN() int {
......@@ -10877,103 +10877,103 @@ var msgTypeRegistry = map[uint16]reflect.Type{
0 | answerBit: reflect.TypeOf(Error{}),
1: reflect.TypeOf(RequestIdentification{}),
1 | answerBit: reflect.TypeOf(AcceptIdentification{}),
2: reflect.TypeOf(Ping{}),
2 | answerBit: reflect.TypeOf(Pong{}),
3: reflect.TypeOf(CloseClient{}),
4: reflect.TypeOf(PrimaryMaster{}),
4 | answerBit: reflect.TypeOf(AnswerPrimary{}),
5: reflect.TypeOf(NotPrimaryMaster{}),
6: reflect.TypeOf(NotifyNodeInformation{}),
7: reflect.TypeOf(Recovery{}),
7 | answerBit: reflect.TypeOf(AnswerRecovery{}),
8: reflect.TypeOf(LastIDs{}),
8 | answerBit: reflect.TypeOf(AnswerLastIDs{}),
9: reflect.TypeOf(AskPartitionTable{}),
9 | answerBit: reflect.TypeOf(AnswerPartitionTable{}),
10: reflect.TypeOf(SendPartitionTable{}),
11: reflect.TypeOf(NotifyPartitionChanges{}),
12: reflect.TypeOf(StartOperation{}),
13: reflect.TypeOf(StopOperation{}),
14: reflect.TypeOf(UnfinishedTransactions{}),
14 | answerBit: reflect.TypeOf(AnswerUnfinishedTransactions{}),
15: reflect.TypeOf(LockedTransactions{}),
15 | answerBit: reflect.TypeOf(AnswerLockedTransactions{}),
16: reflect.TypeOf(FinalTID{}),
16 | answerBit: reflect.TypeOf(AnswerFinalTID{}),
17: reflect.TypeOf(ValidateTransaction{}),
18: reflect.TypeOf(BeginTransaction{}),
18 | answerBit: reflect.TypeOf(AnswerBeginTransaction{}),
19: reflect.TypeOf(FailedVote{}),
20: reflect.TypeOf(FinishTransaction{}),
20 | answerBit: reflect.TypeOf(AnswerTransactionFinished{}),
21: reflect.TypeOf(LockInformation{}),
21 | answerBit: reflect.TypeOf(AnswerInformationLocked{}),
22: reflect.TypeOf(InvalidateObjects{}),
23: reflect.TypeOf(NotifyUnlockInformation{}),
24: reflect.TypeOf(AskNewOIDs{}),
24 | answerBit: reflect.TypeOf(AnswerNewOIDs{}),
25: reflect.TypeOf(NotifyDeadlock{}),
26: reflect.TypeOf(RebaseTransaction{}),
26 | answerBit: reflect.TypeOf(AnswerRebaseTransaction{}),
27: reflect.TypeOf(RebaseObject{}),
27 | answerBit: reflect.TypeOf(AnswerRebaseObject{}),
28: reflect.TypeOf(StoreObject{}),
28 | answerBit: reflect.TypeOf(AnswerStoreObject{}),
29: reflect.TypeOf(AbortTransaction{}),
30: reflect.TypeOf(StoreTransaction{}),
30 | answerBit: reflect.TypeOf(AnswerStoreTransaction{}),
31: reflect.TypeOf(VoteTransaction{}),
31 | answerBit: reflect.TypeOf(AnswerVoteTransaction{}),
32: reflect.TypeOf(GetObject{}),
32 | answerBit: reflect.TypeOf(AnswerObject{}),
33: reflect.TypeOf(AskTIDs{}),
33 | answerBit: reflect.TypeOf(AnswerTIDs{}),
34: reflect.TypeOf(TransactionInformation{}),
34 | answerBit: reflect.TypeOf(AnswerTransactionInformation{}),
35: reflect.TypeOf(ObjectHistory{}),
35 | answerBit: reflect.TypeOf(AnswerObjectHistory{}),
36: reflect.TypeOf(PartitionList{}),
36 | answerBit: reflect.TypeOf(AnswerPartitionList{}),
37: reflect.TypeOf(NodeList{}),
37 | answerBit: reflect.TypeOf(AnswerNodeList{}),
38: reflect.TypeOf(SetNodeState{}),
39: reflect.TypeOf(AddPendingNodes{}),
40: reflect.TypeOf(TweakPartitionTable{}),
40 | answerBit: reflect.TypeOf(AnswerTweakPartitionTable{}),
41: reflect.TypeOf(SetNumReplicas{}),
42: reflect.TypeOf(SetClusterState{}),
43: reflect.TypeOf(Repair{}),
44: reflect.TypeOf(RepairOne{}),
45: reflect.TypeOf(NotifyClusterState{}),
46: reflect.TypeOf(AskClusterState{}),
46 | answerBit: reflect.TypeOf(AnswerClusterState{}),
47: reflect.TypeOf(ObjectUndoSerial{}),
47 | answerBit: reflect.TypeOf(AnswerObjectUndoSerial{}),
48: reflect.TypeOf(AskTIDsFrom{}),
48 | answerBit: reflect.TypeOf(AnswerTIDsFrom{}),
49: reflect.TypeOf(Pack{}),
49 | answerBit: reflect.TypeOf(AnswerPack{}),
50: reflect.TypeOf(CheckReplicas{}),
51: reflect.TypeOf(CheckPartition{}),
52: reflect.TypeOf(CheckTIDRange{}),
52 | answerBit: reflect.TypeOf(AnswerCheckTIDRange{}),
53: reflect.TypeOf(CheckSerialRange{}),
53 | answerBit: reflect.TypeOf(AnswerCheckSerialRange{}),
54: reflect.TypeOf(PartitionCorrupted{}),
55: reflect.TypeOf(NotifyReady{}),
56: reflect.TypeOf(LastTransaction{}),
56 | answerBit: reflect.TypeOf(AnswerLastTransaction{}),
57: reflect.TypeOf(CheckCurrentSerial{}),
57 | answerBit: reflect.TypeOf(AnswerCheckCurrentSerial{}),
58: reflect.TypeOf(NotifyTransactionFinished{}),
59: reflect.TypeOf(Replicate{}),
60: reflect.TypeOf(ReplicationDone{}),
61: reflect.TypeOf(FetchTransactions{}),
61 | answerBit: reflect.TypeOf(AnswerFetchTransactions{}),
62: reflect.TypeOf(FetchObjects{}),
62 | answerBit: reflect.TypeOf(AnswerFetchObjects{}),
63: reflect.TypeOf(AddTransaction{}),
64: reflect.TypeOf(AddObject{}),
65: reflect.TypeOf(Truncate{}),
66: reflect.TypeOf(FlushLog{}),
3: reflect.TypeOf(Ping{}),
3 | answerBit: reflect.TypeOf(Pong{}),
5: reflect.TypeOf(CloseClient{}),
6: reflect.TypeOf(PrimaryMaster{}),
6 | answerBit: reflect.TypeOf(AnswerPrimary{}),
8: reflect.TypeOf(NotPrimaryMaster{}),
9: reflect.TypeOf(NotifyNodeInformation{}),
10: reflect.TypeOf(Recovery{}),
10 | answerBit: reflect.TypeOf(AnswerRecovery{}),
12: reflect.TypeOf(LastIDs{}),
12 | answerBit: reflect.TypeOf(AnswerLastIDs{}),
14: reflect.TypeOf(AskPartitionTable{}),
14 | answerBit: reflect.TypeOf(AnswerPartitionTable{}),
16: reflect.TypeOf(SendPartitionTable{}),
17: reflect.TypeOf(NotifyPartitionChanges{}),
18: reflect.TypeOf(StartOperation{}),
19: reflect.TypeOf(StopOperation{}),
20: reflect.TypeOf(UnfinishedTransactions{}),
20 | answerBit: reflect.TypeOf(AnswerUnfinishedTransactions{}),
22: reflect.TypeOf(LockedTransactions{}),
22 | answerBit: reflect.TypeOf(AnswerLockedTransactions{}),
24: reflect.TypeOf(FinalTID{}),
24 | answerBit: reflect.TypeOf(AnswerFinalTID{}),
26: reflect.TypeOf(ValidateTransaction{}),
27: reflect.TypeOf(BeginTransaction{}),
27 | answerBit: reflect.TypeOf(AnswerBeginTransaction{}),
29: reflect.TypeOf(FailedVote{}),
30: reflect.TypeOf(FinishTransaction{}),
30 | answerBit: reflect.TypeOf(AnswerTransactionFinished{}),
32: reflect.TypeOf(LockInformation{}),
32 | answerBit: reflect.TypeOf(AnswerInformationLocked{}),
34: reflect.TypeOf(InvalidateObjects{}),
35: reflect.TypeOf(NotifyUnlockInformation{}),
36: reflect.TypeOf(AskNewOIDs{}),
36 | answerBit: reflect.TypeOf(AnswerNewOIDs{}),
38: reflect.TypeOf(NotifyDeadlock{}),
39: reflect.TypeOf(RebaseTransaction{}),
39 | answerBit: reflect.TypeOf(AnswerRebaseTransaction{}),
41: reflect.TypeOf(RebaseObject{}),
41 | answerBit: reflect.TypeOf(AnswerRebaseObject{}),
43: reflect.TypeOf(StoreObject{}),
43 | answerBit: reflect.TypeOf(AnswerStoreObject{}),
45: reflect.TypeOf(AbortTransaction{}),
46: reflect.TypeOf(StoreTransaction{}),
46 | answerBit: reflect.TypeOf(AnswerStoreTransaction{}),
48: reflect.TypeOf(VoteTransaction{}),
48 | answerBit: reflect.TypeOf(AnswerVoteTransaction{}),
50: reflect.TypeOf(GetObject{}),
50 | answerBit: reflect.TypeOf(AnswerObject{}),
52: reflect.TypeOf(AskTIDs{}),
52 | answerBit: reflect.TypeOf(AnswerTIDs{}),
54: reflect.TypeOf(TransactionInformation{}),
54 | answerBit: reflect.TypeOf(AnswerTransactionInformation{}),
56: reflect.TypeOf(ObjectHistory{}),
56 | answerBit: reflect.TypeOf(AnswerObjectHistory{}),
58: reflect.TypeOf(PartitionList{}),
58 | answerBit: reflect.TypeOf(AnswerPartitionList{}),
60: reflect.TypeOf(NodeList{}),
60 | answerBit: reflect.TypeOf(AnswerNodeList{}),
62: reflect.TypeOf(SetNodeState{}),
63: reflect.TypeOf(AddPendingNodes{}),
64: reflect.TypeOf(TweakPartitionTable{}),
64 | answerBit: reflect.TypeOf(AnswerTweakPartitionTable{}),
66: reflect.TypeOf(SetNumReplicas{}),
67: reflect.TypeOf(SetClusterState{}),
68: reflect.TypeOf(Repair{}),
69: reflect.TypeOf(RepairOne{}),
70: reflect.TypeOf(NotifyClusterState{}),
71: reflect.TypeOf(AskClusterState{}),
71 | answerBit: reflect.TypeOf(AnswerClusterState{}),
73: reflect.TypeOf(ObjectUndoSerial{}),
73 | answerBit: reflect.TypeOf(AnswerObjectUndoSerial{}),
75: reflect.TypeOf(AskTIDsFrom{}),
75 | answerBit: reflect.TypeOf(AnswerTIDsFrom{}),
77: reflect.TypeOf(Pack{}),
77 | answerBit: reflect.TypeOf(AnswerPack{}),
79: reflect.TypeOf(CheckReplicas{}),
80: reflect.TypeOf(CheckPartition{}),
81: reflect.TypeOf(CheckTIDRange{}),
81 | answerBit: reflect.TypeOf(AnswerCheckTIDRange{}),
83: reflect.TypeOf(CheckSerialRange{}),
83 | answerBit: reflect.TypeOf(AnswerCheckSerialRange{}),
85: reflect.TypeOf(PartitionCorrupted{}),
86: reflect.TypeOf(NotifyReady{}),
87: reflect.TypeOf(LastTransaction{}),
87 | answerBit: reflect.TypeOf(AnswerLastTransaction{}),
89: reflect.TypeOf(CheckCurrentSerial{}),
89 | answerBit: reflect.TypeOf(AnswerCheckCurrentSerial{}),
91: reflect.TypeOf(NotifyTransactionFinished{}),
92: reflect.TypeOf(Replicate{}),
93: reflect.TypeOf(ReplicationDone{}),
94: reflect.TypeOf(FetchTransactions{}),
94 | answerBit: reflect.TypeOf(AnswerFetchTransactions{}),
96: reflect.TypeOf(FetchObjects{}),
96 | answerBit: reflect.TypeOf(AnswerFetchObjects{}),
98: reflect.TypeOf(AddTransaction{}),
99: reflect.TypeOf(AddObject{}),
100: reflect.TypeOf(Truncate{}),
101: reflect.TypeOf(FlushLog{}),
}
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