Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Yuta HIGUCHI
2014-11-05 18:53:09 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bddc81c4ec3e6a000d97a07cd43d95a18bf4cff6
bddc81c4
1 parent
1838f88d
add comments to DatabaseStateMachine
Change-Id: I775e2f6c0250ac158e301408e423ebdb29d75668
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseStateMachine.java
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseStateMachine.java
View file @
bddc81c
...
...
@@ -89,6 +89,8 @@ public class DatabaseStateMachine implements StateMachine {
@Command
public
List
<
InternalWriteResult
>
write
(
List
<
WriteRequest
>
requests
)
{
// applicability check
boolean
abort
=
false
;
List
<
InternalWriteResult
.
Status
>
validationResults
=
new
ArrayList
<>(
requests
.
size
());
for
(
WriteRequest
request
:
requests
)
{
...
...
@@ -132,8 +134,13 @@ public class DatabaseStateMachine implements StateMachine {
return
results
;
}
// apply changes
for
(
WriteRequest
request
:
requests
)
{
Map
<
String
,
VersionedValue
>
table
=
state
.
getTables
().
get
(
request
.
tableName
());
// FIXME: If this method could be called by multiple thread,
// synchronization scope is wrong.
// Whole function including applicability check needs to be protected.
// Confirm copycat's thread safety requirement for StateMachine
synchronized
(
table
)
{
VersionedValue
previousValue
=
table
.
put
(
request
.
key
(),
new
VersionedValue
(
request
.
newValue
(),
state
.
nextVersion
()));
...
...
Please
register
or
login
to post a comment