Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
Project
I
Implementasi Algoritma Concurrency Control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Muhammad Khairul Makirin
Implementasi Algoritma Concurrency Control
Commits
2843af89
Commit
2843af89
authored
Oct 29, 2019
by
Ahmad Naufal Hakim
Browse files
Options
Downloads
Patches
Plain Diff
Edit mvcc read function
parent
760a7550
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mvcc.py
+10
-3
10 additions, 3 deletions
mvcc.py
with
10 additions
and
3 deletions
mvcc.py
+
10
−
3
View file @
2843af89
...
...
@@ -9,11 +9,18 @@ class MVCC :
return
time
.
time
()
def
setTimestampNow
(
self
,
key
,
timestamp
,
storage
:
strg
)
:
tempTimestamp
=
timestamp
storage
.
setdata
[
key
][
"
timestamp
"
]
=
tempTimestamp
storage
.
setdata
[
key
][
"
timestamp
"
]
=
timestamp
def
read
(
self
,
key
,
storage
:
strg
)
:
return
storage
.
setdata
[
key
][
"
value
"
]
tempTimestamp
=
self
.
getTimestampNow
()
if
(
storage
.
setdata
[
key
][
"
timestamp
"
]
>
tempTimestamp
)
:
# rollback transaction
# reject operation
return
False
else
:
self
.
setTimestampNow
(
key
,
tempTimestamp
,
storage
)
return
True
,
storage
.
setdata
[
key
][
"
value
"
]
def
write
(
self
,
key
,
value
,
storage
:
strg
)
:
tempTimestamp
=
self
.
getTimestampNow
()
...
...
...
...
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
sign in
to comment