@Override
  public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
    return stub.awaitTermination(duration, unit);
  }
Creates a new span.

<p>Sample code:

<pre>{@code
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
  Span request =
      Span.newBuilder()
          .setName(SpanName.of("[PROJECT]", "[TRACE]", "[SPAN]").toString())
          .setSpanId("spanId-896182779")
          .setParentSpanId("parentSpanId1059234639")
          .setDisplayName(TruncatableString.newBuilder().build())
          .setStartTime(Timestamp.newBuilder().build())
          .setEndTime(Timestamp.newBuilder().build())
          .setAttributes(Span.Attributes.newBuilder().build())
          .setStackTrace(StackTrace.newBuilder().build())
          .setTimeEvents(Span.TimeEvents.newBuilder().build())
          .setLinks(Span.Links.newBuilder().build())
          .setStatus(Status.newBuilder().build())
          .setSameProcessAsParentSpan(BoolValue.newBuilder().build())
          .setChildSpanCount(Int32Value.newBuilder().build())
          .build();
  ApiFuture<Span> future = traceServiceClient.createSpanCallable().futureCall(request);
  // Do something.
  Span response = future.get();
}
}</pre>
java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java