@Override public void combine(byte[] data) { this.data.combine(data); }
/** * Merge a GroupData into this. For all GroupOperations present, their corresponding values will be * merged according to their respective additive operation. * * @param otherData The other GroupData to merge. */ public void combine(GroupData otherData) { metrics.entrySet().stream().forEach(e -> combine(e, otherData)); }
/** * Merges the serialized form of a GroupData into this. For all GroupOperations present, their corresponding * values will be merged according to their respective additive operation. * * @param serializedGroupData the serialized bytes of a GroupData. */ public void combine(byte[] serializedGroupData) { GroupData otherMetric = SerializerDeserializer.fromBytes(serializedGroupData); if (otherMetric == null) { log.error("Could not create a GroupData. Skipping..."); return; } combine(otherMetric); }
private void mergeInPlace(GroupDataSummary other) { if (other == null) { return; } // This check is unnecessary since all merges will have valid (or at least non empty data) from the very fact // that they were created (see update above). GroupData targetData = other.getData(); if (targetData == null) { return; } // In-place, so not copying targetData if (data == null) { data = targetData; } else { data.combine(targetData); } }