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-09-23 09:47:42 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f6509f632b00ebc748ede2d19600c8b97facf4b3
f6509f63
1 parent
e94d0d47
DeviceIdSerializer
Change-Id: Ic0f4474c88b8eabca76e382d737bddb7cb2d7112
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
18 deletions
core/store/src/main/java/org/onlab/onos/store/device/impl/DeviceIdSerializer.java
core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
core/store/src/main/java/org/onlab/onos/store/package-info.java
core/store/src/main/java/org/onlab/onos/store/device/impl/DeviceIdSerializer.java
0 → 100644
View file @
f6509f6
package
org
.
onlab
.
onos
.
store
.
device
.
impl
;
import
java.net.URI
;
import
org.onlab.onos.net.DeviceId
;
import
com.esotericsoftware.kryo.Kryo
;
import
com.esotericsoftware.kryo.Serializer
;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
//TODO move to util, etc.
/**
* Kryo Serializer for {@link DeviceId}.
*/
public
final
class
DeviceIdSerializer
extends
Serializer
<
DeviceId
>
{
@Override
public
void
write
(
Kryo
kryo
,
Output
output
,
DeviceId
object
)
{
kryo
.
writeObject
(
output
,
object
.
uri
());
}
@Override
public
DeviceId
read
(
Kryo
kryo
,
Input
input
,
Class
<
DeviceId
>
type
)
{
final
URI
uri
=
kryo
.
readObject
(
input
,
URI
.
class
);
return
DeviceId
.
deviceId
(
uri
);
}
}
core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
View file @
f6509f6
...
...
@@ -44,10 +44,6 @@ import org.onlab.onos.store.StoreService;
import
org.onlab.util.KryoPool
;
import
org.slf4j.Logger
;
import
com.esotericsoftware.kryo.Kryo
;
import
com.esotericsoftware.kryo.Serializer
;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
import
com.google.common.base.Optional
;
import
com.google.common.cache.CacheBuilder
;
import
com.google.common.cache.CacheLoader
;
...
...
@@ -444,20 +440,6 @@ public class DistributedDeviceStore implements DeviceStore {
return
POOL
.
deserialize
(
bytes
);
}
public
static
final
class
DeviceIdSerializer
extends
Serializer
<
DeviceId
>
{
@Override
public
void
write
(
Kryo
kryo
,
Output
output
,
DeviceId
object
)
{
kryo
.
writeObject
(
output
,
object
.
uri
());
}
@Override
public
DeviceId
read
(
Kryo
kryo
,
Input
input
,
Class
<
DeviceId
>
type
)
{
final
URI
uri
=
kryo
.
readObject
(
input
,
URI
.
class
);
return
DeviceId
.
deviceId
(
uri
);
}
}
/**
* An IMap EntryListener, which reflects each remote event to cache.
*
...
...
core/store/src/main/java/org/onlab/onos/store/package-info.java
View file @
f6509f6
Please
register
or
login
to post a comment