Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
894ce4d8
Unverified
Commit
894ce4d8
authored
6 years ago
by
Silas Davis
Browse files
Options
Downloads
Patches
Plain Diff
Don't store Tx in state for every event (for now)
Signed-off-by:
Silas Davis
<
silas@monax.io
>
parent
5e387c31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
execution/events/event.go
+21
-0
21 additions, 0 deletions
execution/events/event.go
execution/state.go
+6
-0
6 additions, 0 deletions
execution/state.go
with
27 additions
and
0 deletions
execution/events/event.go
+
21
−
0
View file @
894ce4d8
...
...
@@ -39,6 +39,27 @@ func (ev *Event) Key() Key {
return
ev
.
Header
.
Key
()
}
// Performs a shallow copy of Event
func
(
ev
*
Event
)
Copy
()
*
Event
{
h
:=
*
ev
.
Header
evCopy
:=
Event
{
Header
:
&
h
,
}
if
ev
.
Tx
!=
nil
{
tx
:=
*
ev
.
Tx
evCopy
.
Tx
=
&
tx
}
if
ev
.
Call
!=
nil
{
call
:=
*
ev
.
Call
evCopy
.
Call
=
&
call
}
if
ev
.
Log
!=
nil
{
log
:=
*
ev
.
Log
evCopy
.
Log
=
&
log
}
return
&
evCopy
}
func
(
ev
*
Event
)
Encode
()
([]
byte
,
error
)
{
return
cdc
.
MarshalBinary
(
ev
)
}
...
...
This diff is collapsed.
Click to expand it.
execution/state.go
+
6
−
0
View file @
894ce4d8
...
...
@@ -321,6 +321,12 @@ func (ws *writeState) Publish(ctx context.Context, msg interface{}, tags event.T
ws
.
state
.
eventKeyHighWatermark
,
exeEvent
)
}
ws
.
state
.
eventKeyHighWatermark
=
key
if
exeEvent
.
Tx
!=
nil
{
// Don't serialise the tx (for now) we should normalise and store against tx hash
exeEvent
=
exeEvent
.
Copy
()
// The header still contains the tx hash
exeEvent
.
Tx
.
Tx
=
nil
}
bs
,
err
:=
exeEvent
.
Encode
()
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment