|
24 | 24 | import com.google.api.client.util.BackOff; |
25 | 25 | import com.google.api.client.util.ExponentialBackOff; |
26 | 26 | import com.google.api.gax.paging.Page; |
27 | | -import com.google.api.pathtemplate.PathTemplate; |
28 | 27 | import com.google.cloud.BaseService; |
29 | 28 | import com.google.cloud.PageImpl; |
30 | 29 | import com.google.cloud.PageImpl.NextPageFetcher; |
|
36 | 35 | import com.google.common.collect.Maps; |
37 | 36 | import com.google.common.util.concurrent.Futures; |
38 | 37 | import com.google.common.util.concurrent.ListenableFuture; |
39 | | -import com.google.protobuf.Any; |
40 | | -import com.google.protobuf.InvalidProtocolBufferException; |
41 | | -import com.google.protobuf.Message; |
42 | 38 | import io.grpc.Context; |
43 | 39 | import io.opencensus.common.Scope; |
44 | 40 | import io.opencensus.trace.AttributeValue; |
|
66 | 62 | class SpannerImpl extends BaseService<SpannerOptions> implements Spanner { |
67 | 63 | private static final int MIN_BACKOFF_MS = 1000; |
68 | 64 | private static final int MAX_BACKOFF_MS = 32000; |
69 | | - private static final PathTemplate OP_NAME_TEMPLATE = |
70 | | - PathTemplate.create( |
71 | | - "projects/{project}/instances/{instance}/databases/{database}/operations/{operation}"); |
72 | | - private static final PathTemplate PROJECT_NAME_TEMPLATE = |
73 | | - PathTemplate.create("projects/{project}"); |
74 | 65 |
|
75 | 66 | private static final Logger logger = Logger.getLogger(SpannerImpl.class.getName()); |
76 | 67 | private static final Tracer tracer = Tracing.getTracer(); |
@@ -343,16 +334,6 @@ Object value() { |
343 | 334 | return ImmutableMap.copyOf(tmp); |
344 | 335 | } |
345 | 336 |
|
346 | | - private static <T extends Message> T unpack(Any response, Class<T> clazz) |
347 | | - throws SpannerException { |
348 | | - try { |
349 | | - return response.unpack(clazz); |
350 | | - } catch (InvalidProtocolBufferException e) { |
351 | | - throw SpannerExceptionFactory.newSpannerException( |
352 | | - ErrorCode.INTERNAL, "Error unpacking response", e); |
353 | | - } |
354 | | - } |
355 | | - |
356 | 337 | abstract static class PageFetcher<S, T> implements NextPageFetcher<S> { |
357 | 338 | private String nextPageToken; |
358 | 339 |
|
|
0 commit comments