|
15 | 15 | */
|
16 | 16 | package com.google.cloud.bigtable.data.v2.stub;
|
17 | 17 |
|
18 |
| -import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; |
19 |
| - |
20 | 18 | import com.google.api.core.ApiFuture;
|
21 | 19 | import com.google.api.core.BetaApi;
|
22 | 20 | import com.google.api.gax.core.FixedCredentialsProvider;
|
|
25 | 23 | import com.google.api.gax.grpc.GrpcTransportChannel;
|
26 | 24 | import com.google.api.gax.rpc.FixedTransportChannelProvider;
|
27 | 25 | import com.google.auth.Credentials;
|
28 |
| -import com.google.cloud.bigtable.data.v2.models.Query; |
| 26 | +import com.google.bigtable.v2.ReadRowsRequest; |
| 27 | +import com.google.bigtable.v2.RowFilter; |
| 28 | +import com.google.bigtable.v2.RowSet; |
| 29 | +import com.google.bigtable.v2.TableName; |
| 30 | +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; |
29 | 31 | import com.google.cloud.bigtable.data.v2.models.Row;
|
30 | 32 | import com.google.common.base.Preconditions;
|
31 | 33 | import com.google.common.collect.ImmutableList;
|
@@ -144,8 +146,20 @@ private void sendPrimeRequests(ManagedChannel managedChannel) throws IOException
|
144 | 146 | // Prime all of the table ids in parallel
|
145 | 147 | for (String tableId : tableIds) {
|
146 | 148 | ApiFuture<Row> f =
|
147 |
| - stub.readRowCallable() |
148 |
| - .futureCall(Query.create(tableId).rowKey(PRIMING_ROW_KEY).filter(FILTERS.block())); |
| 149 | + stub.createReadRowsRawCallable(new DefaultRowAdapter()) |
| 150 | + .first() |
| 151 | + .futureCall( |
| 152 | + ReadRowsRequest.newBuilder() |
| 153 | + .setTableName( |
| 154 | + TableName.format( |
| 155 | + primingSettings.getProjectId(), |
| 156 | + primingSettings.getInstanceId(), |
| 157 | + tableId)) |
| 158 | + .setAppProfileId(primingSettings.getAppProfileId()) |
| 159 | + .setRows(RowSet.newBuilder().addRowKeys(PRIMING_ROW_KEY).build()) |
| 160 | + .setFilter(RowFilter.newBuilder().setBlockAllFilter(true).build()) |
| 161 | + .setRowsLimit(1) |
| 162 | + .build()); |
149 | 163 |
|
150 | 164 | primeFutures.put(tableId, f);
|
151 | 165 | }
|
|
0 commit comments