public static List<Long> decodeDurationHistogram(Value value) { try { return decodeDurationHistogram(EdgeData.EdgeValue.parseFrom(value.get()).getDurationList()); } catch (InvalidProtocolBufferException e) { // Probably an old edge value return decodeDurationHistogram(getVarLongList(value.get())); } }
private void combineHistogram(STATS_TYPE statsType, EdgeValueBuilder builder, List<Long> combinedList, EdgeData.EdgeValue protoEdgeValue) { if (STATS_TYPE.ACTIVITY == statsType) { List<Long> sourceList = EdgeValueHelper.decodeActivityHistogram(protoEdgeValue.getHoursList()); EdgeValueHelper.combineHistogram(sourceList, combinedList); builder.setHours(combinedList); } else if (STATS_TYPE.DURATION == statsType) { List<Long> sourceList = EdgeValueHelper.decodeDurationHistogram(protoEdgeValue.getDurationList()); EdgeValueHelper.combineHistogram(sourceList, combinedList); builder.setDuration(combinedList); } }
private void combineHistogramFromLegacyValue(STATS_TYPE statsType, EdgeValueBuilder builder, List<Long> combinedList, Value value) { if (STATS_TYPE.ACTIVITY == statsType) { List<Long> sourceList = EdgeValueHelper.decodeActivityHistogram(EdgeValueHelper.getVarLongList(value.get())); EdgeValueHelper.combineHistogram(sourceList, combinedList); builder.setHours(combinedList); } else if (STATS_TYPE.DURATION == statsType) { List<Long> sourceList = EdgeValueHelper.decodeDurationHistogram(EdgeValueHelper.getVarLongList(value.get())); EdgeValueHelper.combineHistogram(sourceList, combinedList); builder.setDuration(combinedList); } }
break; case DURATION: edge.setCounts(EdgeValueHelper.decodeDurationHistogram(value)); break; case LINKS: