Skip to content
Merged
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 @@ -24,7 +24,6 @@
import com.google.api.client.util.BackOff;
import com.google.api.client.util.ExponentialBackOff;
import com.google.api.gax.paging.Page;
import com.google.api.pathtemplate.PathTemplate;
import com.google.cloud.BaseService;
import com.google.cloud.PageImpl;
import com.google.cloud.PageImpl.NextPageFetcher;
Expand All @@ -36,9 +35,6 @@
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.protobuf.Any;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import io.grpc.Context;
import io.opencensus.common.Scope;
import io.opencensus.trace.AttributeValue;
Expand Down Expand Up @@ -66,11 +62,6 @@
class SpannerImpl extends BaseService<SpannerOptions> implements Spanner {
private static final int MIN_BACKOFF_MS = 1000;
private static final int MAX_BACKOFF_MS = 32000;
private static final PathTemplate OP_NAME_TEMPLATE =
PathTemplate.create(
"projects/{project}/instances/{instance}/databases/{database}/operations/{operation}");
private static final PathTemplate PROJECT_NAME_TEMPLATE =
PathTemplate.create("projects/{project}");

private static final Logger logger = Logger.getLogger(SpannerImpl.class.getName());
private static final Tracer tracer = Tracing.getTracer();
Expand Down Expand Up @@ -343,16 +334,6 @@ Object value() {
return ImmutableMap.copyOf(tmp);
}

private static <T extends Message> T unpack(Any response, Class<T> clazz)
throws SpannerException {
try {
return response.unpack(clazz);
} catch (InvalidProtocolBufferException e) {
throw SpannerExceptionFactory.newSpannerException(
ErrorCode.INTERNAL, "Error unpacking response", e);
}
}

abstract static class PageFetcher<S, T> implements NextPageFetcher<S> {
private String nextPageToken;

Expand Down