Skip to content
Snippets Groups Projects
Commit 4b98845b authored by Saurav Das's avatar Saurav Das
Browse files

minor comment changes

parent edb9fe3a
No related branches found
No related tags found
No related merge requests found
......@@ -794,7 +794,7 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
if (srcEntity == null)
return Command.STOP;
// Learn from ARP packet.
// Learn from ARP packet for special VRRP settings.
// In VRRP settings, the source MAC address and sender MAC
// addresses can be different. In such cases, we need to learn
// the IP to MAC mapping of the VRRP IP address. The source
......@@ -1077,9 +1077,10 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
* the given source device. The source device is important since
* there could be ambiguity in the destination device without the
* attachment point information.
* @param source the source device. The returned destination will be
* in the same entity class as the source.
* @param dstEntity the entity to look up
* @param reference the source device's entity class.
* The returned destination will be
* in the same entity class as the source.
* @param dstEntity the entity to look up
* @return an {@link Device} or null if no device is found.
*/
protected Device findDestByEntity(IEntityClass reference,
......
/**
* Copyright 2012 Big Switch Networks, Inc.
* Copyright 2012 Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
......@@ -31,7 +31,7 @@ public class DeviceUniqueIndex extends DeviceIndex {
/**
* The index
*/
private ConcurrentHashMap<IndexedEntity, Long> index;
private final ConcurrentHashMap<IndexedEntity, Long> index;
/**
* Construct a new device index using the provided key fields
......@@ -51,10 +51,10 @@ public class DeviceUniqueIndex extends DeviceIndex {
final Long deviceKey = findByEntity(entity);
if (deviceKey != null)
return Collections.<Long>singleton(deviceKey).iterator();
return Collections.<Long>emptySet().iterator();
}
@Override
public Iterator<Long> getAll() {
return index.values().iterator();
......@@ -68,15 +68,15 @@ public class DeviceUniqueIndex extends DeviceIndex {
Long ret = index.putIfAbsent(ie, deviceKey);
if (ret != null && !ret.equals(deviceKey)) {
// If the return value is non-null, then fail the insert
// (this implies that a device using this entity has
// If the return value is non-null, then fail the insert
// (this implies that a device using this entity has
// already been created in another thread).
return false;
}
}
return true;
}
@Override
public void updateIndex(Entity entity, Long deviceKey) {
IndexedEntity ie = new IndexedEntity(keyFields, entity);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment