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
tom
2014-09-22 17:05:47 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dc66b38ee43493b48ab9305e6c4edd97a5910e3e
dc66b38e
1 parent
0eaa97f3
Fixing remote install; now starting as upstart daemon.
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
0 deletions
core/store/src/main/java/org/onlab/onos/store/StoreService.java
core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
features/features.xml
pom.xml
utils/misc/pom.xml
core/store/src/main/java/org/onlab/onos/store/StoreService.java
0 → 100644
View file @
dc66b38
package
org
.
onlab
.
onos
.
store
;
import
com.hazelcast.core.HazelcastInstance
;
/**
* Bootstrap service to get a handle on a share Hazelcast instance.
*/
public
interface
StoreService
{
/**
* Returns the shared Hazelcast instance for use as a distributed store
* backing.
*
* @return shared Hazelcast instance
*/
HazelcastInstance
getHazelcastInstance
();
}
core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
View file @
dc66b38
...
...
@@ -40,6 +40,7 @@ import org.onlab.onos.net.device.DeviceEvent;
import
org.onlab.onos.net.device.DeviceStore
;
import
org.onlab.onos.net.device.PortDescription
;
import
org.onlab.onos.net.provider.ProviderId
;
import
org.onlab.onos.store.StoreService
;
import
org.onlab.util.KryoPool
;
import
org.slf4j.Logger
;
...
...
@@ -187,12 +188,15 @@ public class DistributedDeviceStore implements DeviceStore {
// FIXME change to protected once we remove DistributedDeviceManagerTest.
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
protected
StoreService
storeService
;
/*protected*/
public
HazelcastInstance
theInstance
;
@Activate
public
void
activate
()
{
log
.
info
(
"Started"
);
theInstance
=
storeService
.
getHazelcastInstance
();
// IMap event handler needs value
final
boolean
includeValue
=
true
;
...
...
core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
0 → 100644
View file @
dc66b38
package
org
.
onlab
.
onos
.
store
.
impl
;
import
com.hazelcast.core.Hazelcast
;
import
com.hazelcast.core.HazelcastInstance
;
import
org.apache.felix.scr.annotations.Activate
;
import
org.apache.felix.scr.annotations.Component
;
import
org.apache.felix.scr.annotations.Deactivate
;
import
org.apache.felix.scr.annotations.Service
;
import
org.onlab.onos.store.StoreService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* Auxiliary bootstrap of distributed store.
*/
@Component
(
immediate
=
true
)
@Service
public
class
StoreManager
implements
StoreService
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
getClass
());
private
HazelcastInstance
instance
;
@Activate
public
void
activate
()
{
instance
=
Hazelcast
.
newHazelcastInstance
();
log
.
info
(
"Started"
);
}
@Deactivate
public
void
deactivate
()
{
log
.
info
(
"Stopped"
);
}
@Override
public
HazelcastInstance
getHazelcastInstance
()
{
return
instance
;
}
}
features/features.xml
View file @
dc66b38
...
...
@@ -10,9 +10,13 @@
<bundle>
mvn:com.google.guava/guava/18.0
</bundle>
<bundle>
mvn:io.netty/netty/3.9.2.Final
</bundle>
<bundle>
mvn:com.hazelcast/hazelcast/3.3
</bundle>
<bundle>
mvn:com.eclipsesource.minimal-json/minimal-json/0.9.1
</bundle>
<bundle>
mvn:com.esotericsoftware.kryo/kryo/2.24.0
</bundle>
<bundle>
mvn:com.esotericsoftware/minlog/1.3.0
</bundle>
<bundle>
mvn:org.objenesis/objenesis/2.1
</bundle>
<bundle>
mvn:de.javakaffee/kryo-serializers/0.27
</bundle>
</feature>
<feature
name=
"onos-thirdparty-web"
version=
"1.0.0"
...
...
@@ -42,6 +46,13 @@
description=
"ONOS core components"
>
<feature>
onos-api
</feature>
<bundle>
mvn:org.onlab.onos/onos-core-net/1.0.0-SNAPSHOT
</bundle>
<bundle>
mvn:org.onlab.onos/onos-core-store/1.0.0-SNAPSHOT
</bundle>
</feature>
<feature
name=
"onos-core-trivial"
version=
"1.0.0"
description=
"ONOS core components"
>
<feature>
onos-api
</feature>
<bundle>
mvn:org.onlab.onos/onos-core-net/1.0.0-SNAPSHOT
</bundle>
<bundle>
mvn:org.onlab.onos/onos-core-trivial/1.0.0-SNAPSHOT
</bundle>
</feature>
...
...
pom.xml
View file @
dc66b38
...
...
@@ -139,6 +139,11 @@
<version>
3.3
</version>
</dependency>
<dependency>
<groupId>
com.eclipsesource.minimal-json
</groupId>
<artifactId>
minimal-json
</artifactId>
<version>
0.9.1
</version>
</dependency>
<dependency>
<groupId>
com.esotericsoftware.kryo
</groupId>
<artifactId>
kryo
</artifactId>
<version>
2.24.0
</version>
...
...
utils/misc/pom.xml
View file @
dc66b38
...
...
@@ -35,6 +35,11 @@
<artifactId>
commons-lang3
</artifactId>
</dependency>
<!-- TODO: do we still need this here? -->
<dependency>
<groupId>
com.eclipsesource.minimal-json
</groupId>
<artifactId>
minimal-json
</artifactId>
</dependency>
<dependency>
<groupId>
com.esotericsoftware.kryo
</groupId>
<artifactId>
kryo
</artifactId>
...
...
Please
register
or
login
to post a comment