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-04 18:05:08 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3a3ac96005ec5993cdfd3fd9aaef168dbed240fd
3a3ac960
1 parent
7cbfd4fd
moved VersionedValue
Change-Id: Iec72c936e06ef9b1813ed3661d8f7d81d2654969
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
core/store/dist/src/main/java/org/onlab/onos/store/service/WriteRequest.java
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
core/store/dist/src/main/java/org/onlab/onos/store/service/WriteRequest.java
View file @
3a3ac96
...
...
@@ -15,19 +15,23 @@ public class WriteRequest {
private
final
long
previousVersion
;
private
final
byte
[]
oldValue
;
// put regardless of previous value
public
WriteRequest
(
String
tableName
,
String
key
,
byte
[]
newValue
)
{
this
(
tableName
,
key
,
newValue
,
-
1
,
null
);
}
// put if version matches
public
WriteRequest
(
String
tableName
,
String
key
,
byte
[]
newValue
,
long
previousVersion
)
{
this
(
tableName
,
key
,
newValue
,
previousVersion
,
null
);
checkArgument
(
previousVersion
>=
0
);
}
// put if value matches
public
WriteRequest
(
String
tableName
,
String
key
,
byte
[]
newValue
,
byte
[]
oldValue
)
{
this
(
tableName
,
key
,
newValue
,
-
1
,
oldValue
);
}
// hidden constructor
private
WriteRequest
(
String
tableName
,
String
key
,
byte
[]
newValue
,
long
previousVersion
,
byte
[]
oldValue
)
{
checkArgument
(
tableName
!=
null
);
...
...
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
View file @
3a3ac96
...
...
@@ -56,14 +56,15 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService {
@Activate
public
void
activate
()
{
// FIXME hack tcpPort +1 for copycat communication
TcpMember
localMember
=
new
TcpMember
(
clusterService
.
getLocalNode
().
ip
().
toString
(),
clusterService
.
getLocalNode
().
tcpPort
());
clusterService
.
getLocalNode
().
tcpPort
()
+
1
);
List
<
TcpMember
>
remoteMembers
=
Lists
.
newArrayList
();
for
(
ControllerNode
node
:
clusterService
.
getNodes
())
{
TcpMember
member
=
new
TcpMember
(
node
.
ip
().
toString
(),
node
.
tcpPort
());
TcpMember
member
=
new
TcpMember
(
node
.
ip
().
toString
(),
node
.
tcpPort
()
+
1
);
if
(!
member
.
equals
(
localMember
))
{
remoteMembers
.
add
(
member
);
}
...
...
Please
register
or
login
to post a comment