Skip to content

Commit

Permalink
Assume validated
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuraag Agrawal committed Oct 6, 2021
1 parent 25a8c5e commit 97a91b9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
package io.opentelemetry.exporter.otlp.internal.grpc;

import static io.grpc.Metadata.ASCII_STRING_MARSHALLER;
import static io.opentelemetry.api.internal.Utils.checkArgument;
import static java.util.Objects.requireNonNull;

import io.grpc.Codec;
import io.grpc.ManagedChannel;
Expand Down Expand Up @@ -62,22 +60,17 @@ public DefaultGrpcExporterBuilder<T> setChannel(ManagedChannel channel) {

@Override
public DefaultGrpcExporterBuilder<T> setTimeout(long timeout, TimeUnit unit) {
requireNonNull(unit, "unit");
checkArgument(timeout >= 0, "timeout must be non-negative");
timeoutNanos = unit.toNanos(timeout);
return this;
}

@Override
public DefaultGrpcExporterBuilder<T> setTimeout(Duration timeout) {
requireNonNull(timeout, "timeout");
return setTimeout(timeout.toNanos(), TimeUnit.NANOSECONDS);
}

@Override
public DefaultGrpcExporterBuilder<T> setEndpoint(String endpoint) {
requireNonNull(endpoint, "endpoint");

URI uri;
try {
uri = new URI(endpoint);
Expand All @@ -97,10 +90,6 @@ public DefaultGrpcExporterBuilder<T> setEndpoint(String endpoint) {

@Override
public DefaultGrpcExporterBuilder<T> setCompression(String compressionMethod) {
requireNonNull(compressionMethod, "compressionMethod");
checkArgument(
compressionMethod.equals("gzip") || compressionMethod.equals("none"),
"Unsupported compression method. Supported compression methods include: gzip, none.");
this.compressionEnabled = true;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

package io.opentelemetry.exporter.otlp.internal.grpc;

import static io.opentelemetry.api.internal.Utils.checkArgument;
import static java.util.Objects.requireNonNull;

import io.grpc.ManagedChannel;
import io.opentelemetry.exporter.otlp.internal.Marshaler;
import io.opentelemetry.exporter.otlp.internal.TlsUtil;
Expand Down Expand Up @@ -58,22 +55,17 @@ public OkHttpGrpcExporterBuilder<T> setChannel(ManagedChannel channel) {

@Override
public OkHttpGrpcExporterBuilder<T> setTimeout(long timeout, TimeUnit unit) {
requireNonNull(unit, "unit");
checkArgument(timeout >= 0, "timeout must be non-negative");
timeoutNanos = unit.toNanos(timeout);
return this;
}

@Override
public OkHttpGrpcExporterBuilder<T> setTimeout(Duration timeout) {
requireNonNull(timeout, "timeout");
return setTimeout(timeout.toNanos(), TimeUnit.NANOSECONDS);
}

@Override
public OkHttpGrpcExporterBuilder<T> setEndpoint(String endpoint) {
requireNonNull(endpoint, "endpoint");

URI uri;
try {
uri = new URI(endpoint);
Expand All @@ -93,10 +85,6 @@ public OkHttpGrpcExporterBuilder<T> setEndpoint(String endpoint) {

@Override
public OkHttpGrpcExporterBuilder<T> setCompression(String compressionMethod) {
requireNonNull(compressionMethod, "compressionMethod");
checkArgument(
compressionMethod.equals("gzip") || compressionMethod.equals("none"),
"Unsupported compression method. Supported compression methods include: gzip, none.");
this.compressionEnabled = true;
return this;
}
Expand Down

0 comments on commit 97a91b9

Please sign in to comment.