Revert Spanner DML by chingor13 · Pull Request #3761 · googleapis/google-cloud-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
class DatabaseClientImpl implements DatabaseClient {
private static final String READ_WRITE_TRANSACTION = "CloudSpanner.ReadWriteTransaction";
private static final String READ_ONLY_TRANSACTION = "CloudSpanner.ReadOnlyTransaction";
private static final String PARTITION_DML_TRANSACTION = "CloudSpanner.PartitionDMLTransaction";
private static final Tracer tracer = Tracing.getTracer();

static {
TraceUtil.exportSpans(READ_WRITE_TRANSACTION, READ_ONLY_TRANSACTION, PARTITION_DML_TRANSACTION);
TraceUtil.exportSpans(READ_WRITE_TRANSACTION, READ_ONLY_TRANSACTION);
}

private final SessionPool pool;
Expand Down Expand Up @@ -156,17 +155,6 @@ public TransactionManager transactionManager() {
}
}

@Override
public long executePartitionedUpdate(Statement stmt) {
Span span = tracer.spanBuilder(PARTITION_DML_TRANSACTION).startSpan();
try (Scope s = tracer.withSpan(span)) {
return pool.getReadWriteSession().executePartitionedUpdate(stmt);
} catch (RuntimeException e) {
TraceUtil.endSpanWithFailure(span, e);
throw e;
}
}

ListenableFuture<Void> closeAsync() {
return pool.closeAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.google.cloud.spanner;

import com.google.spanner.v1.ResultSetStats;
import javax.annotation.Nullable;

/**
* Provides access to the data returned by a Cloud Spanner read or query. {@code ResultSet} allows a
Expand Down Expand Up @@ -60,17 +59,13 @@ public interface ResultSet extends AutoCloseable, StructReader {
@Override
void close();


/**
* Returns the {@link ResultSetStats} for the query only if the query was executed in either the
* {@code PLAN} or the {@code PROFILE} mode via the {@link ReadContext#analyzeQuery(Statement,
* com.google.cloud.spanner.ReadContext.QueryAnalyzeMode)} method or for DML statements in
* {@link ReadContext#executeQuery(Statement, QueryOption)}. Attempts to call this method on
* a {@code ResultSet} not obtained from {@code analyzeQuery} or {@code executeQuery} will return
* a {@code null} {@code ResultSetStats}. This method must be called after {@link #next()} has
* returned @{code false}. Calling it before that will result in {@code null}
* {@code ResultSetStats} too.
* com.google.cloud.spanner.ReadContext.QueryAnalyzeMode)} method. Attempts to call this method on
* a {@code ResultSet} not obtained from {@code analyzeQuery} result in an {@code
* UnsupportedOperationException}. This method must be called after {@link #next()} has
* returned @{code false}. Calling it before that will result in an {@code IllegalStateException}.
*/
@Nullable
ResultSetStats getStats();
}
Loading