use of net.engio.mbassy.listener.Handler in project apex-core by apache.
the class TupleRecorderCollection method collected.
@Handler
public void collected(ContainerStatsEvent cse) {
ContainerStats stats = cse.getContainerStats();
for (OperatorHeartbeat node : stats.operators) {
for (OperatorStats os : node.windowStats) {
if (os.inputPorts != null) {
for (PortStats ps : os.inputPorts) {
ps.recordingId = null;
}
}
if (os.outputPorts != null) {
for (PortStats ps : os.outputPorts) {
ps.recordingId = null;
}
}
}
}
for (OperatorHeartbeat node : stats.operators) {
String recordingId;
TupleRecorder tupleRecorder = get(new OperatorIdPortNamePair(node.nodeId, null));
if (tupleRecorder == null) {
recordingId = null;
for (Map.Entry<OperatorIdPortNamePair, TupleRecorder> entry : this.entrySet()) {
if (entry.getKey().operatorId == node.nodeId) {
for (OperatorStats os : node.windowStats) {
if (os.inputPorts != null) {
for (PortStats ps : os.inputPorts) {
if (ps.id.equals(entry.getKey().portName)) {
ps.recordingId = entry.getValue().getId();
break;
}
}
}
if (os.outputPorts != null) {
for (PortStats ps : os.outputPorts) {
if (ps.id.equals(entry.getKey().portName)) {
ps.recordingId = entry.getValue().getId();
break;
}
}
}
}
}
}
} else {
recordingId = tupleRecorder.getId();
}
for (OperatorStats os : node.windowStats) {
os.recordingId = recordingId;
}
}
}
Aggregations