Skip to content

Commit

Permalink
fix: adapt to introduction of java.time in gax
Browse files Browse the repository at this point in the history
  • Loading branch information
lqiu96 committed Aug 6, 2024
1 parent 35907c6 commit abc3766
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

package com.google.cloud.spanner;

import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration;

import com.google.api.core.InternalApi;
import com.google.api.gax.tracing.ApiTracer;
import com.google.api.gax.tracing.BaseApiTracer;
import com.google.api.gax.tracing.MetricsTracer;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import org.threeten.bp.Duration;

@InternalApi
public class CompositeTracer extends BaseApiTracer {
Expand Down Expand Up @@ -108,9 +109,14 @@ public void attemptCancelled() {
}

@Override
public void attemptFailed(Throwable error, Duration delay) {
public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) {
attemptFailedDuration(error, toJavaTimeDuration(delay));
}

@Override
public void attemptFailedDuration(Throwable error, java.time.Duration delay) {
for (ApiTracer child : children) {
child.attemptFailed(error, delay);
child.attemptFailedDuration(error, delay);
}
}

Expand Down

0 comments on commit abc3766

Please sign in to comment.