getTraceCallable() {
return stub.getTraceCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sends new traces to Stackdriver Trace or updates existing traces. If the ID of a trace that you
+ * send matches that of an existing trace, any fields in the existing trace and its spans are
+ * overwritten by the provided values, and any new fields provided are merged with the existing
+ * trace data. If the ID does not match, a new trace is created.
+ *
+ * @param projectId Required. ID of the Cloud project where the trace data is stored.
+ * @param traces Required. The body of the message.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void patchTraces(String projectId, Traces traces) {
+ PatchTracesRequest request =
+ PatchTracesRequest.newBuilder().setProjectId(projectId).setTraces(traces).build();
+ patchTraces(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sends new traces to Stackdriver Trace or updates existing traces. If the ID of a trace that you
+ * send matches that of an existing trace, any fields in the existing trace and its spans are
+ * overwritten by the provided values, and any new fields provided are merged with the existing
+ * trace data. If the ID does not match, a new trace is created.
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void patchTraces(PatchTracesRequest request) {
+ patchTracesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sends new traces to Stackdriver Trace or updates existing traces. If the ID of a trace that you
+ * send matches that of an existing trace, any fields in the existing trace and its spans are
+ * overwritten by the provided values, and any new fields provided are merged with the existing
+ * trace data. If the ID does not match, a new trace is created.
+ *
+ * Sample code:
+ */
+ public final UnaryCallable patchTracesCallable() {
+ return stub.patchTracesCallable();
+ }
+
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java
index 2f66b358..1f5a94f8 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v1;
import static com.google.cloud.trace.v1.TraceServiceClient.ListTracesPagedResponse;
@@ -39,7 +40,7 @@
import java.util.List;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link TraceServiceClient}.
*
@@ -54,29 +55,24 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of patchTraces to 30 seconds:
+ *
For example, to set the total timeout of getTrace to 30 seconds:
*
- *
- *
- * TraceServiceSettings.Builder traceServiceSettingsBuilder =
- * TraceServiceSettings.newBuilder();
+ * {@code
+ * TraceServiceSettings.Builder traceServiceSettingsBuilder = TraceServiceSettings.newBuilder();
* traceServiceSettingsBuilder
- * .patchTracesSettings()
+ * .getTraceSettings()
* .setRetrySettings(
- * traceServiceSettingsBuilder.patchTracesSettings().getRetrySettings().toBuilder()
+ * traceServiceSettingsBuilder
+ * .getTraceSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* TraceServiceSettings traceServiceSettings = traceServiceSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class TraceServiceSettings extends ClientSettings {
- /** Returns the object with the settings used for calls to patchTraces. */
- public UnaryCallSettings patchTracesSettings() {
- return ((TraceServiceStubSettings) getStubSettings()).patchTracesSettings();
- }
/** Returns the object with the settings used for calls to listTraces. */
public PagedCallSettings
@@ -89,6 +85,11 @@ public UnaryCallSettings getTraceSettings() {
return ((TraceServiceStubSettings) getStubSettings()).getTraceSettings();
}
+ /** Returns the object with the settings used for calls to patchTraces. */
+ public UnaryCallSettings patchTracesSettings() {
+ return ((TraceServiceStubSettings) getStubSettings()).patchTracesSettings();
+ }
+
public static final TraceServiceSettings create(TraceServiceStubSettings stub)
throws IOException {
return new TraceServiceSettings.Builder(stub.toBuilder()).build();
@@ -149,18 +150,15 @@ protected TraceServiceSettings(Builder settingsBuilder) throws IOException {
/** Builder for TraceServiceSettings. */
public static class Builder extends ClientSettings.Builder {
+
protected Builder() throws IOException {
- this((ClientContext) null);
+ this(((ClientContext) null));
}
protected Builder(ClientContext clientContext) {
super(TraceServiceStubSettings.newBuilder(clientContext));
}
- private static Builder createDefault() {
- return new Builder(TraceServiceStubSettings.newBuilder());
- }
-
protected Builder(TraceServiceSettings settings) {
super(settings.getStubSettings().toBuilder());
}
@@ -169,11 +167,15 @@ protected Builder(TraceServiceStubSettings.Builder stubSettings) {
super(stubSettings);
}
+ private static Builder createDefault() {
+ return new Builder(TraceServiceStubSettings.newBuilder());
+ }
+
public TraceServiceStubSettings.Builder getStubSettingsBuilder() {
return ((TraceServiceStubSettings.Builder) getStubSettings());
}
- // NEXT_MAJOR_VER: remove 'throws Exception'
+ // NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
@@ -186,11 +188,6 @@ public Builder applyToAllUnaryMethods(
return this;
}
- /** Returns the builder for the settings used for calls to patchTraces. */
- public UnaryCallSettings.Builder patchTracesSettings() {
- return getStubSettingsBuilder().patchTracesSettings();
- }
-
/** Returns the builder for the settings used for calls to listTraces. */
public PagedCallSettings.Builder
listTracesSettings() {
@@ -202,6 +199,11 @@ public UnaryCallSettings.Builder getTraceSettings() {
return getStubSettingsBuilder().getTraceSettings();
}
+ /** Returns the builder for the settings used for calls to patchTraces. */
+ public UnaryCallSettings.Builder patchTracesSettings() {
+ return getStubSettingsBuilder().patchTracesSettings();
+ }
+
@Override
public TraceServiceSettings build() throws IOException {
return new TraceServiceSettings(this);
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java
index e1052539..6159c654 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,11 +15,9 @@
*/
/**
- * A client to Stackdriver Trace API.
+ * The interfaces provided are listed below, along with usage samples.
*
- * The interfaces provided are listed below, along with usage samples.
- *
- *
================== TraceServiceClient ==================
+ *
======================= TraceServiceClient =======================
*
*
Service Description: This file describes an API for collecting and viewing traces and spans
* within a trace. A Trace is a collection of spans corresponding to a single operation or set of
@@ -27,18 +25,8 @@
* trace tree. Spans for a single trace may span multiple services.
*
*
Sample for TraceServiceClient:
- *
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * String projectId = "";
- * Traces traces = Traces.newBuilder().build();
- * traceServiceClient.patchTraces(projectId, traces);
- * }
- *
- *
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
package com.google.cloud.trace.v1;
import javax.annotation.Generated;
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceCallableFactory.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceCallableFactory.java
index 1272deb3..4ebce41e 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceCallableFactory.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceCallableFactory.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v1.stub;
-import com.google.api.core.BetaApi;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
@@ -31,18 +31,19 @@
import com.google.api.gax.rpc.StreamingCallSettings;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * gRPC callable factory implementation for Stackdriver Trace API.
+ * gRPC callable factory implementation for the TraceService service API.
*
* This class is for advanced usage.
*/
@Generated("by gapic-generator")
-@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public class GrpcTraceServiceCallableFactory implements GrpcStubCallableFactory {
+
@Override
public UnaryCallable createUnaryCallable(
GrpcCallSettings grpcCallSettings,
@@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla
public
UnaryCallable createPagedCallable(
GrpcCallSettings grpcCallSettings,
- PagedCallSettings pagedCallSettings,
+ PagedCallSettings callSettings,
ClientContext clientContext) {
- return GrpcCallableFactory.createPagedCallable(
- grpcCallSettings, pagedCallSettings, clientContext);
+ return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext);
}
@Override
public UnaryCallable createBatchingCallable(
GrpcCallSettings grpcCallSettings,
- BatchingCallSettings batchingCallSettings,
+ BatchingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createBatchingCallable(
- grpcCallSettings, batchingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
@Override
public
OperationCallable createOperationCallable(
- GrpcCallSettings grpcCallSettings,
- OperationCallSettings operationCallSettings,
+ GrpcCallSettings grpcCallSettings,
+ OperationCallSettings callSettings,
ClientContext clientContext,
OperationsStub operationsStub) {
return GrpcCallableFactory.createOperationCallable(
- grpcCallSettings, operationCallSettings, clientContext, operationsStub);
+ grpcCallSettings, callSettings, clientContext, operationsStub);
}
@Override
public
BidiStreamingCallable createBidiStreamingCallable(
GrpcCallSettings grpcCallSettings,
- StreamingCallSettings streamingCallSettings,
+ StreamingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createBidiStreamingCallable(
- grpcCallSettings, streamingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
@Override
public
ServerStreamingCallable createServerStreamingCallable(
GrpcCallSettings grpcCallSettings,
- ServerStreamingCallSettings streamingCallSettings,
+ ServerStreamingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createServerStreamingCallable(
- grpcCallSettings, streamingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
@Override
public
ClientStreamingCallable createClientStreamingCallable(
GrpcCallSettings grpcCallSettings,
- StreamingCallSettings streamingCallSettings,
+ StreamingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createClientStreamingCallable(
- grpcCallSettings, streamingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
}
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceStub.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceStub.java
index 31db7e18..7684cc46 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceStub.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceStub.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v1.stub;
import static com.google.cloud.trace.v1.TraceServiceClient.ListTracesPagedResponse;
-import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
@@ -31,6 +31,7 @@
import com.google.devtools.cloudtrace.v1.ListTracesResponse;
import com.google.devtools.cloudtrace.v1.PatchTracesRequest;
import com.google.devtools.cloudtrace.v1.Trace;
+import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
@@ -39,23 +40,14 @@
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * gRPC stub implementation for Stackdriver Trace API.
+ * gRPC stub implementation for the TraceService service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
-@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+@Generated("by gapic-generator-java")
public class GrpcTraceServiceStub extends TraceServiceStub {
-
- private static final MethodDescriptor patchTracesMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName("google.devtools.cloudtrace.v1.TraceService/PatchTraces")
- .setRequestMarshaller(ProtoUtils.marshaller(PatchTracesRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
- .build();
private static final MethodDescriptor
listTracesMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -64,6 +56,7 @@ public class GrpcTraceServiceStub extends TraceServiceStub {
.setRequestMarshaller(ProtoUtils.marshaller(ListTracesRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ListTracesResponse.getDefaultInstance()))
.build();
+
private static final MethodDescriptor getTraceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
@@ -72,13 +65,21 @@ public class GrpcTraceServiceStub extends TraceServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(Trace.getDefaultInstance()))
.build();
- private final BackgroundResource backgroundResources;
+ private static final MethodDescriptor patchTracesMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.devtools.cloudtrace.v1.TraceService/PatchTraces")
+ .setRequestMarshaller(ProtoUtils.marshaller(PatchTracesRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
- private final UnaryCallable patchTracesCallable;
private final UnaryCallable listTracesCallable;
private final UnaryCallable listTracesPagedCallable;
private final UnaryCallable getTraceCallable;
+ private final UnaryCallable patchTracesCallable;
+ private final BackgroundResource backgroundResources;
+ private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcTraceServiceStub create(TraceServiceStubSettings settings)
@@ -117,20 +118,8 @@ protected GrpcTraceServiceStub(
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
+ this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
- GrpcCallSettings patchTracesTransportSettings =
- GrpcCallSettings.newBuilder()
- .setMethodDescriptor(patchTracesMethodDescriptor)
- .setParamsExtractor(
- new RequestParamsExtractor() {
- @Override
- public Map extract(PatchTracesRequest request) {
- ImmutableMap.Builder params = ImmutableMap.builder();
- params.put("project_id", String.valueOf(request.getProjectId()));
- return params.build();
- }
- })
- .build();
GrpcCallSettings listTracesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listTracesMethodDescriptor)
@@ -147,11 +136,31 @@ public Map extract(ListTracesRequest request) {
GrpcCallSettings getTraceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getTraceMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(GetTraceRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("project_id", String.valueOf(request.getProjectId()));
+ params.put("trace_id", String.valueOf(request.getTraceId()));
+ return params.build();
+ }
+ })
+ .build();
+ GrpcCallSettings patchTracesTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(patchTracesMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(PatchTracesRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("project_id", String.valueOf(request.getProjectId()));
+ return params.build();
+ }
+ })
.build();
- this.patchTracesCallable =
- callableFactory.createUnaryCallable(
- patchTracesTransportSettings, settings.patchTracesSettings(), clientContext);
this.listTracesCallable =
callableFactory.createUnaryCallable(
listTracesTransportSettings, settings.listTracesSettings(), clientContext);
@@ -161,26 +170,34 @@ public Map extract(ListTracesRequest request) {
this.getTraceCallable =
callableFactory.createUnaryCallable(
getTraceTransportSettings, settings.getTraceSettings(), clientContext);
+ this.patchTracesCallable =
+ callableFactory.createUnaryCallable(
+ patchTracesTransportSettings, settings.patchTracesSettings(), clientContext);
- backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
- }
-
- public UnaryCallable patchTracesCallable() {
- return patchTracesCallable;
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
- public UnaryCallable listTracesPagedCallable() {
- return listTracesPagedCallable;
+ public GrpcOperationsStub getOperationsStub() {
+ return operationsStub;
}
public UnaryCallable listTracesCallable() {
return listTracesCallable;
}
+ public UnaryCallable listTracesPagedCallable() {
+ return listTracesPagedCallable;
+ }
+
public UnaryCallable getTraceCallable() {
return getTraceCallable;
}
+ public UnaryCallable patchTracesCallable() {
+ return patchTracesCallable;
+ }
+
@Override
public final void close() {
shutdown();
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStub.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStub.java
index 66771bf3..a32c76c0 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStub.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStub.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v1.stub;
import static com.google.cloud.trace.v1.TraceServiceClient.ListTracesPagedResponse;
-import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.devtools.cloudtrace.v1.GetTraceRequest;
@@ -28,20 +28,15 @@
import com.google.protobuf.Empty;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * Base stub class for Stackdriver Trace API.
+ * Base stub class for the TraceService service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class TraceServiceStub implements BackgroundResource {
- public UnaryCallable patchTracesCallable() {
- throw new UnsupportedOperationException("Not implemented: patchTracesCallable()");
- }
-
public UnaryCallable listTracesPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listTracesPagedCallable()");
}
@@ -54,6 +49,10 @@ public UnaryCallable getTraceCallable() {
throw new UnsupportedOperationException("Not implemented: getTraceCallable()");
}
+ public UnaryCallable patchTracesCallable() {
+ throw new UnsupportedOperationException("Not implemented: patchTracesCallable()");
+ }
+
@Override
public abstract void close();
}
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java
index d39efc73..690a9039 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v1.stub;
import static com.google.cloud.trace.v1.TraceServiceClient.ListTracesPagedResponse;
@@ -54,7 +55,7 @@
import javax.annotation.Generated;
import org.threeten.bp.Duration;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link TraceServiceStub}.
*
@@ -69,24 +70,25 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of patchTraces to 30 seconds:
+ *
For example, to set the total timeout of getTrace to 30 seconds:
*
- *
- *
+ * {@code
* TraceServiceStubSettings.Builder traceServiceSettingsBuilder =
* TraceServiceStubSettings.newBuilder();
* traceServiceSettingsBuilder
- * .patchTracesSettings()
+ * .getTraceSettings()
* .setRetrySettings(
- * traceServiceSettingsBuilder.patchTracesSettings().getRetrySettings().toBuilder()
+ * traceServiceSettingsBuilder
+ * .getTraceSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* TraceServiceStubSettings traceServiceSettings = traceServiceSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator-java")
public class TraceServiceStubSettings extends StubSettings {
/** The default scopes of the service. */
private static final ImmutableList DEFAULT_SERVICE_SCOPES =
@@ -96,15 +98,63 @@ public class TraceServiceStubSettings extends StubSettings patchTracesSettings;
private final PagedCallSettings
listTracesSettings;
private final UnaryCallSettings getTraceSettings;
+ private final UnaryCallSettings patchTracesSettings;
- /** Returns the object with the settings used for calls to patchTraces. */
- public UnaryCallSettings patchTracesSettings() {
- return patchTracesSettings;
- }
+ private static final PagedListDescriptor
+ LIST_TRACES_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListTracesRequest injectToken(ListTracesRequest payload, String token) {
+ return ListTracesRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListTracesRequest injectPageSize(ListTracesRequest payload, int pageSize) {
+ return ListTracesRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListTracesRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListTracesResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListTracesResponse payload) {
+ return payload.getTracesList() == null
+ ? ImmutableList.of()
+ : payload.getTracesList();
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ListTracesRequest, ListTracesResponse, ListTracesPagedResponse>
+ LIST_TRACES_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListTracesRequest, ListTracesResponse, ListTracesPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListTracesRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, LIST_TRACES_PAGE_STR_DESC, request, context);
+ return ListTracesPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
/** Returns the object with the settings used for calls to listTraces. */
public PagedCallSettings
@@ -117,16 +167,21 @@ public UnaryCallSettings getTraceSettings() {
return getTraceSettings;
}
+ /** Returns the object with the settings used for calls to patchTraces. */
+ public UnaryCallSettings patchTracesSettings() {
+ return patchTracesSettings;
+ }
+
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public TraceServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcTraceServiceStub.create(this);
- } else {
- throw new UnsupportedOperationException(
- "Transport not supported: " + getTransportChannelProvider().getTransportName());
}
+ throw new UnsupportedOperationException(
+ String.format(
+ "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}
/** Returns a builder for the default ExecutorProvider for this service. */
@@ -186,74 +241,19 @@ public Builder toBuilder() {
protected TraceServiceStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
- patchTracesSettings = settingsBuilder.patchTracesSettings().build();
listTracesSettings = settingsBuilder.listTracesSettings().build();
getTraceSettings = settingsBuilder.getTraceSettings().build();
+ patchTracesSettings = settingsBuilder.patchTracesSettings().build();
}
- private static final PagedListDescriptor
- LIST_TRACES_PAGE_STR_DESC =
- new PagedListDescriptor() {
- @Override
- public String emptyToken() {
- return "";
- }
-
- @Override
- public ListTracesRequest injectToken(ListTracesRequest payload, String token) {
- return ListTracesRequest.newBuilder(payload).setPageToken(token).build();
- }
-
- @Override
- public ListTracesRequest injectPageSize(ListTracesRequest payload, int pageSize) {
- return ListTracesRequest.newBuilder(payload).setPageSize(pageSize).build();
- }
-
- @Override
- public Integer extractPageSize(ListTracesRequest payload) {
- return payload.getPageSize();
- }
-
- @Override
- public String extractNextToken(ListTracesResponse payload) {
- return payload.getNextPageToken();
- }
-
- @Override
- public Iterable extractResources(ListTracesResponse payload) {
- return payload.getTracesList() != null
- ? payload.getTracesList()
- : ImmutableList.of();
- }
- };
-
- private static final PagedListResponseFactory<
- ListTracesRequest, ListTracesResponse, ListTracesPagedResponse>
- LIST_TRACES_PAGE_STR_FACT =
- new PagedListResponseFactory<
- ListTracesRequest, ListTracesResponse, ListTracesPagedResponse>() {
- @Override
- public ApiFuture getFuturePagedResponse(
- UnaryCallable callable,
- ListTracesRequest request,
- ApiCallContext context,
- ApiFuture futureResponse) {
- PageContext pageContext =
- PageContext.create(callable, LIST_TRACES_PAGE_STR_DESC, request, context);
- return ListTracesPagedResponse.createAsync(pageContext, futureResponse);
- }
- };
-
/** Builder for TraceServiceStubSettings. */
public static class Builder extends StubSettings.Builder {
private final ImmutableList> unaryMethodSettingsBuilders;
-
- private final UnaryCallSettings.Builder patchTracesSettings;
private final PagedCallSettings.Builder<
ListTracesRequest, ListTracesResponse, ListTracesPagedResponse>
listTracesSettings;
private final UnaryCallSettings.Builder getTraceSettings;
-
+ private final UnaryCallSettings.Builder patchTracesSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
@@ -261,11 +261,10 @@ public static class Builder extends StubSettings.Builder> definitions =
ImmutableMap.builder();
definitions.put(
- "retry_policy_1_codes",
+ "retry_policy_0_codes",
ImmutableSet.copyOf(
Lists.newArrayList(
StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
- definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
@@ -284,74 +283,70 @@ public static class Builder extends StubSettings.Builder>of(
- patchTracesSettings, listTracesSettings, getTraceSettings);
-
+ listTracesSettings, getTraceSettings, patchTracesSettings);
initDefaults(this);
}
+ protected Builder(TraceServiceStubSettings settings) {
+ super(settings);
+
+ listTracesSettings = settings.listTracesSettings.toBuilder();
+ getTraceSettings = settings.getTraceSettings.toBuilder();
+ patchTracesSettings = settings.patchTracesSettings.toBuilder();
+
+ unaryMethodSettingsBuilders =
+ ImmutableList.>of(
+ listTracesSettings, getTraceSettings, patchTracesSettings);
+ }
+
private static Builder createDefault() {
- Builder builder = new Builder((ClientContext) null);
+ Builder builder = new Builder(((ClientContext) null));
+
builder.setTransportChannelProvider(defaultTransportChannelProvider());
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
builder.setEndpoint(getDefaultEndpoint());
+
return initDefaults(builder);
}
private static Builder initDefaults(Builder builder) {
-
- builder
- .patchTracesSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
- .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
-
builder
.listTracesSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
- .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getTraceSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
- .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
-
- return builder;
- }
-
- protected Builder(TraceServiceStubSettings settings) {
- super(settings);
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
- patchTracesSettings = settings.patchTracesSettings.toBuilder();
- listTracesSettings = settings.listTracesSettings.toBuilder();
- getTraceSettings = settings.getTraceSettings.toBuilder();
+ builder
+ .patchTracesSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
- unaryMethodSettingsBuilders =
- ImmutableList.>of(
- patchTracesSettings, listTracesSettings, getTraceSettings);
+ return builder;
}
- // NEXT_MAJOR_VER: remove 'throws Exception'
+ // NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
@@ -367,11 +362,6 @@ public Builder applyToAllUnaryMethods(
return unaryMethodSettingsBuilders;
}
- /** Returns the builder for the settings used for calls to patchTraces. */
- public UnaryCallSettings.Builder patchTracesSettings() {
- return patchTracesSettings;
- }
-
/** Returns the builder for the settings used for calls to listTraces. */
public PagedCallSettings.Builder
listTracesSettings() {
@@ -383,6 +373,11 @@ public UnaryCallSettings.Builder getTraceSettings() {
return getTraceSettings;
}
+ /** Returns the builder for the settings used for calls to patchTraces. */
+ public UnaryCallSettings.Builder patchTracesSettings() {
+ return patchTracesSettings;
+ }
+
@Override
public TraceServiceStubSettings build() throws IOException {
return new TraceServiceStubSettings(this);
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java
index ae8a9d29..f4b8619c 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v2;
import com.google.api.core.BetaApi;
@@ -29,7 +30,7 @@
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND SERVICE
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Service Description: This file describes an API for collecting and viewing traces and spans
* within a trace. A Trace is a collection of spans corresponding to a single operation or set of
@@ -39,17 +40,7 @@
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * List<Span> spans = new ArrayList<>();
- * traceServiceClient.batchWriteSpans(name, spans);
- * }
- *
- *
- *
- * Note: close() needs to be called on the traceServiceClient object to clean up resources such
+ *
Note: close() needs to be called on the TraceServiceClient object to clean up resources such
* as threads. In the example above, try-with-resources is used, which automatically calls close().
*
*
The surface of this class includes several types of Java methods for each of the API's
@@ -77,30 +68,26 @@
*
*
To customize credentials:
*
- *
- *
+ * {@code
* TraceServiceSettings traceServiceSettings =
* TraceServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * TraceServiceClient traceServiceClient =
- * TraceServiceClient.create(traceServiceSettings);
- *
- *
+ * TraceServiceClient traceServiceClient = TraceServiceClient.create(traceServiceSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint:
*
- *
- *
+ * {@code
* TraceServiceSettings traceServiceSettings =
* TraceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * TraceServiceClient traceServiceClient =
- * TraceServiceClient.create(traceServiceSettings);
- *
- *
+ * TraceServiceClient traceServiceClient = TraceServiceClient.create(traceServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator")
public class TraceServiceClient implements BackgroundResource {
private final TraceServiceSettings settings;
private final TraceServiceStub stub;
@@ -120,7 +107,7 @@ public static final TraceServiceClient create(TraceServiceSettings settings) thr
/**
* Constructs an instance of TraceServiceClient, using the given stub for making calls. This is
- * for advanced usage - prefer to use TraceServiceSettings}.
+ * for advanced usage - prefer using create(TraceServiceSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final TraceServiceClient create(TraceServiceStub stub) {
@@ -152,81 +139,10 @@ public TraceServiceStub getStub() {
return stub;
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new span.
- *
- *
Sample code:
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * SpanName name = SpanName.of("[PROJECT]", "[TRACE]", "[SPAN]");
- * String spanId = "";
- * TruncatableString displayName = TruncatableString.newBuilder().build();
- * Timestamp startTime = Timestamp.newBuilder().build();
- * Timestamp endTime = Timestamp.newBuilder().build();
- * Span request = Span.newBuilder()
- * .setName(name.toString())
- * .setSpanId(spanId)
- * .setDisplayName(displayName)
- * .setStartTime(startTime)
- * .setEndTime(endTime)
- * .build();
- * Span response = traceServiceClient.createSpan(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Span createSpan(Span request) {
- return createSpanCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new span.
- *
- * Sample code:
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * SpanName name = SpanName.of("[PROJECT]", "[TRACE]", "[SPAN]");
- * String spanId = "";
- * TruncatableString displayName = TruncatableString.newBuilder().build();
- * Timestamp startTime = Timestamp.newBuilder().build();
- * Timestamp endTime = Timestamp.newBuilder().build();
- * Span request = Span.newBuilder()
- * .setName(name.toString())
- * .setSpanId(spanId)
- * .setDisplayName(displayName)
- * .setStartTime(startTime)
- * .setEndTime(endTime)
- * .build();
- * ApiFuture<Span> future = traceServiceClient.createSpanCallable().futureCall(request);
- * // Do something
- * Span response = future.get();
- * }
- *
- */
- public final UnaryCallable createSpanCallable() {
- return stub.createSpanCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sends new spans to new or existing traces. You cannot update existing spans.
*
- * Sample code:
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * List<Span> spans = new ArrayList<>();
- * traceServiceClient.batchWriteSpans(name, spans);
- * }
- *
- *
* @param name Required. The name of the project where the spans belong. The format is
* `projects/[PROJECT_ID]`.
* @param spans Required. A list of new spans. The span names must not match existing spans, or
@@ -242,20 +158,10 @@ public final void batchWriteSpans(ProjectName name, List spans) {
batchWriteSpans(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sends new spans to new or existing traces. You cannot update existing spans.
*
- * Sample code:
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * List<Span> spans = new ArrayList<>();
- * traceServiceClient.batchWriteSpans(name.toString(), spans);
- * }
- *
- *
* @param name Required. The name of the project where the spans belong. The format is
* `projects/[PROJECT_ID]`.
* @param spans Required. A list of new spans. The span names must not match existing spans, or
@@ -268,24 +174,10 @@ public final void batchWriteSpans(String name, List spans) {
batchWriteSpans(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sends new spans to new or existing traces. You cannot update existing spans.
*
- * Sample code:
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * List<Span> spans = new ArrayList<>();
- * BatchWriteSpansRequest request = BatchWriteSpansRequest.newBuilder()
- * .setName(name.toString())
- * .addAllSpans(spans)
- * .build();
- * traceServiceClient.batchWriteSpans(request);
- * }
- *
- *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -293,30 +185,37 @@ public final void batchWriteSpans(BatchWriteSpansRequest request) {
batchWriteSpansCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sends new spans to new or existing traces. You cannot update existing spans.
*
* Sample code:
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * List<Span> spans = new ArrayList<>();
- * BatchWriteSpansRequest request = BatchWriteSpansRequest.newBuilder()
- * .setName(name.toString())
- * .addAllSpans(spans)
- * .build();
- * ApiFuture<Void> future = traceServiceClient.batchWriteSpansCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallable batchWriteSpansCallable() {
return stub.batchWriteSpansCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new span.
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Span createSpan(Span request) {
+ return createSpanCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new span.
+ *
+ * Sample code:
+ */
+ public final UnaryCallable createSpanCallable() {
+ return stub.createSpanCallable();
+ }
+
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java
index f949907b..7df61c55 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v2;
import com.google.api.core.ApiFunction;
@@ -33,7 +34,7 @@
import java.util.List;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link TraceServiceClient}.
*
@@ -50,33 +51,33 @@
*
* For example, to set the total timeout of batchWriteSpans to 30 seconds:
*
- *
- *
- * TraceServiceSettings.Builder traceServiceSettingsBuilder =
- * TraceServiceSettings.newBuilder();
+ * {@code
+ * TraceServiceSettings.Builder traceServiceSettingsBuilder = TraceServiceSettings.newBuilder();
* traceServiceSettingsBuilder
* .batchWriteSpansSettings()
* .setRetrySettings(
- * traceServiceSettingsBuilder.batchWriteSpansSettings().getRetrySettings().toBuilder()
+ * traceServiceSettingsBuilder
+ * .batchWriteSpansSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* TraceServiceSettings traceServiceSettings = traceServiceSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class TraceServiceSettings extends ClientSettings {
- /** Returns the object with the settings used for calls to createSpan. */
- public UnaryCallSettings createSpanSettings() {
- return ((TraceServiceStubSettings) getStubSettings()).createSpanSettings();
- }
/** Returns the object with the settings used for calls to batchWriteSpans. */
public UnaryCallSettings batchWriteSpansSettings() {
return ((TraceServiceStubSettings) getStubSettings()).batchWriteSpansSettings();
}
+ /** Returns the object with the settings used for calls to createSpan. */
+ public UnaryCallSettings createSpanSettings() {
+ return ((TraceServiceStubSettings) getStubSettings()).createSpanSettings();
+ }
+
public static final TraceServiceSettings create(TraceServiceStubSettings stub)
throws IOException {
return new TraceServiceSettings.Builder(stub.toBuilder()).build();
@@ -137,18 +138,15 @@ protected TraceServiceSettings(Builder settingsBuilder) throws IOException {
/** Builder for TraceServiceSettings. */
public static class Builder extends ClientSettings.Builder {
+
protected Builder() throws IOException {
- this((ClientContext) null);
+ this(((ClientContext) null));
}
protected Builder(ClientContext clientContext) {
super(TraceServiceStubSettings.newBuilder(clientContext));
}
- private static Builder createDefault() {
- return new Builder(TraceServiceStubSettings.newBuilder());
- }
-
protected Builder(TraceServiceSettings settings) {
super(settings.getStubSettings().toBuilder());
}
@@ -157,11 +155,15 @@ protected Builder(TraceServiceStubSettings.Builder stubSettings) {
super(stubSettings);
}
+ private static Builder createDefault() {
+ return new Builder(TraceServiceStubSettings.newBuilder());
+ }
+
public TraceServiceStubSettings.Builder getStubSettingsBuilder() {
return ((TraceServiceStubSettings.Builder) getStubSettings());
}
- // NEXT_MAJOR_VER: remove 'throws Exception'
+ // NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
@@ -174,16 +176,16 @@ public Builder applyToAllUnaryMethods(
return this;
}
- /** Returns the builder for the settings used for calls to createSpan. */
- public UnaryCallSettings.Builder createSpanSettings() {
- return getStubSettingsBuilder().createSpanSettings();
- }
-
/** Returns the builder for the settings used for calls to batchWriteSpans. */
public UnaryCallSettings.Builder batchWriteSpansSettings() {
return getStubSettingsBuilder().batchWriteSpansSettings();
}
+ /** Returns the builder for the settings used for calls to createSpan. */
+ public UnaryCallSettings.Builder createSpanSettings() {
+ return getStubSettingsBuilder().createSpanSettings();
+ }
+
@Override
public TraceServiceSettings build() throws IOException {
return new TraceServiceSettings(this);
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java
index 807c7523..0923a0ea 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,11 +15,9 @@
*/
/**
- * A client to Stackdriver Trace API.
+ * The interfaces provided are listed below, along with usage samples.
*
- * The interfaces provided are listed below, along with usage samples.
- *
- *
================== TraceServiceClient ==================
+ *
======================= TraceServiceClient =======================
*
*
Service Description: This file describes an API for collecting and viewing traces and spans
* within a trace. A Trace is a collection of spans corresponding to a single operation or set of
@@ -27,18 +25,8 @@
* trace tree. A single trace may contain span(s) from multiple services.
*
*
Sample for TraceServiceClient:
- *
- *
- *
- * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * List<Span> spans = new ArrayList<>();
- * traceServiceClient.batchWriteSpans(name, spans);
- * }
- *
- *
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
package com.google.cloud.trace.v2;
import javax.annotation.Generated;
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceCallableFactory.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceCallableFactory.java
index 02c9eb60..6ad3ec38 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceCallableFactory.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceCallableFactory.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v2.stub;
-import com.google.api.core.BetaApi;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
@@ -31,18 +31,19 @@
import com.google.api.gax.rpc.StreamingCallSettings;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * gRPC callable factory implementation for Stackdriver Trace API.
+ * gRPC callable factory implementation for the TraceService service API.
*
* This class is for advanced usage.
*/
@Generated("by gapic-generator")
-@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public class GrpcTraceServiceCallableFactory implements GrpcStubCallableFactory {
+
@Override
public UnaryCallable createUnaryCallable(
GrpcCallSettings grpcCallSettings,
@@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla
public
UnaryCallable createPagedCallable(
GrpcCallSettings grpcCallSettings,
- PagedCallSettings pagedCallSettings,
+ PagedCallSettings callSettings,
ClientContext clientContext) {
- return GrpcCallableFactory.createPagedCallable(
- grpcCallSettings, pagedCallSettings, clientContext);
+ return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext);
}
@Override
public UnaryCallable createBatchingCallable(
GrpcCallSettings grpcCallSettings,
- BatchingCallSettings batchingCallSettings,
+ BatchingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createBatchingCallable(
- grpcCallSettings, batchingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
@Override
public
OperationCallable createOperationCallable(
- GrpcCallSettings grpcCallSettings,
- OperationCallSettings operationCallSettings,
+ GrpcCallSettings grpcCallSettings,
+ OperationCallSettings callSettings,
ClientContext clientContext,
OperationsStub operationsStub) {
return GrpcCallableFactory.createOperationCallable(
- grpcCallSettings, operationCallSettings, clientContext, operationsStub);
+ grpcCallSettings, callSettings, clientContext, operationsStub);
}
@Override
public
BidiStreamingCallable createBidiStreamingCallable(
GrpcCallSettings grpcCallSettings,
- StreamingCallSettings streamingCallSettings,
+ StreamingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createBidiStreamingCallable(
- grpcCallSettings, streamingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
@Override
public
ServerStreamingCallable createServerStreamingCallable(
GrpcCallSettings grpcCallSettings,
- ServerStreamingCallSettings streamingCallSettings,
+ ServerStreamingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createServerStreamingCallable(
- grpcCallSettings, streamingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
@Override
public
ClientStreamingCallable createClientStreamingCallable(
GrpcCallSettings grpcCallSettings,
- StreamingCallSettings streamingCallSettings,
+ StreamingCallSettings callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createClientStreamingCallable(
- grpcCallSettings, streamingCallSettings, clientContext);
+ grpcCallSettings, callSettings, clientContext);
}
}
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceStub.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceStub.java
index 64a0de99..e08a3ae4 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceStub.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/GrpcTraceServiceStub.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v2.stub;
-import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
@@ -26,6 +26,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.devtools.cloudtrace.v2.BatchWriteSpansRequest;
import com.google.devtools.cloudtrace.v2.Span;
+import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
@@ -34,23 +35,14 @@
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * gRPC stub implementation for Stackdriver Trace API.
+ * gRPC stub implementation for the TraceService service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
-@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+@Generated("by gapic-generator-java")
public class GrpcTraceServiceStub extends TraceServiceStub {
-
- private static final MethodDescriptor createSpanMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName("google.devtools.cloudtrace.v2.TraceService/CreateSpan")
- .setRequestMarshaller(ProtoUtils.marshaller(Span.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Span.getDefaultInstance()))
- .build();
private static final MethodDescriptor
batchWriteSpansMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -61,11 +53,19 @@ public class GrpcTraceServiceStub extends TraceServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
- private final BackgroundResource backgroundResources;
+ private static final MethodDescriptor createSpanMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.devtools.cloudtrace.v2.TraceService/CreateSpan")
+ .setRequestMarshaller(ProtoUtils.marshaller(Span.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Span.getDefaultInstance()))
+ .build();
- private final UnaryCallable createSpanCallable;
private final UnaryCallable batchWriteSpansCallable;
+ private final UnaryCallable createSpanCallable;
+ private final BackgroundResource backgroundResources;
+ private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcTraceServiceStub create(TraceServiceStubSettings settings)
@@ -104,27 +104,28 @@ protected GrpcTraceServiceStub(
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
+ this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
- GrpcCallSettings createSpanTransportSettings =
- GrpcCallSettings.newBuilder()
- .setMethodDescriptor(createSpanMethodDescriptor)
+ GrpcCallSettings batchWriteSpansTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(batchWriteSpansMethodDescriptor)
.setParamsExtractor(
- new RequestParamsExtractor() {
+ new RequestParamsExtractor() {
@Override
- public Map extract(Span request) {
+ public Map extract(BatchWriteSpansRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
- GrpcCallSettings batchWriteSpansTransportSettings =
- GrpcCallSettings.newBuilder()
- .setMethodDescriptor(batchWriteSpansMethodDescriptor)
+ GrpcCallSettings createSpanTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(createSpanMethodDescriptor)
.setParamsExtractor(
- new RequestParamsExtractor() {
+ new RequestParamsExtractor() {
@Override
- public Map extract(BatchWriteSpansRequest request) {
+ public Map extract(Span request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
@@ -132,24 +133,29 @@ public Map extract(BatchWriteSpansRequest request) {
})
.build();
- this.createSpanCallable =
- callableFactory.createUnaryCallable(
- createSpanTransportSettings, settings.createSpanSettings(), clientContext);
this.batchWriteSpansCallable =
callableFactory.createUnaryCallable(
batchWriteSpansTransportSettings, settings.batchWriteSpansSettings(), clientContext);
+ this.createSpanCallable =
+ callableFactory.createUnaryCallable(
+ createSpanTransportSettings, settings.createSpanSettings(), clientContext);
- backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
- public UnaryCallable createSpanCallable() {
- return createSpanCallable;
+ public GrpcOperationsStub getOperationsStub() {
+ return operationsStub;
}
public UnaryCallable batchWriteSpansCallable() {
return batchWriteSpansCallable;
}
+ public UnaryCallable createSpanCallable() {
+ return createSpanCallable;
+ }
+
@Override
public final void close() {
shutdown();
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStub.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStub.java
index 9291b84f..64a1f059 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStub.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStub.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v2.stub;
-import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.devtools.cloudtrace.v2.BatchWriteSpansRequest;
@@ -23,24 +23,23 @@
import com.google.protobuf.Empty;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * Base stub class for Stackdriver Trace API.
+ * Base stub class for the TraceService service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class TraceServiceStub implements BackgroundResource {
- public UnaryCallable createSpanCallable() {
- throw new UnsupportedOperationException("Not implemented: createSpanCallable()");
- }
-
public UnaryCallable batchWriteSpansCallable() {
throw new UnsupportedOperationException("Not implemented: batchWriteSpansCallable()");
}
+ public UnaryCallable createSpanCallable() {
+ throw new UnsupportedOperationException("Not implemented: createSpanCallable()");
+ }
+
@Override
public abstract void close();
}
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java
index d34a527f..fc6acefd 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.trace.v2.stub;
import com.google.api.core.ApiFunction;
@@ -42,7 +43,7 @@
import javax.annotation.Generated;
import org.threeten.bp.Duration;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link TraceServiceStub}.
*
@@ -59,22 +60,23 @@
*
* For example, to set the total timeout of batchWriteSpans to 30 seconds:
*
- *
- *
+ * {@code
* TraceServiceStubSettings.Builder traceServiceSettingsBuilder =
* TraceServiceStubSettings.newBuilder();
* traceServiceSettingsBuilder
* .batchWriteSpansSettings()
* .setRetrySettings(
- * traceServiceSettingsBuilder.batchWriteSpansSettings().getRetrySettings().toBuilder()
+ * traceServiceSettingsBuilder
+ * .batchWriteSpansSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* TraceServiceStubSettings traceServiceSettings = traceServiceSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator-java")
public class TraceServiceStubSettings extends StubSettings {
/** The default scopes of the service. */
private static final ImmutableList DEFAULT_SERVICE_SCOPES =
@@ -83,29 +85,29 @@ public class TraceServiceStubSettings extends StubSettings createSpanSettings;
private final UnaryCallSettings batchWriteSpansSettings;
-
- /** Returns the object with the settings used for calls to createSpan. */
- public UnaryCallSettings createSpanSettings() {
- return createSpanSettings;
- }
+ private final UnaryCallSettings createSpanSettings;
/** Returns the object with the settings used for calls to batchWriteSpans. */
public UnaryCallSettings batchWriteSpansSettings() {
return batchWriteSpansSettings;
}
+ /** Returns the object with the settings used for calls to createSpan. */
+ public UnaryCallSettings createSpanSettings() {
+ return createSpanSettings;
+ }
+
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public TraceServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcTraceServiceStub.create(this);
- } else {
- throw new UnsupportedOperationException(
- "Transport not supported: " + getTransportChannelProvider().getTransportName());
}
+ throw new UnsupportedOperationException(
+ String.format(
+ "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}
/** Returns a builder for the default ExecutorProvider for this service. */
@@ -165,31 +167,28 @@ public Builder toBuilder() {
protected TraceServiceStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
- createSpanSettings = settingsBuilder.createSpanSettings().build();
batchWriteSpansSettings = settingsBuilder.batchWriteSpansSettings().build();
+ createSpanSettings = settingsBuilder.createSpanSettings().build();
}
/** Builder for TraceServiceStubSettings. */
public static class Builder extends StubSettings.Builder {
private final ImmutableList> unaryMethodSettingsBuilders;
-
- private final UnaryCallSettings.Builder createSpanSettings;
private final UnaryCallSettings.Builder batchWriteSpansSettings;
-
+ private final UnaryCallSettings.Builder createSpanSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
static {
ImmutableMap.Builder> definitions =
ImmutableMap.builder();
+ definitions.put(
+ "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList()));
definitions.put(
"retry_policy_1_codes",
ImmutableSet.copyOf(
Lists.