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
3a93658b
Commit
3a93658b
authored
Dec 30, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: comment TransactionContainer and drop duplicate 'object_base_serial_dict'
parent
9eb06ff1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
neo/client/app.py
neo/client/app.py
+16
-11
No files found.
neo/client/app.py
View file @
3a93658b
...
@@ -55,6 +55,8 @@ if SignalHandler:
...
@@ -55,6 +55,8 @@ if SignalHandler:
class
TransactionContainer
(
dict
):
class
TransactionContainer
(
dict
):
# IDEA: Drop this container and use the new set_data/data API on
# transactions (requires transaction >= 1.6).
def
pop
(
self
,
txn
):
def
pop
(
self
,
txn
):
return
dict
.
pop
(
self
,
id
(
txn
),
None
)
return
dict
.
pop
(
self
,
id
(
txn
),
None
)
...
@@ -74,17 +76,24 @@ class TransactionContainer(dict):
...
@@ -74,17 +76,24 @@ class TransactionContainer(dict):
'queue'
:
SimpleQueue
(),
'queue'
:
SimpleQueue
(),
'txn'
:
txn
,
'txn'
:
txn
,
'ttid'
:
None
,
'ttid'
:
None
,
# data being stored
'data_dict'
:
{},
'data_dict'
:
{},
'data_size'
:
0
,
'data_size'
:
0
,
# data stored: this will go to the cache on tpc_finish
'cache_dict'
:
{},
'cache_dict'
:
{},
'cache_size'
:
0
,
'cache_size'
:
0
,
'object_base_serial_dict'
:
{},
# serial being stored
'object_serial_dict'
:
{},
'object_serial_dict'
:
{},
# {oid: serial}
'object_stored_counter_dict'
:
{},
# track successful stores/checks
'conflict_serial_dict'
:
{},
'object_stored_counter_dict'
:
{},
# {oid: {serial: {storage_id}}}
'resolved_conflict_serial_dict'
:
{},
# conflicts to resolve
'involved_nodes'
:
set
(),
'conflict_serial_dict'
:
{},
# {oid: {serial}}
'checked_nodes'
:
set
(),
# resolved conflicts
'resolved_conflict_serial_dict'
:
{},
# {oid: {serial}}
# nodes with at least 1 store (object or transaction)
'involved_nodes'
:
set
(),
# {node}
# nodes with at least 1 check
'checked_nodes'
:
set
(),
# {node}
}
}
return
context
return
context
...
@@ -443,7 +452,6 @@ class Application(ThreadedApplication):
...
@@ -443,7 +452,6 @@ class Application(ThreadedApplication):
txn_context
[
'data_dict'
][
oid
]
=
data
txn_context
[
'data_dict'
][
oid
]
=
data
# Store data on each node
# Store data on each node
txn_context
[
'object_stored_counter_dict'
][
oid
]
=
{}
txn_context
[
'object_stored_counter_dict'
][
oid
]
=
{}
txn_context
[
'object_base_serial_dict'
].
setdefault
(
oid
,
serial
)
txn_context
[
'object_serial_dict'
][
oid
]
=
serial
txn_context
[
'object_serial_dict'
][
oid
]
=
serial
queue
=
txn_context
[
'queue'
]
queue
=
txn_context
[
'queue'
]
involved_nodes
=
txn_context
[
'involved_nodes'
]
involved_nodes
=
txn_context
[
'involved_nodes'
]
...
@@ -478,7 +486,6 @@ class Application(ThreadedApplication):
...
@@ -478,7 +486,6 @@ class Application(ThreadedApplication):
append
=
result
.
append
append
=
result
.
append
# Check for conflicts
# Check for conflicts
data_dict
=
txn_context
[
'data_dict'
]
data_dict
=
txn_context
[
'data_dict'
]
object_base_serial_dict
=
txn_context
[
'object_base_serial_dict'
]
object_serial_dict
=
txn_context
[
'object_serial_dict'
]
object_serial_dict
=
txn_context
[
'object_serial_dict'
]
conflict_serial_dict
=
txn_context
[
'conflict_serial_dict'
].
copy
()
conflict_serial_dict
=
txn_context
[
'conflict_serial_dict'
].
copy
()
txn_context
[
'conflict_serial_dict'
].
clear
()
txn_context
[
'conflict_serial_dict'
].
clear
()
...
@@ -559,8 +566,6 @@ class Application(ThreadedApplication):
...
@@ -559,8 +566,6 @@ class Application(ThreadedApplication):
dump
(
conflict_serial
))
dump
(
conflict_serial
))
# Mark this conflict as resolved
# Mark this conflict as resolved
resolved_serial_set
.
update
(
conflict_serial_set
)
resolved_serial_set
.
update
(
conflict_serial_set
)
# Base serial changes too, as we resolved a conflict
object_base_serial_dict
[
oid
]
=
conflict_serial
# Try to store again
# Try to store again
self
.
_store
(
txn_context
,
oid
,
conflict_serial
,
new_data
)
self
.
_store
(
txn_context
,
oid
,
conflict_serial
,
new_data
)
append
(
oid
)
append
(
oid
)
...
...
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