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-10-21 00:08:44 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
40d017769a84d505ac13887130ffa81dc8ba9254
40d01776
1 parent
85d58d13
switch to ImmutableList
Change-Id: Ia5f8936d0aaf447253f5dde0db1ee688441d2472
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
core/api/src/main/java/org/onlab/onos/cluster/RoleInfo.java
core/store/serializers/src/main/java/org/onlab/onos/store/serializers/KryoNamespaces.java
core/store/serializers/src/test/java/org/onlab/onos/store/serializers/KryoSerializerTest.java
core/api/src/main/java/org/onlab/onos/cluster/RoleInfo.java
View file @
40d0177
package
org
.
onlab
.
onos
.
cluster
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
com.google.common.collect.ImmutableList
;
/**
* A container for detailed role information for a device,
* within the current cluster. Role attributes include current
...
...
@@ -15,7 +16,7 @@ public class RoleInfo {
public
RoleInfo
(
NodeId
master
,
List
<
NodeId
>
backups
)
{
this
.
master
=
master
;
this
.
backups
=
Collections
.
unmodifiableList
(
backups
);
this
.
backups
=
ImmutableList
.
copyOf
(
backups
);
}
public
NodeId
master
()
{
...
...
core/store/serializers/src/main/java/org/onlab/onos/store/serializers/KryoNamespaces.java
View file @
40d0177
...
...
@@ -8,6 +8,7 @@ import java.util.HashMap;
import
org.onlab.onos.cluster.ControllerNode
;
import
org.onlab.onos.cluster.DefaultControllerNode
;
import
org.onlab.onos.cluster.NodeId
;
import
org.onlab.onos.cluster.RoleInfo
;
import
org.onlab.onos.mastership.MastershipTerm
;
import
org.onlab.onos.net.ConnectPoint
;
import
org.onlab.onos.net.DefaultAnnotations
;
...
...
@@ -107,7 +108,8 @@ public final class KryoNamespaces {
Criterion
.
Type
.
class
,
DefaultTrafficTreatment
.
class
,
Instructions
.
DropInstruction
.
class
,
Instructions
.
OutputInstruction
.
class
Instructions
.
OutputInstruction
.
class
,
RoleInfo
.
class
)
.
register
(
URI
.
class
,
new
URISerializer
())
.
register
(
NodeId
.
class
,
new
NodeIdSerializer
())
...
...
core/store/serializers/src/test/java/org/onlab/onos/store/serializers/KryoSerializerTest.java
View file @
40d0177
...
...
@@ -3,6 +3,7 @@ package org.onlab.onos.store.serializers;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
onlab
.
onos
.
net
.
DeviceId
.
deviceId
;
import
static
org
.
onlab
.
onos
.
net
.
PortNumber
.
portNumber
;
import
static
java
.
util
.
Arrays
.
asList
;
import
java.nio.ByteBuffer
;
...
...
@@ -11,6 +12,7 @@ import org.junit.Before;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
org.onlab.onos.cluster.NodeId
;
import
org.onlab.onos.cluster.RoleInfo
;
import
org.onlab.onos.mastership.MastershipTerm
;
import
org.onlab.onos.net.Annotations
;
import
org.onlab.onos.net.ConnectPoint
;
...
...
@@ -198,6 +200,12 @@ public class KryoSerializerTest {
}
@Test
public
void
testRoleInfo
()
{
testSerialized
(
new
RoleInfo
(
new
NodeId
(
"master"
),
asList
(
new
NodeId
(
"stby1"
),
new
NodeId
(
"stby2"
))));
}
@Test
public
void
testAnnotations
()
{
// Annotations does not have equals defined, manually test equality
final
byte
[]
a1Bytes
=
serializer
.
encode
(
A1
);
...
...
Please
register
or
login
to post a comment