Commit f037035d authored by Florian Fittkau's avatar Florian Fittkau

...

parent ab0e7ff2
package explorviz.live_trace_processing.filter.reduction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
......@@ -39,15 +38,15 @@ class TracesSummarizationBuffer {
final AbstractEventRecord event = aggregatedRecords.get(i);
final AbstractEventRecord event2 = records.get(i);
final List<HostApplicationMetaDataRecord> hostMetaList1 = event
.getHostApplicationMetadataList();
final List<HostApplicationMetaDataRecord> hostMetaList2 = event2
.getHostApplicationMetadataList();
if (event instanceof AbstractBeforeEventRecord) {
final AbstractBeforeEventRecord abstractBeforeEventRecord = (AbstractBeforeEventRecord) event;
final AbstractBeforeEventRecord abstractBeforeEventRecord2 = (AbstractBeforeEventRecord) event2;
final List<HostApplicationMetaDataRecord> hostMetaList1 = event
.getHostApplicationMetadataList();
final List<HostApplicationMetaDataRecord> hostMetaList2 = event2
.getHostApplicationMetadataList();
final List<RuntimeStatisticInformation> runtimeList1 = abstractBeforeEventRecord
.getRuntimeStatisticInformationList();
final List<RuntimeStatisticInformation> runtimeList2 = abstractBeforeEventRecord2
......@@ -78,31 +77,24 @@ class TracesSummarizationBuffer {
for (final Entry<HostApplicationMetaDataRecord, RuntimeStatisticInformation> entry : toAdd
.entrySet()) {
hostMetaList1.add(entry.getKey());
final RuntimeStatisticInformation runtime2 = entry.getValue();
if (!runtime2.isInitialized()) {
runtime2.makeAccumulator(getRightObjectId(abstractBeforeEventRecord2));
if (entry.getKey() != null) {
hostMetaList1.add(entry.getKey());
final RuntimeStatisticInformation runtime2 = entry.getValue();
if (!runtime2.isInitialized()) {
runtime2.makeAccumulator(getRightObjectId(abstractBeforeEventRecord2));
}
runtimeList1.add(runtime2);
}
runtimeList1.add(runtime2);
}
} else {
final List<HostApplicationMetaDataRecord> hostMetaList1 = event
.getHostApplicationMetadataList();
final List<HostApplicationMetaDataRecord> hostMetaList2 = event2
.getHostApplicationMetadataList();
final List<HostApplicationMetaDataRecord> toAdd = new ArrayList<HostApplicationMetaDataRecord>(
2);
for (int j = 0; j < hostMetaList2.size(); j++) {
final int indexInHostList1 = indexOfHost(hostMetaList2.get(j),
hostMetaList1);
if (indexInHostList1 == -1) {
// not found, so insert later
toAdd.add(hostMetaList2.get(j));
final HostApplicationMetaDataRecord host2 = hostMetaList2.get(j);
final int indexInHostList1 = indexOfHost(host2, hostMetaList1);
if ((indexInHostList1 == -1) && (host2 != null)) {
// not found, so insert
hostMetaList1.add(host2);
}
}
hostMetaList1.addAll(toAdd);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment