Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
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
Stefane Fermigier
neo
Commits
40d336af
Commit
40d336af
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
54ab2674
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
127 additions
and
1 deletion
+127
-1
go/neo/proto.go
go/neo/proto.go
+15
-0
go/neo/py/pyneo-gen-testdata
go/neo/py/pyneo-gen-testdata
+1
-0
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+110
-0
go/neo/ztestdata_proto_py_test.go
go/neo/ztestdata_proto_py_test.go
+1
-1
No files found.
go/neo/proto.go
View file @
40d336af
...
...
@@ -954,3 +954,18 @@ type ReplicationDone struct {
Offset
uint32
// PNumber
Tid
zodb
.
Tid
}
// S -> S
type
FetchTransactions
struct
{
Partition
uint32
// PNumber
Length
uint32
// PNumber
MinTid
zodb
.
Tid
MaxTid
zodb
.
Tid
TidList
[]
zodb
.
Tid
// already known transactions
}
type
AnswerFetchTransactions
struct
{
PackTid
zodb
.
Tid
NextTid
zodb
.
Tid
TidList
[]
zodb
.
Tid
// transactions to delete
}
go/neo/py/pyneo-gen-testdata
View file @
40d336af
...
...
@@ -53,6 +53,7 @@ nonotify('PartitionCorrupted')
noask
(
'LastTransaction'
)
noask
(
'CheckCurrentSerial'
)
nonotify
(
'ReplicationDone'
)
noask
(
'FetchTransactions'
)
_
=
renames
_
[
'AskPrimary'
]
=
'PrimaryMaster'
...
...
go/neo/zproto-marshal.go
View file @
40d336af
...
...
@@ -3565,6 +3565,114 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 92. FetchTransactions
func
(
*
FetchTransactions
)
neoMsgCode
()
uint16
{
return
92
}
func
(
p
*
FetchTransactions
)
neoMsgEncodedLen
()
int
{
return
28
+
len
(
p
.
TidList
)
*
8
}
func
(
p
*
FetchTransactions
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint32
(
data
[
0
:
],
p
.
Partition
)
binary
.
BigEndian
.
PutUint32
(
data
[
4
:
],
p
.
Length
)
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
MinTid
))
binary
.
BigEndian
.
PutUint64
(
data
[
16
:
],
uint64
(
p
.
MaxTid
))
{
l
:=
uint32
(
len
(
p
.
TidList
))
binary
.
BigEndian
.
PutUint32
(
data
[
24
:
],
l
)
data
=
data
[
28
:
]
for
i
:=
0
;
uint32
(
i
)
<
l
;
i
++
{
a
:=
&
p
.
TidList
[
i
]
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
((
*
a
)))
data
=
data
[
8
:
]
}
}
}
func
(
p
*
FetchTransactions
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
var
nread
uint32
if
uint32
(
len
(
data
))
<
28
{
goto
overflow
}
p
.
Partition
=
binary
.
BigEndian
.
Uint32
(
data
[
0
:
])
p
.
Length
=
binary
.
BigEndian
.
Uint32
(
data
[
4
:
])
p
.
MinTid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
MaxTid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
16
:
]))
{
l
:=
binary
.
BigEndian
.
Uint32
(
data
[
24
:
])
data
=
data
[
28
:
]
if
uint32
(
len
(
data
))
<
l
*
8
{
goto
overflow
}
nread
+=
l
*
8
p
.
TidList
=
make
([]
zodb
.
Tid
,
l
)
for
i
:=
0
;
uint32
(
i
)
<
l
;
i
++
{
a
:=
&
p
.
TidList
[
i
]
(
*
a
)
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
data
=
data
[
8
:
]
}
}
return
28
+
int
(
nread
),
nil
overflow
:
return
0
,
ErrDecodeOverflow
}
// 93. AnswerFetchTransactions
func
(
*
AnswerFetchTransactions
)
neoMsgCode
()
uint16
{
return
93
|
answerBit
}
func
(
p
*
AnswerFetchTransactions
)
neoMsgEncodedLen
()
int
{
return
20
+
len
(
p
.
TidList
)
*
8
}
func
(
p
*
AnswerFetchTransactions
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
PackTid
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
NextTid
))
{
l
:=
uint32
(
len
(
p
.
TidList
))
binary
.
BigEndian
.
PutUint32
(
data
[
16
:
],
l
)
data
=
data
[
20
:
]
for
i
:=
0
;
uint32
(
i
)
<
l
;
i
++
{
a
:=
&
p
.
TidList
[
i
]
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
((
*
a
)))
data
=
data
[
8
:
]
}
}
}
func
(
p
*
AnswerFetchTransactions
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
var
nread
uint32
if
uint32
(
len
(
data
))
<
20
{
goto
overflow
}
p
.
PackTid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
NextTid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
{
l
:=
binary
.
BigEndian
.
Uint32
(
data
[
16
:
])
data
=
data
[
20
:
]
if
uint32
(
len
(
data
))
<
l
*
8
{
goto
overflow
}
nread
+=
l
*
8
p
.
TidList
=
make
([]
zodb
.
Tid
,
l
)
for
i
:=
0
;
uint32
(
i
)
<
l
;
i
++
{
a
:=
&
p
.
TidList
[
i
]
(
*
a
)
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
data
=
data
[
8
:
]
}
}
return
20
+
int
(
nread
),
nil
overflow
:
return
0
,
ErrDecodeOverflow
}
// registry of message types
var
msgTypeRegistry
=
map
[
uint16
]
reflect
.
Type
{
0
|
answerBit
:
reflect
.
TypeOf
(
Error
{}),
...
...
@@ -3659,4 +3767,6 @@ var msgTypeRegistry = map[uint16]reflect.Type{
89
:
reflect
.
TypeOf
(
NotifyTransactionFinished
{}),
90
:
reflect
.
TypeOf
(
Replicate
{}),
91
:
reflect
.
TypeOf
(
ReplicationDone
{}),
92
:
reflect
.
TypeOf
(
FetchTransactions
{}),
93
|
answerBit
:
reflect
.
TypeOf
(
AnswerFetchTransactions
{}),
}
go/neo/ztestdata_proto_py_test.go
View file @
40d336af
...
...
@@ -61,7 +61,7 @@ var pyMsgRegistry = map[uint16]string{
89
:
"NotifyTransactionFinished"
,
90
:
"Replicate"
,
91
:
"ReplicationDone"
,
92
:
"
Ask
FetchTransactions"
,
92
:
"FetchTransactions"
,
94
:
"AskFetchObjects"
,
96
:
"AddTransaction"
,
97
:
"AddObject"
,
...
...
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