triggers = new ConcurrentHashMap<Integer, Node>();
}
- @SuppressWarnings("deprecation")
private void allocateCaches() {
if (clusterContainerService == null) {
nonClusterObjectCreate();
log.debug("Skipping statistics cache creation - already present");
}
}
- @SuppressWarnings({ "unchecked", "deprecation" })
+ @SuppressWarnings({ "unchecked" })
private void retrieveCaches() {
ConcurrentMap<?, ?> map;
try {
boolean retStatus;
if(oldLatch != null) {
- retStatus = oldLatch.await(this.latchTimeout, TimeUnit.SECONDS);
+ retStatus = oldLatch.await(StatisticsManager.latchTimeout, TimeUnit.SECONDS);
} else {
- retStatus = newLatch.await(this.latchTimeout, TimeUnit.SECONDS);
+ retStatus = newLatch.await(StatisticsManager.latchTimeout, TimeUnit.SECONDS);
}
// log the return code as it will give us, if
// the latch timed out.
@Override
public List<NodeConnectorStatistics> getNodeConnectorStatistics(Node node) {
if (node == null){
- return null;
+ return Collections.emptyList();
}
List<NodeConnectorStatistics> statList = new ArrayList<NodeConnectorStatistics>();
@Override
public List<NodeTableStatistics> getNodeTableStatistics(Node node){
if (node == null){
- return null;
+ return Collections.emptyList();
}
List<NodeTableStatistics> statList = new ArrayList<NodeTableStatistics>();
List<NodeTableStatistics> cachedList = tableStatistics.get(node);
@Override
public void nodeFlowStatisticsUpdated(Node node, List<FlowOnNode> flowStatsList) {
- List<FlowOnNode> currentStat = this.flowStatistics.get(node);
- // Update cache only if changed to avoid unnecessary cache sync operations
- if (! flowStatsList.equals(currentStat)){
- this.flowStatistics.put(node, flowStatsList);
- }
+ // No equality check because duration fields change constantly
+ this.flowStatistics.put(node, flowStatsList);
}
@Override