Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Naireen committed Nov 14, 2024
1 parent 24ce41c commit 37ffd60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static ByteString encodeInt64Histogram(HistogramData inputHistogram) {

return ByteString.copyFromUtf8(jsonString);
} catch (Exception e) {
throw new RuntimeException(e);
throw new RuntimeException("Unable to parse histogram, error in encoding");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
*/
package org.apache.beam.sdk.util;

import com.google.api.services.dataflow.model.DataflowHistogramValue;
import com.google.auto.value.AutoValue;
import com.google.auto.value.extension.memoized.Memoized;
import java.io.Serializable;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.Objects;
import javax.annotation.concurrent.GuardedBy;
import org.apache.beam.sdk.annotations.Internal;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.math.DoubleMath;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.math.IntMath;
import org.checkerframework.checker.nullness.qual.Nullable;
Expand Down Expand Up @@ -79,8 +82,7 @@ public HistogramData(BucketType bucketType) {
*
* @param histogramProto DataflowHistogramValue proto used to populate stats for the histogram.
*/
public HistogramData(
com.google.api.services.dataflow.model.DataflowHistogramValue histogramProto) {
public HistogramData(DataflowHistogramValue histogramProto) {
int numBuckets;
if (histogramProto.getBucketOptions().getLinear() != null) {
double start = histogramProto.getBucketOptions().getLinear().getStart();
Expand Down Expand Up @@ -613,8 +615,10 @@ public double getRangeTo() {
// Note: equals() and hashCode() are implemented by the AutoValue.
}

// Used for testing unsupported Bucket formats
/** Used for testing unsupported Bucket formats. */
@AutoValue
@Internal
@VisibleForTesting
public abstract static class UnsupportedBuckets implements BucketType {

public static UnsupportedBuckets of() {
Expand Down

0 comments on commit 37ffd60

Please sign in to comment.