smengcl commented on a change in pull request #1601:
URL: https://github.com/apache/ozone/pull/1601#discussion_r527137852
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java
##########
@@ -190,16 +217,32 @@ void setShutdownGracefully() {
public boolean getShutdownOnError() {
return shutdownOnError;
}
+
/**
* Adds the report to report queue.
*
* @param report report to be added
*/
public void addReport(GeneratedMessage report) {
if (report != null) {
- synchronized (reports) {
- for (InetSocketAddress endpoint : endpoints) {
- reports.get(endpoint).add(report);
+ final String reportType = report.getDescriptorForType().getFullName();
+ for (InetSocketAddress endpoint : endpoints) {
+ // Check report type
+ if (reportType.equals(containerReportsProtoName)) {
+ containerReport = report;
+ } else if (reportType.equals(nodeReportProtoName)) {
+ nodeReport = report;
+ } else if (reportType.equals(pipelineReportsProtoName)) {
+ pipelineReport = report;
+ } else if (reportType.equals(commandStatusReportsProtoName) ||
+ reportType.equals(incrementalContainerReportProtoName)) {
+ // report type is CommandStatusReports or IncrementalContainerReport
+ synchronized (reports) {
+ reports.get(endpoint).add(report);
Review comment:
Yes `else` would work here. I was pushing this as an assertion check
here just for now to see if I will get any UT failures. Will remove later.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]