Enable checkstyle rules to check names of static final members
Enable the rule that mandates use of uppercase and underscores
in the names of static final members.
Change-Id: Ica7f004601f9efd14d4b6a4450189a6eb8967f72
diff --git a/src/main/java/net/onrc/onos/apps/bgproute/BgpRoute.java b/src/main/java/net/onrc/onos/apps/bgproute/BgpRoute.java
index 126c6a5..7202895 100644
--- a/src/main/java/net/onrc/onos/apps/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/apps/bgproute/BgpRoute.java
@@ -551,7 +551,7 @@
// Create flow path matching condition(s): IPv4 Prefix
FlowEntryMatch flowEntryMatch = new FlowEntryMatch();
- flowEntryMatch.enableEthernetFrameType(Ethernet.TYPE_IPv4);
+ flowEntryMatch.enableEthernetFrameType(Ethernet.TYPE_IPV4);
IPv4Net dstIPv4Net = new IPv4Net(prefix.toString());
flowEntryMatch.enableDstIPv4Net(dstIPv4Net);
flowPath.setFlowEntryMatch(flowEntryMatch);
@@ -767,7 +767,7 @@
// Create the Flow Path Match condition(s)
FlowEntryMatch flowEntryMatch = new FlowEntryMatch();
- flowEntryMatch.enableEthernetFrameType(Ethernet.TYPE_IPv4);
+ flowEntryMatch.enableEthernetFrameType(Ethernet.TYPE_IPV4);
flowEntryMatch.enableDstMac(dstMacAddress);
flowPath.setFlowEntryMatch(flowEntryMatch);
@@ -811,7 +811,7 @@
// Create the Flow Path Match condition(s)
FlowEntryMatch flowEntryMatch = new FlowEntryMatch();
- flowEntryMatch.enableEthernetFrameType(Ethernet.TYPE_IPv4);
+ flowEntryMatch.enableEthernetFrameType(Ethernet.TYPE_IPV4);
// Match both source address and dest address
IPv4Net dstIPv4Net = new IPv4Net(bgpPeer.getIpAddress().getHostAddress() + "/32");
diff --git a/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java b/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
index 3d2ab93..3ba545c 100644
--- a/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
+++ b/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
@@ -68,7 +68,7 @@
private static final int SLEEP_TIME_FOR_DB_DEVICE_INSTALLED = 100; // milliseconds
private final static int NUMBER_OF_THREAD_FOR_EXECUTOR = 1;
- private final static ScheduledExecutorService executor = Executors.newScheduledThreadPool(NUMBER_OF_THREAD_FOR_EXECUTOR);
+ private final static ScheduledExecutorService EXECUTOR_SERVICE = Executors.newScheduledThreadPool(NUMBER_OF_THREAD_FOR_EXECUTOR);
private final String callerId = "Forwarding";
@@ -239,7 +239,7 @@
log.debug("Receive PACKET_IN swId {}, portId {}", sw.getId(), pi.getInPort());
- if (eth.getEtherType() != Ethernet.TYPE_IPv4) {
+ if (eth.getEtherType() != Ethernet.TYPE_IPV4) {
return Command.CONTINUE;
}
@@ -281,7 +281,7 @@
destinationMac);
//Device is not in the DB, so wait it until the device is added.
- executor.schedule(new WaitDeviceArp(sw, pi, eth), SLEEP_TIME_FOR_DB_DEVICE_INSTALLED, TimeUnit.MILLISECONDS);
+ EXECUTOR_SERVICE.schedule(new WaitDeviceArp(sw, pi, eth), SLEEP_TIME_FOR_DB_DEVICE_INSTALLED, TimeUnit.MILLISECONDS);
return;
}
diff --git a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java
index 6cba576..7b97ec0 100644
--- a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java
+++ b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java
@@ -26,7 +26,7 @@
private static final Logger log = LoggerFactory.getLogger(HZTable.class);
// not sure how strict this should be managed
- private static final AtomicLong initialVersion = new AtomicLong(HZClient.VERSION_NONEXISTENT);
+ private static final AtomicLong INITIAL_VERSION = new AtomicLong(HZClient.VERSION_NONEXISTENT);
/**
* generate a new initial version for an entry.
@@ -34,10 +34,10 @@
* @return initial value
*/
protected static long getInitialVersion() {
- long version = initialVersion.incrementAndGet();
+ long version = INITIAL_VERSION.incrementAndGet();
if (version == HZClient.VERSION_NONEXISTENT) {
// used up whole 64bit space?
- version = initialVersion.incrementAndGet();
+ version = INITIAL_VERSION.incrementAndGet();
}
return version;
}
diff --git a/src/main/java/net/onrc/onos/core/datastore/ramcloud/RCClient.java b/src/main/java/net/onrc/onos/core/datastore/ramcloud/RCClient.java
index 4d228ef..d2e1670 100644
--- a/src/main/java/net/onrc/onos/core/datastore/ramcloud/RCClient.java
+++ b/src/main/java/net/onrc/onos/core/datastore/ramcloud/RCClient.java
@@ -39,7 +39,7 @@
private static final Logger log = LoggerFactory.getLogger(RCClient.class);
private static final String DB_CONFIG_FILE = "conf/ramcloud.conf";
- public static final Configuration config = getConfiguration();
+ public static final Configuration CONFIG = getConfiguration();
// Value taken from RAMCloud's Status.h
// FIXME These constants should be defined by JRamCloud
@@ -52,10 +52,10 @@
public static final int MAX_MULTI_WRITES = Math.max(1, Integer
.valueOf(System.getProperty("ramcloud.max_multi_writes", "800")));
- private static final ThreadLocal<JRamCloud> tlsRCClient = new ThreadLocal<JRamCloud>() {
+ private static final ThreadLocal<JRamCloud> TLS_RC_CLIENT = new ThreadLocal<JRamCloud>() {
@Override
protected JRamCloud initialValue() {
- return new JRamCloud(getCoordinatorUrl(config));
+ return new JRamCloud(getCoordinatorUrl(CONFIG));
}
};
@@ -66,14 +66,14 @@
* may be accessed later by another thread.
*/
static JRamCloud getJRamCloudClient() {
- return tlsRCClient.get();
+ return TLS_RC_CLIENT.get();
}
// Currently RCClient is state-less
- private static final RCClient theInstance = new RCClient();
+ private static final RCClient THE_INSTANCE = new RCClient();
public static RCClient getClient() {
- return theInstance;
+ return THE_INSTANCE;
}
public static final Configuration getConfiguration() {
@@ -538,14 +538,14 @@
return failExists;
}
- private static final ConcurrentHashMap<String, RCTable> tables = new ConcurrentHashMap<>();
+ private static final ConcurrentHashMap<String, RCTable> TABLES = new ConcurrentHashMap<>();
@Override
public IKVTable getTable(final String tableName) {
- RCTable table = tables.get(tableName);
+ RCTable table = TABLES.get(tableName);
if (table == null) {
RCTable newTable = new RCTable(tableName);
- RCTable existingTable = tables
+ RCTable existingTable = TABLES
.putIfAbsent(tableName, newTable);
if (existingTable != null) {
return existingTable;
@@ -560,7 +560,7 @@
public void dropTable(IKVTable table) {
JRamCloud rcClient = RCClient.getJRamCloudClient();
rcClient.dropTable(table.getTableId().getTableName());
- tables.remove(table.getTableId().getTableName());
+ TABLES.remove(table.getTableId().getTableName());
}
static final long VERSION_NONEXISTENT = JRamCloud.VERSION_NONEXISTENT;
diff --git a/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java b/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
index 8b1d8af..4b9d3c3 100644
--- a/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
+++ b/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
@@ -31,7 +31,7 @@
public class KVDevice extends KVObject {
private static final Logger log = LoggerFactory.getLogger(KVDevice.class);
- private static final ThreadLocal<Kryo> deviceKryo = new ThreadLocal<Kryo>() {
+ private static final ThreadLocal<Kryo> DEVICE_KRYO = new ThreadLocal<Kryo>() {
@Override
protected Kryo initialValue() {
Kryo kryo = new Kryo();
@@ -167,12 +167,12 @@
isPortIdsModified = false;
}
- return serializePropertyMap(deviceKryo.get(), map);
+ return serializePropertyMap(DEVICE_KRYO.get(), map);
}
@Override
protected boolean deserialize(final byte[] bytes) {
- boolean success = deserializePropertyMap(deviceKryo.get(), bytes);
+ boolean success = deserializePropertyMap(DEVICE_KRYO.get(), bytes);
if (!success) {
log.error("Deserializing Link: " + this + " failed.");
return false;
diff --git a/src/main/java/net/onrc/onos/core/datastore/topology/KVLink.java b/src/main/java/net/onrc/onos/core/datastore/topology/KVLink.java
index a7501e1..ed1f306 100644
--- a/src/main/java/net/onrc/onos/core/datastore/topology/KVLink.java
+++ b/src/main/java/net/onrc/onos/core/datastore/topology/KVLink.java
@@ -25,7 +25,7 @@
public class KVLink extends KVObject {
private static final Logger log = LoggerFactory.getLogger(KVLink.class);
- private static final ThreadLocal<Kryo> linkKryo = new ThreadLocal<Kryo>() {
+ private static final ThreadLocal<Kryo> LINK_KRYO = new ThreadLocal<Kryo>() {
@Override
protected Kryo initialValue() {
Kryo kryo = new Kryo();
@@ -184,7 +184,7 @@
link.setStatus(status.ordinal());
if (!map.isEmpty()) {
- byte[] propMaps = serializePropertyMap(linkKryo.get(), map);
+ byte[] propMaps = serializePropertyMap(LINK_KRYO.get(), map);
link.setValue(ByteString.copyFrom(propMaps));
}
@@ -198,7 +198,7 @@
LinkProperty link = LinkProperty.parseFrom(bytes);
byte[] props = link.getValue().toByteArray();
- success &= deserializePropertyMap(linkKryo.get(), props);
+ success &= deserializePropertyMap(LINK_KRYO.get(), props);
this.status = STATUS.values()[link.getStatus()];
return success;
diff --git a/src/main/java/net/onrc/onos/core/datastore/topology/KVPort.java b/src/main/java/net/onrc/onos/core/datastore/topology/KVPort.java
index 254e026..5721b78 100644
--- a/src/main/java/net/onrc/onos/core/datastore/topology/KVPort.java
+++ b/src/main/java/net/onrc/onos/core/datastore/topology/KVPort.java
@@ -29,7 +29,7 @@
public class KVPort extends KVObject {
private static final Logger log = LoggerFactory.getLogger(KVPort.class);
- private static final ThreadLocal<Kryo> portKryo = new ThreadLocal<Kryo>() {
+ private static final ThreadLocal<Kryo> PORT_KRYO = new ThreadLocal<Kryo>() {
@Override
protected Kryo initialValue() {
Kryo kryo = new Kryo();
@@ -171,7 +171,7 @@
port.setStatus(status.ordinal());
if (!map.isEmpty()) {
- byte[] propMaps = serializePropertyMap(portKryo.get(), map);
+ byte[] propMaps = serializePropertyMap(PORT_KRYO.get(), map);
port.setValue(ByteString.copyFrom(propMaps));
}
@@ -185,7 +185,7 @@
PortProperty port = PortProperty.parseFrom(bytes);
byte[] props = port.getValue().toByteArray();
- success &= deserializePropertyMap(portKryo.get(), props);
+ success &= deserializePropertyMap(PORT_KRYO.get(), props);
this.status = STATUS.values()[port.getStatus()];
return success;
diff --git a/src/main/java/net/onrc/onos/core/datastore/topology/KVSwitch.java b/src/main/java/net/onrc/onos/core/datastore/topology/KVSwitch.java
index a9cc367..a38e17d 100644
--- a/src/main/java/net/onrc/onos/core/datastore/topology/KVSwitch.java
+++ b/src/main/java/net/onrc/onos/core/datastore/topology/KVSwitch.java
@@ -28,7 +28,7 @@
public class KVSwitch extends KVObject {
private static final Logger log = LoggerFactory.getLogger(KVSwitch.class);
- private static final ThreadLocal<Kryo> switchKryo = new ThreadLocal<Kryo>() {
+ private static final ThreadLocal<Kryo> SWITCH_KRYO = new ThreadLocal<Kryo>() {
@Override
protected Kryo initialValue() {
Kryo kryo = new Kryo();
@@ -140,7 +140,7 @@
sw.setStatus(status.ordinal());
if (!map.isEmpty()) {
- byte[] propMaps = serializePropertyMap(switchKryo.get(), map);
+ byte[] propMaps = serializePropertyMap(SWITCH_KRYO.get(), map);
sw.setValue(ByteString.copyFrom(propMaps));
}
@@ -154,7 +154,7 @@
SwitchProperty sw = SwitchProperty.parseFrom(bytes);
byte[] props = sw.getValue().toByteArray();
- success &= deserializePropertyMap(switchKryo.get(), props);
+ success &= deserializePropertyMap(SWITCH_KRYO.get(), props);
this.status = STATUS.values()[sw.getStatus()];
return success;
diff --git a/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java b/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java
index 937129a..c696bd7 100644
--- a/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java
+++ b/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java
@@ -34,7 +34,7 @@
// Default Kryo serializer.
// each sub-class should prepare their own serializer, which has required
// objects registered for better performance.
- private static final ThreadLocal<Kryo> defaultKryo = new ThreadLocal<Kryo>() {
+ private static final ThreadLocal<Kryo> DEFAULT_KRYO = new ThreadLocal<Kryo>() {
@Override
protected Kryo initialValue() {
Kryo kryo = new Kryo();
@@ -125,7 +125,7 @@
* @return serialized byte array
*/
public byte[] serialize() {
- return serializePropertyMap(defaultKryo.get(), this.propertyMap);
+ return serializePropertyMap(DEFAULT_KRYO.get(), this.propertyMap);
}
protected byte[] serializePropertyMap(final Kryo kryo,
@@ -161,7 +161,7 @@
* @return true if success
*/
protected boolean deserialize(final byte[] bytes) {
- deserializePropertyMap(defaultKryo.get(), bytes);
+ deserializePropertyMap(DEFAULT_KRYO.get(), bytes);
return true;
}
diff --git a/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java b/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java
index 22a564b..3b45dfc 100644
--- a/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java
+++ b/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java
@@ -51,7 +51,7 @@
private CopyOnWriteArrayList<IOnosDeviceListener> deviceListeners;
private IFloodlightProviderService floodlightProvider;
- private final static ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
+ private final static ScheduledExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadScheduledExecutor();
private IDatagridService datagrid;
private IEventChannel<Long, OnosDevice> eventChannel;
@@ -294,7 +294,7 @@
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
- executor.scheduleAtFixedRate(new CleanDevice(), 30, CLEANUP_SECOND, TimeUnit.SECONDS);
+ EXECUTOR_SERVICE.scheduleAtFixedRate(new CleanDevice(), 30, CLEANUP_SECOND, TimeUnit.SECONDS);
deviceListeners = new CopyOnWriteArrayList<IOnosDeviceListener>();
datagrid = context.getServiceImpl(IDatagridService.class);
diff --git a/src/main/java/net/onrc/onos/core/flowprogrammer/FlowProgrammer.java b/src/main/java/net/onrc/onos/core/flowprogrammer/FlowProgrammer.java
index 4a25cd3..ff3268e 100644
--- a/src/main/java/net/onrc/onos/core/flowprogrammer/FlowProgrammer.java
+++ b/src/main/java/net/onrc/onos/core/flowprogrammer/FlowProgrammer.java
@@ -42,7 +42,7 @@
IOFMessageListener,
IOFSwitchListener {
// flag to enable FlowSynchronizer
- private static final boolean enableFlowSync = false;
+ private static final boolean ENABLE_FLOW_SYNC = false;
protected static final Logger log = LoggerFactory.getLogger(FlowProgrammer.class);
protected volatile IFloodlightProviderService floodlightProvider;
protected volatile IControllerRegistryService registryService;
@@ -55,7 +55,7 @@
public FlowProgrammer() {
pusher = new FlowPusher(NUM_PUSHER_THREAD);
- if (enableFlowSync) {
+ if (ENABLE_FLOW_SYNC) {
synchronizer = new FlowSynchronizer();
}
}
@@ -67,7 +67,7 @@
registryService = context.getServiceImpl(IControllerRegistryService.class);
restApi = context.getServiceImpl(IRestApiService.class);
pusher.init(null, context, floodlightProvider.getOFMessageFactory(), null);
- if (enableFlowSync) {
+ if (ENABLE_FLOW_SYNC) {
synchronizer.init(pusher);
}
}
@@ -85,7 +85,7 @@
Collection<Class<? extends IFloodlightService>> l =
new ArrayList<Class<? extends IFloodlightService>>();
l.add(IFlowPusherService.class);
- if (enableFlowSync) {
+ if (ENABLE_FLOW_SYNC) {
l.add(IFlowSyncService.class);
}
return l;
@@ -98,7 +98,7 @@
new HashMap<Class<? extends IFloodlightService>,
IFloodlightService>();
m.put(IFlowPusherService.class, pusher);
- if (enableFlowSync) {
+ if (ENABLE_FLOW_SYNC) {
m.put(IFlowSyncService.class, synchronizer);
}
return m;
@@ -151,7 +151,7 @@
public void addedSwitch(IOFSwitch sw) {
log.debug("Switch added: {}", sw.getId());
- if (enableFlowSync) {
+ if (ENABLE_FLOW_SYNC) {
if (registryService.hasControl(sw.getId())) {
synchronizer.synchronize(sw);
}
@@ -162,7 +162,7 @@
public void removedSwitch(IOFSwitch sw) {
log.debug("Switch removed: {}", sw.getId());
- if (enableFlowSync) {
+ if (ENABLE_FLOW_SYNC) {
synchronizer.interrupt(sw);
}
}
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java b/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java
index e8c5dfc..ba845ed 100755
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PersistIntent.java
@@ -35,8 +35,8 @@
private long range = 10000L;
private final IControllerRegistryService controllerRegistry;
NetworkGraph graph = null;
- private final static String intentJournal = "G:IntentJournal";
- private final static int valueStoreLimit = 1024 * 1024;
+ private final static String INTENT_JOURNAL = "G:IntentJournal";
+ private final static int VALUE_STORE_LIMIT = 1024 * 1024;
private IKVTable table;
private Kryo kryo;
private ByteArrayOutputStream stream;
@@ -49,7 +49,7 @@
public PersistIntent(final IControllerRegistryService controllerRegistry, INetworkGraphService ng) {
this.controllerRegistry = controllerRegistry;
this.graph = ng.getNetworkGraph();
- table = DataStoreClient.getClient().getTable(intentJournal);
+ table = DataStoreClient.getClient().getTable(INTENT_JOURNAL);
stream = new ByteArrayOutputStream(1024);
output = new Output(stream);
kryo = (new KryoFactory()).newKryo();
@@ -89,17 +89,17 @@
ByteBuffer keyBytes = ByteBuffer.allocate(8).putLong(key);
byte[] buffer = stream.toByteArray();
int total = buffer.length;
- if ((total >= valueStoreLimit)) {
- int writeCount = total / valueStoreLimit;
- int remainder = total % valueStoreLimit;
+ if ((total >= VALUE_STORE_LIMIT)) {
+ int writeCount = total / VALUE_STORE_LIMIT;
+ int remainder = total % VALUE_STORE_LIMIT;
int upperIndex = 0;
for (int i = 0; i < writeCount; i++, key++) {
keyBytes.clear();
keyBytes.putLong(key);
keyBytes.flip();
- upperIndex = (i * valueStoreLimit + valueStoreLimit) - 1;
- log.debug("writing using indexes {}:{}", (i * valueStoreLimit), upperIndex);
- table.create(keyBytes.array(), Arrays.copyOfRange(buffer, i * valueStoreLimit, upperIndex));
+ upperIndex = (i * VALUE_STORE_LIMIT + VALUE_STORE_LIMIT) - 1;
+ log.debug("writing using indexes {}:{}", (i * VALUE_STORE_LIMIT), upperIndex);
+ table.create(keyBytes.array(), Arrays.copyOfRange(buffer, i * VALUE_STORE_LIMIT, upperIndex));
}
if (remainder > 0) {
keyBytes.clear();
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java
index 6e0dc69..efa0188 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java
@@ -141,13 +141,13 @@
private static final short TLV_DIRECTION_LENGTH = 1; // 1 byte
private static final byte[] TLV_DIRECTION_VALUE_FORWARD = {0x01};
private static final byte[] TLV_DIRECTION_VALUE_REVERSE = {0x02};
- private static final LLDPTLV forwardTLV
+ private static final LLDPTLV FORWARD_TLV
= new LLDPTLV().
setType(TLV_DIRECTION_TYPE).
setLength(TLV_DIRECTION_LENGTH).
setValue(TLV_DIRECTION_VALUE_FORWARD);
- private static final LLDPTLV reverseTLV
+ private static final LLDPTLV REVERSE_TLV
= new LLDPTLV().
setType(TLV_DIRECTION_TYPE).
setLength(TLV_DIRECTION_LENGTH).
@@ -635,9 +635,9 @@
// Add the controller identifier to the TLV value.
lldp.getOptionalTLVList().add(controllerTLV);
if (isReverse) {
- lldp.getOptionalTLVList().add(reverseTLV);
+ lldp.getOptionalTLVList().add(REVERSE_TLV);
} else {
- lldp.getOptionalTLVList().add(forwardTLV);
+ lldp.getOptionalTLVList().add(FORWARD_TLV);
}
Ethernet ethernet;
diff --git a/src/main/java/net/onrc/onos/core/packet/Ethernet.java b/src/main/java/net/onrc/onos/core/packet/Ethernet.java
index 8a4b0fb..aad27a5 100644
--- a/src/main/java/net/onrc/onos/core/packet/Ethernet.java
+++ b/src/main/java/net/onrc/onos/core/packet/Ethernet.java
@@ -33,7 +33,7 @@
private static String HEXES = "0123456789ABCDEF";
public static final short TYPE_ARP = 0x0806;
public static final short TYPE_RARP = (short) 0x8035;
- public static final short TYPE_IPv4 = 0x0800;
+ public static final short TYPE_IPV4 = 0x0800;
public static final short TYPE_LLDP = (short) 0x88cc;
public static final short TYPE_BSN = (short) 0x8942;
public static final short VLAN_UNTAGGED = (short) 0xffff;
@@ -44,7 +44,7 @@
etherTypeClassMap = new HashMap<Short, Class<? extends IPacket>>();
etherTypeClassMap.put(TYPE_ARP, ARP.class);
etherTypeClassMap.put(TYPE_RARP, ARP.class);
- etherTypeClassMap.put(TYPE_IPv4, IPv4.class);
+ etherTypeClassMap.put(TYPE_IPV4, IPv4.class);
etherTypeClassMap.put(TYPE_LLDP, LLDP.class);
etherTypeClassMap.put(TYPE_BSN, BSN.class);
}
diff --git a/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java b/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java
index d85faf2..b103d17 100755
--- a/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java
+++ b/src/main/java/net/onrc/onos/core/registry/ZookeeperRegistry.java
@@ -87,8 +87,8 @@
protected DistributedAtomicLong distributedIdCounter;
//Zookeeper performance-related configuration
- protected static final int sessionTimeout = 5000;
- protected static final int connectionTimeout = 7000;
+ protected static final int SESSION_TIMEOUT = 5000;
+ protected static final int CONNECTION_TIMEOUT = 7000;
//
// Unique ID generation state
@@ -569,7 +569,7 @@
RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
client = CuratorFrameworkFactory.newClient(this.connectionString,
- sessionTimeout, connectionTimeout, retryPolicy);
+ SESSION_TIMEOUT, CONNECTION_TIMEOUT, retryPolicy);
client.start();
client = client.usingNamespace(namespace);
diff --git a/src/main/java/net/onrc/onos/core/util/PerformanceMonitor.java b/src/main/java/net/onrc/onos/core/util/PerformanceMonitor.java
index c09666a..2a85904 100644
--- a/src/main/java/net/onrc/onos/core/util/PerformanceMonitor.java
+++ b/src/main/java/net/onrc/onos/core/util/PerformanceMonitor.java
@@ -15,13 +15,13 @@
private final static Logger log = LoggerFactory.getLogger(PerformanceMonitor.class);
// experiment name -> PerformanceMonitor
- private static final ConcurrentHashMap<String, PerformanceMonitor> perfMons = new ConcurrentHashMap<>();
+ private static final ConcurrentHashMap<String, PerformanceMonitor> PERF_MONS = new ConcurrentHashMap<>();
public static PerformanceMonitor experiment(String name) {
- PerformanceMonitor pm = perfMons.get(name);
+ PerformanceMonitor pm = PERF_MONS.get(name);
if (pm == null) {
pm = new PerformanceMonitor();
- PerformanceMonitor existing = perfMons.putIfAbsent(name, pm);
+ PerformanceMonitor existing = PERF_MONS.putIfAbsent(name, pm);
if (existing != null) {
pm = existing;
}
@@ -33,7 +33,7 @@
private final ConcurrentHashMap<String, Queue<Measurement>> map = new ConcurrentHashMap<>();
private long overhead;
private long experimentStart = Long.MAX_VALUE;
- private final static double normalization = Math.pow(10, 6);
+ private final static double NORMALIZATION = Math.pow(10, 6);
/**
* Start a performance measurement, identified by a tag
@@ -132,13 +132,13 @@
start -= experimentStart;
stop -= experimentStart;
result += key + '=' +
- (avg / normalization) + '/' +
- (start / normalization) + '/' +
- (stop / normalization) + '/' +
+ (avg / NORMALIZATION) + '/' +
+ (start / NORMALIZATION) + '/' +
+ (stop / NORMALIZATION) + '/' +
count + '\n';
}
- double overheadMs = overhead / normalization;
- double experimentElapsed = (experimentEnd - experimentStart) / normalization;
+ double overheadMs = overhead / NORMALIZATION;
+ double experimentElapsed = (experimentEnd - experimentStart) / NORMALIZATION;
result += "TotalTime:" + experimentElapsed + "/Overhead:" + overheadMs;
log.error(result);
// log.error("Performance Results: {} with measurement overhead: {} ms", map, overheadMilli);
@@ -217,40 +217,40 @@
*/
@Override
public String toString() {
- double milli = elapsed() / normalization;
- double startMs = start / normalization;
- double stopMs = stop / normalization;
+ double milli = elapsed() / NORMALIZATION;
+ double startMs = start / NORMALIZATION;
+ double stopMs = stop / NORMALIZATION;
return milli + "ms/" + startMs + '/' + stopMs;
}
}
@Deprecated
- private static final PerformanceMonitor theInstance = new PerformanceMonitor();
+ private static final PerformanceMonitor PERFORMANCE_MONITOR_INSTANCE = new PerformanceMonitor();
@Deprecated
public static Measurement start(String tag) {
- return theInstance.startStep(tag);
+ return PERFORMANCE_MONITOR_INSTANCE.startStep(tag);
}
@Deprecated
public static void stop(String tag) {
- theInstance.stopStep(tag);
+ PERFORMANCE_MONITOR_INSTANCE.stopStep(tag);
}
@Deprecated
public static void clear() {
- theInstance.reset();
+ PERFORMANCE_MONITOR_INSTANCE.reset();
}
@Deprecated
public static void report() {
- theInstance.reportAll();
+ PERFORMANCE_MONITOR_INSTANCE.reportAll();
}
@Deprecated
public static void report(String tag) {
- theInstance.reportStep(tag);
+ PERFORMANCE_MONITOR_INSTANCE.reportStep(tag);
}
public static void main(String[] args) {
diff --git a/src/test/java/net/floodlightcontroller/core/test/PacketFactory.java b/src/test/java/net/floodlightcontroller/core/test/PacketFactory.java
index 77d6fa0..b863d11 100644
--- a/src/test/java/net/floodlightcontroller/core/test/PacketFactory.java
+++ b/src/test/java/net/floodlightcontroller/core/test/PacketFactory.java
@@ -110,7 +110,7 @@
Ethernet requestPacket = new Ethernet();
requestPacket.setSourceMACAddress(hostMac.toBytes())
.setDestinationMACAddress(broadcastMac)
- .setEtherType(Ethernet.TYPE_IPv4)
+ .setEtherType(Ethernet.TYPE_IPV4)
.setPayload(
new IPv4()
.setVersion((byte) 4)
diff --git a/src/test/java/net/onrc/onos/core/packet/PacketTest.java b/src/test/java/net/onrc/onos/core/packet/PacketTest.java
index ab5247e..efbf05c 100644
--- a/src/test/java/net/onrc/onos/core/packet/PacketTest.java
+++ b/src/test/java/net/onrc/onos/core/packet/PacketTest.java
@@ -17,7 +17,7 @@
this.pkt1 = new Ethernet()
.setDestinationMACAddress("00:11:22:33:44:55")
.setSourceMACAddress("00:44:33:22:11:00")
- .setEtherType(Ethernet.TYPE_IPv4)
+ .setEtherType(Ethernet.TYPE_IPV4)
.setPayload(
new IPv4()
.setTtl((byte) 128)
@@ -65,7 +65,7 @@
this.pkt4 = new Ethernet()
.setDestinationMACAddress("FF:FF:FF:FF:FF:FF")
.setSourceMACAddress("00:11:33:55:77:01")
- .setEtherType(Ethernet.TYPE_IPv4)
+ .setEtherType(Ethernet.TYPE_IPV4)
.setPayload(
new IPv4()
.setTtl((byte) 128)