builder.setDuration(durationList);
public Value getDurationAsValue(boolean forwardEdge) { EdgeValueBuilder builder = datawave.edge.util.EdgeValue.newBuilder(); List<Long> duration = EdgeValueHelper.getLongListForDuration(this.getDuration(), this.isDeleting()); builder.setDuration(duration); if (forwardEdge == true) { builder.setSourceValue(source.getValue(ValueType.EVENT)); } else { builder.setSourceValue(sink.getValue(ValueType.EVENT)); } builder.setLoadDate(loadDate); builder.setUuid(uuid); return builder.build().encode(); }
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); } }
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); } }