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
Thomas Vachuska
2014-10-21 00:23:31 -0700
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
01fbcdf62674882c943f5cf746dc1340d4218a3f
01fbcdf6
2 parents
b97cf287
adb2d3c3
Merge branch 'master' of
ssh://gerrit.onlab.us:29418/onos-next
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
core/api/src/main/java/org/onlab/onos/cluster/RoleInfo.java
core/api/src/main/java/org/onlab/onos/cluster/RoleInfo.java
View file @
01fbcdf
package
org
.
onlab
.
onos
.
cluster
;
import
java.util.Collections
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Objects
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
/**
* A container for detailed role information for a device,
* within the current cluster. Role attributes include current
...
...
@@ -18,9 +15,7 @@ public class RoleInfo {
public
RoleInfo
(
NodeId
master
,
List
<
NodeId
>
backups
)
{
this
.
master
=
master
;
this
.
backups
=
new
LinkedList
<>();
this
.
backups
.
addAll
(
checkNotNull
(
backups
));
this
.
backups
=
Collections
.
unmodifiableList
(
backups
);
}
public
NodeId
master
()
{
...
...
@@ -28,7 +23,7 @@ public class RoleInfo {
}
public
List
<
NodeId
>
backups
()
{
return
Collections
.
unmodifiableList
(
backups
)
;
return
backups
;
}
@Override
...
...
@@ -57,10 +52,10 @@ public class RoleInfo {
@Override
public
String
toString
()
{
final
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"master:
\n\t"
).
append
(
master
).
append
(
"\n
"
);
builder
.
append
(
"backups:
\n
"
);
builder
.
append
(
"master:
"
).
append
(
master
).
append
(
",
"
);
builder
.
append
(
"backups:"
);
for
(
NodeId
n
:
backups
)
{
builder
.
append
(
"
\t"
).
append
(
n
).
append
(
"\n"
);
builder
.
append
(
"
"
).
append
(
n
);
}
return
builder
.
toString
();
}
...
...
Please
register
or
login
to post a comment