Skip to content

Commit

Permalink
Removed setSpan method
Browse files Browse the repository at this point in the history
  • Loading branch information
surbhigarg92 committed Oct 18, 2023
1 parent 4b6d22a commit d7cf07f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 28 deletions.
6 changes: 6 additions & 0 deletions google-cloud-spanner/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -455,4 +455,10 @@
<className>com/google/cloud/spanner/spi/v1/SpannerRpc</className>
<method>java.util.Set getExecuteQueryRetryableCodes()</method>
</difference>
<difference>
<differenceType>7005</differenceType>
<className>com/google/cloud/spanner/PartitionedDmlTransaction</className>
<method>void setSpan(io.opencensus.trace.Span)</method>
<to>void setSpan(com.google.cloud.spanner.ISpan)</to>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import com.google.spanner.v1.Transaction;
import com.google.spanner.v1.TransactionOptions;
import com.google.spanner.v1.TransactionSelector;
import io.opencensus.trace.Span;
import io.opencensus.trace.Tracing;
import io.opentelemetry.context.Context;
import java.util.Map;
Expand Down Expand Up @@ -434,10 +433,6 @@ public void setSpan(ISpan span) {
this.span = span;
}

/** No-op method needed to implement SessionTransaction interface. */
@Override
public void setSpan(Span span) {}

long getSeqNo() {
return seqNo.incrementAndGet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.MoreExecutors;
import io.opencensus.trace.Span;

/** Implementation of {@link AsyncTransactionManager}. */
final class AsyncTransactionManagerImpl
Expand All @@ -53,10 +52,6 @@ public void setSpan(ISpan span) {
this.span = span;
}

/** No-op method needed to implement SessionTransaction interface. */
@Override
public void setSpan(Span span) {}

@Override
public void close() {
closeAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.common.base.Preconditions.checkState;

import com.google.api.core.InternalApi;
import com.google.api.gax.grpc.GrpcStatusCode;
import com.google.api.gax.rpc.AbortedException;
import com.google.api.gax.rpc.DeadlineExceededException;
Expand All @@ -38,14 +39,14 @@
import com.google.spanner.v1.TransactionOptions;
import com.google.spanner.v1.TransactionSelector;
import io.grpc.Status;
import io.opencensus.trace.Span;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.threeten.bp.Duration;
import org.threeten.bp.temporal.ChronoUnit;

@InternalApi
public class PartitionedDmlTransaction implements SessionImpl.SessionTransaction {

private static final Logger LOGGER = Logger.getLogger(PartitionedDmlTransaction.class.getName());
Expand Down Expand Up @@ -141,10 +142,6 @@ public void invalidate() {
@Override
public void setSpan(ISpan span) {}

/** No-op method needed to implement SessionTransaction interface. */
@Override
public void setSpan(Span span) {}

private Duration tryUpdateTimeout(final Duration timeout, final Stopwatch stopwatch) {
final Duration remainingTimeout =
timeout.minus(stopwatch.elapsed(TimeUnit.MILLISECONDS), ChronoUnit.MILLIS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.google.spanner.v1.RequestOptions;
import com.google.spanner.v1.Transaction;
import com.google.spanner.v1.TransactionOptions;
import io.opencensus.trace.Span;
import io.opencensus.trace.Tracing;
import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -86,8 +85,6 @@ interface SessionTransaction {
/** Invalidates the transaction, generally because a new one has been started on the session. */
void invalidate();
/** Registers the current span on the transaction. */
void setSpan(Span span);
/** Registers the current span on the transaction. */
void setSpan(ISpan span);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.cloud.spanner.Options.TransactionOption;
import com.google.cloud.spanner.SessionImpl.SessionTransaction;
import com.google.common.base.Preconditions;
import io.opencensus.trace.Span;
import io.opencensus.trace.Tracing;

/** Implementation of {@link TransactionManager}. */
Expand Down Expand Up @@ -49,10 +48,6 @@ public void setSpan(ISpan span) {
this.span = span;
}

/** No-op method needed to implement SessionTransaction interface. */
@Override
public void setSpan(Span span) {}

@Override
public TransactionContext begin() {
Preconditions.checkState(txn == null, "begin can only be called once");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import com.google.spanner.v1.Transaction;
import com.google.spanner.v1.TransactionOptions;
import com.google.spanner.v1.TransactionSelector;
import io.opencensus.trace.Span;
import io.opencensus.trace.Tracing;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -941,10 +940,6 @@ public void setSpan(ISpan span) {
this.span = span;
}

/** No-op method needed to implement SessionTransaction interface. */
@Override
public void setSpan(Span span) {}

@Nullable
@Override
public <T> T run(TransactionCallable<T> callable) {
Expand Down

0 comments on commit d7cf07f

Please sign in to comment.