Refactoring datastore package
Preparation to make datastore replacable
- Extract datastore interfaces
- Add multi Read/Write/Remove
- Add a method to walk over RCTable
- Refactor serialize/deserialize RCObject
- Localize dependency to JRAMCloud
- Separate RAMCloud specific code into ramcloud package
- Remove dependency to RAMCloud exception classes
- Remove RC prefix from non RAMCloud specific code
- Cosmetics and update sample/test code
- reflect Naoki's comment
- more cosmetic fixes
- reordered OPERATION enums
- removed no longer used code
- follow pmd, etc. where easily possible
Change-Id: I6f9153d705600447acf48a64f713c654c9f26713
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java
index 3f3af2d..a323726 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/TopologyManager.java
@@ -17,9 +17,9 @@
import net.onrc.onos.datagrid.IDatagridService;
import net.onrc.onos.datagrid.IEventChannel;
import net.onrc.onos.datagrid.IEventChannelListener;
-import net.onrc.onos.datastore.topology.RCLink;
-import net.onrc.onos.datastore.topology.RCPort;
-import net.onrc.onos.datastore.topology.RCSwitch;
+import net.onrc.onos.datastore.topology.KVLink;
+import net.onrc.onos.datastore.topology.KVPort;
+import net.onrc.onos.datastore.topology.KVSwitch;
import net.onrc.onos.ofcontroller.networkgraph.PortEvent.SwitchPort;
import net.onrc.onos.ofcontroller.util.EventEntry;
import net.onrc.onos.registry.controller.IControllerRegistryService;
@@ -1141,8 +1141,8 @@
// how we initially subscribe to replication events
// Add all active switches
- for (RCSwitch sw : RCSwitch.getAllSwitches()) {
- if (sw.getStatus() != RCSwitch.STATUS.ACTIVE) {
+ for (KVSwitch sw : KVSwitch.getAllSwitches()) {
+ if (sw.getStatus() != KVSwitch.STATUS.ACTIVE) {
continue;
}
@@ -1155,8 +1155,8 @@
}
// Add all active ports
- for (RCPort p : RCPort.getAllPorts()) {
- if (p.getStatus() != RCPort.STATUS.ACTIVE) {
+ for (KVPort p : KVPort.getAllPorts()) {
+ if (p.getStatus() != KVPort.STATUS.ACTIVE) {
continue;
}
@@ -1169,14 +1169,14 @@
}
// TODO Is Device going to be in DB? If so, read from DB.
- // for (RCDevice d : RCDevice.getAllDevices()) {
+ // for (KVDevice d : KVDevice.getAllDevices()) {
// DeviceEvent devEvent = new DeviceEvent( MACAddress.valueOf(d.getMac()) );
// for (byte[] portId : d.getAllPortIds() ) {
- // devEvent.addAttachmentPoint( new SwitchPort( RCPort.getDpidFromKey(portId), RCPort.getNumberFromKey(portId) ));
+ // devEvent.addAttachmentPoint( new SwitchPort( KVPort.getDpidFromKey(portId), KVPort.getNumberFromKey(portId) ));
// }
// }
- for (RCLink l : RCLink.getAllLinks()) {
+ for (KVLink l : KVLink.getAllLinks()) {
LinkEvent linkEvent = new LinkEvent(l.getSrc().dpid,
l.getSrc().number,
l.getDst().dpid,