Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
MD-SAL StatisticsManager- Stopping statistics thread until i fix all the relevant
[controller.git]
/
opendaylight
/
md-sal
/
statistics-manager
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
md
/
statistics
/
manager
/
StatisticsProvider.java
diff --git
a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java
b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java
index 5534c0458a9d55409ab677d81d31443434a1d749..cdcd1ef32edde93dbc83745a62c97f81a2f42a83 100644
(file)
--- a/
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java
+++ b/
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java
@@
-24,6
+24,7
@@
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInputBuilder;
@@
-112,7
+113,7
@@
public class StatisticsProvider implements AutoCloseable {
spLogger.debug("Statistics requester thread started with timer interval : {}",5000);
spLogger.debug("Statistics requester thread started with timer interval : {}",5000);
- statisticsRequesterThread.start();
+
//
statisticsRequesterThread.start();
spLogger.info("Statistics Provider started.");
}
spLogger.info("Statistics Provider started.");
}
@@
-127,6
+128,9
@@
public class StatisticsProvider implements AutoCloseable {
//Need to call API to receive all the nodes connected to controller.
List<Node> targetNodes = getAllConnectedNodes();
//Need to call API to receive all the nodes connected to controller.
List<Node> targetNodes = getAllConnectedNodes();
+
+ if(targetNodes == null)
+ return;
for (Node targetNode : targetNodes){
spLogger.info("Send request for stats collection to node : {})",targetNode.getId());
for (Node targetNode : targetNodes){
spLogger.info("Send request for stats collection to node : {})",targetNode.getId());
@@
-134,76
+138,86
@@
public class StatisticsProvider implements AutoCloseable {
//We need to add check, so see if groups/meters are supported
//by the target node. Below check doesn't look good.
if(targetNode.getId().getValue().contains("openflow:")){
//We need to add check, so see if groups/meters are supported
//by the target node. Below check doesn't look good.
if(targetNode.getId().getValue().contains("openflow:")){
- sendAllGroupStatisticsRequest(targetNode);
+ InstanceIdentifier<Node> targetInstanceId = InstanceIdentifier.builder(Nodes.class).child(Node.class,targetNode.getKey()).toInstance();
+ NodeRef targetNodeRef = new NodeRef(targetInstanceId);
+
+ sendAllGroupStatisticsRequest(targetNodeRef);
- sendAllMeterStatisticsRequest(targetNode);
+ sendAllMeterStatisticsRequest(targetNode
Ref
);
- sendGroupDescriptionRequest(targetNode);
+ sendGroupDescriptionRequest(targetNode
Ref
);
- sendGroupFeaturesRequest(targetNode);
+ sendGroupFeaturesRequest(targetNode
Ref
);
- sendMeterConfigStatisticsRequest(targetNode);
+ sendMeterConfigStatisticsRequest(targetNode
Ref
);
- sendMeterFeaturesRequest(targetNode);
+ sendMeterFeaturesRequest(targetNode
Ref
);
}
}
}
}
}
}
- private void sendAllGroupStatisticsRequest(Node targetNode){
+ private void sendAllGroupStatisticsRequest(Node
Ref
targetNode){
final GetAllGroupStatisticsInputBuilder input = new GetAllGroupStatisticsInputBuilder();
final GetAllGroupStatisticsInputBuilder input = new GetAllGroupStatisticsInputBuilder();
- input.setId(targetNode.getId());
+ input.setNode(targetNode);
+ input.setNode(targetNode);
+ @SuppressWarnings("unused")
Future<RpcResult<GetAllGroupStatisticsOutput>> response =
groupStatsService.getAllGroupStatistics(input.build());
}
Future<RpcResult<GetAllGroupStatisticsOutput>> response =
groupStatsService.getAllGroupStatistics(input.build());
}
- private void sendGroupDescriptionRequest(Node targetNode){
+ private void sendGroupDescriptionRequest(Node
Ref
targetNode){
final GetGroupDescriptionInputBuilder input = new GetGroupDescriptionInputBuilder();
final GetGroupDescriptionInputBuilder input = new GetGroupDescriptionInputBuilder();
- input.setId(targetNode.getId());
-
+ input.setNode(targetNode);
+
+ @SuppressWarnings("unused")
Future<RpcResult<GetGroupDescriptionOutput>> response =
groupStatsService.getGroupDescription(input.build());
}
Future<RpcResult<GetGroupDescriptionOutput>> response =
groupStatsService.getGroupDescription(input.build());
}
- private void sendGroupFeaturesRequest(Node targetNode){
+ private void sendGroupFeaturesRequest(Node
Ref
targetNode){
GetGroupFeaturesInputBuilder input = new GetGroupFeaturesInputBuilder();
GetGroupFeaturesInputBuilder input = new GetGroupFeaturesInputBuilder();
- input.setId(targetNode.getId());
-
+ input.setNode(targetNode);
+
+ @SuppressWarnings("unused")
Future<RpcResult<GetGroupFeaturesOutput>> response =
groupStatsService.getGroupFeatures(input.build());
}
Future<RpcResult<GetGroupFeaturesOutput>> response =
groupStatsService.getGroupFeatures(input.build());
}
- private void sendAllMeterStatisticsRequest(Node targetNode){
+ private void sendAllMeterStatisticsRequest(Node
Ref
targetNode){
GetAllMeterStatisticsInputBuilder input = new GetAllMeterStatisticsInputBuilder();
GetAllMeterStatisticsInputBuilder input = new GetAllMeterStatisticsInputBuilder();
- input.setId(targetNode.getId());
-
+ input.setNode(targetNode);
+
+ @SuppressWarnings("unused")
Future<RpcResult<GetAllMeterStatisticsOutput>> response =
meterStatsService.getAllMeterStatistics(input.build());
}
Future<RpcResult<GetAllMeterStatisticsOutput>> response =
meterStatsService.getAllMeterStatistics(input.build());
}
- private void sendMeterConfigStatisticsRequest(Node targetNode){
+ private void sendMeterConfigStatisticsRequest(Node
Ref
targetNode){
GetAllMeterConfigStatisticsInputBuilder input = new GetAllMeterConfigStatisticsInputBuilder();
GetAllMeterConfigStatisticsInputBuilder input = new GetAllMeterConfigStatisticsInputBuilder();
- input.setId(targetNode.getId());
-
+ input.setNode(targetNode);
+
+ @SuppressWarnings("unused")
Future<RpcResult<GetAllMeterConfigStatisticsOutput>> response =
meterStatsService.getAllMeterConfigStatistics(input.build());
}
Future<RpcResult<GetAllMeterConfigStatisticsOutput>> response =
meterStatsService.getAllMeterConfigStatistics(input.build());
}
- private void sendMeterFeaturesRequest(Node targetNode){
+ private void sendMeterFeaturesRequest(Node
Ref
targetNode){
GetMeterFeaturesInputBuilder input = new GetMeterFeaturesInputBuilder();
GetMeterFeaturesInputBuilder input = new GetMeterFeaturesInputBuilder();
- input.setId(targetNode.getId());
-
+ input.setNode(targetNode);
+
+ @SuppressWarnings("unused")
Future<RpcResult<GetMeterFeaturesOutput>> response =
meterStatsService.getMeterFeatures(input.build());
}
Future<RpcResult<GetMeterFeaturesOutput>> response =
meterStatsService.getMeterFeatures(input.build());
}
@@
-215,6
+229,9
@@
public class StatisticsProvider implements AutoCloseable {
private List<Node> getAllConnectedNodes(){
Nodes nodes = (Nodes) dps.readOperationalData(nodesIdentifier);
private List<Node> getAllConnectedNodes(){
Nodes nodes = (Nodes) dps.readOperationalData(nodesIdentifier);
+ if(nodes == null)
+ return null;
+
spLogger.info("Number of connected nodes : {}",nodes.getNode().size());
return nodes.getNode();
}
spLogger.info("Number of connected nodes : {}",nodes.getNode().size());
return nodes.getNode();
}
@@
-235,7
+252,6
@@
public class StatisticsProvider implements AutoCloseable {
} catch (Throwable e) {
throw Exceptions.sneakyThrow(e);
}
} catch (Throwable e) {
throw Exceptions.sneakyThrow(e);
}
-
}
}
}
}