|
41 | 41 | import com.google.longrunning.Operation; |
42 | 42 | import com.google.protobuf.Empty; |
43 | 43 | import io.grpc.MethodDescriptor; |
44 | | -import io.grpc.MethodDescriptor.Marshaller; |
45 | | -import io.grpc.MethodDescriptor.MethodType; |
46 | 44 | import java.io.IOException; |
47 | 45 | import java.io.InputStream; |
48 | 46 | import java.time.Duration; |
@@ -142,37 +140,13 @@ private AwaitConsistencyCallable createAwaitConsistencyCallable( |
142 | 140 | createOptimizeRestoredTableOperationBaseCallable( |
143 | 141 | com.google.api.gax.rpc.ClientContext clientContext) throws IOException { |
144 | 142 |
|
| 143 | + @SuppressWarnings("unchecked") |
| 144 | + MethodDescriptor<Void, Operation> fakeDescriptor = |
| 145 | + (MethodDescriptor<Void, Operation>) |
| 146 | + (MethodDescriptor<?, ?>) com.google.bigtable.admin.v2.BigtableTableAdminGrpc.getUpdateTableMethod(); |
| 147 | + |
145 | 148 | GrpcCallSettings<Void, Operation> unusedInitialCallSettings = |
146 | | - GrpcCallSettings.create( |
147 | | - MethodDescriptor.<Void, Operation>newBuilder() |
148 | | - .setType(MethodType.UNARY) |
149 | | - .setFullMethodName( |
150 | | - "google.bigtable.admin.v2.BigtableTableAdmin/OptimizeRestoredTable") |
151 | | - .setRequestMarshaller( |
152 | | - new Marshaller<Void>() { |
153 | | - @Override |
154 | | - public InputStream stream(Void value) { |
155 | | - throw new UnsupportedOperationException("not used"); |
156 | | - } |
157 | | - |
158 | | - @Override |
159 | | - public Void parse(InputStream stream) { |
160 | | - throw new UnsupportedOperationException("not used"); |
161 | | - } |
162 | | - }) |
163 | | - .setResponseMarshaller( |
164 | | - new Marshaller<Operation>() { |
165 | | - @Override |
166 | | - public InputStream stream(Operation value) { |
167 | | - throw new UnsupportedOperationException("not used"); |
168 | | - } |
169 | | - |
170 | | - @Override |
171 | | - public Operation parse(InputStream stream) { |
172 | | - throw new UnsupportedOperationException("not used"); |
173 | | - } |
174 | | - }) |
175 | | - .build()); |
| 149 | + GrpcCallSettings.create(fakeDescriptor); |
176 | 150 |
|
177 | 151 | final MetadataTransformer<OptimizeRestoredTableMetadata> protoMetadataTransformer = |
178 | 152 | MetadataTransformer.create(OptimizeRestoredTableMetadata.class); |
|
0 commit comments