Skip to content

Commit 2461921

Browse files
Renaming get*Rpc() to get*Rpc{MV}()
1 parent fedeea4 commit 2461921

32 files changed

Lines changed: 83 additions & 83 deletions

File tree

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public QueryResult getNextPage() {
156156

157157
BigQueryImpl(BigQueryOptions options) {
158158
super(options);
159-
bigQueryRpc = options.getBigQueryRpc();
159+
bigQueryRpc = options.getBigQueryRpcV2();
160160
}
161161

162162
@Override
@@ -256,7 +256,7 @@ private static Page<Dataset> listDatasets(final String projectId,
256256
@Override
257257
public BigQueryRpc.Tuple<String,
258258
Iterable<com.google.api.services.bigquery.model.Dataset>> call() {
259-
return serviceOptions.getBigQueryRpc().listDatasets(projectId, optionsMap);
259+
return serviceOptions.getBigQueryRpcV2().listDatasets(projectId, optionsMap);
260260
}
261261
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
262262
String cursor = result.x();
@@ -397,7 +397,7 @@ private static Page<Table> listTables(final DatasetId datasetId,
397397
@Override
398398
public BigQueryRpc.Tuple<String, Iterable<com.google.api.services.bigquery.model.Table>>
399399
call() {
400-
return serviceOptions.getBigQueryRpc().listTables(
400+
return serviceOptions.getBigQueryRpcV2().listTables(
401401
datasetId.getProject(), datasetId.getDataset(), optionsMap);
402402
}
403403
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
@@ -454,7 +454,7 @@ private static Page<List<FieldValue>> listTableData(final TableId tableId,
454454
runWithRetries(new Callable<BigQueryRpc.Tuple<String, Iterable<TableRow>>>() {
455455
@Override
456456
public BigQueryRpc.Tuple<String, Iterable<TableRow>> call() {
457-
return serviceOptions.getBigQueryRpc()
457+
return serviceOptions.getBigQueryRpcV2()
458458
.listTableData(completeTableId.getProject(), completeTableId.getDataset(),
459459
completeTableId.getTable(), optionsMap);
460460
}
@@ -515,7 +515,7 @@ private static Page<Job> listJobs(final BigQueryOptions serviceOptions,
515515
@Override
516516
public BigQueryRpc.Tuple<String, Iterable<com.google.api.services.bigquery.model.Job>>
517517
call() {
518-
return serviceOptions.getBigQueryRpc().listJobs(serviceOptions.getProjectId(), optionsMap);
518+
return serviceOptions.getBigQueryRpcV2().listJobs(serviceOptions.getProjectId(), optionsMap);
519519
}
520520
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
521521
String cursor = result.x();
@@ -602,7 +602,7 @@ private static QueryResponse getQueryResults(JobId jobId,
602602
runWithRetries(new Callable<GetQueryResultsResponse>() {
603603
@Override
604604
public GetQueryResultsResponse call() {
605-
return serviceOptions.getBigQueryRpc().getQueryResults(
605+
return serviceOptions.getBigQueryRpcV2().getQueryResults(
606606
completeJobId.getProject(), completeJobId.getJob(), optionsMap);
607607
}
608608
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected Set<String> getScopes() {
112112
return SCOPES;
113113
}
114114

115-
protected BigQueryRpc getBigQueryRpc() {
115+
protected BigQueryRpc getBigQueryRpcV2() {
116116
return (BigQueryRpc) getRpc();
117117
}
118118

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected void flushBuffer(final int length, final boolean last) {
5454
new Callable<com.google.api.services.bigquery.model.Job>() {
5555
@Override
5656
public com.google.api.services.bigquery.model.Job call() {
57-
return getOptions().getBigQueryRpc().write(
57+
return getOptions().getBigQueryRpcV2().write(
5858
getUploadId(), getBuffer(), 0, getPosition(), length, last);
5959
}
6060
}, getOptions().getRetryParams(), BigQueryImpl.EXCEPTION_HANDLER, getOptions().getClock());
@@ -75,7 +75,7 @@ private static String open(final BigQueryOptions options,
7575
return runWithRetries(new Callable<String>() {
7676
@Override
7777
public String call() {
78-
return options.getBigQueryRpc().open(writeChannelConfiguration.toPb());
78+
return options.getBigQueryRpcV2().open(writeChannelConfiguration.toPb());
7979
}
8080
}, options.getRetryParams(), BigQueryImpl.EXCEPTION_HANDLER, options.getClock());
8181
} catch (RetryHelper.RetryHelperException e) {

google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ public Page<Instance> getNextPage() {
458458

459459
ComputeImpl(ComputeOptions options) {
460460
super(options);
461-
computeRpc = options.getComputeRpc();
461+
computeRpc = options.getComputeRpcV1();
462462
}
463463

464464
@Override
@@ -497,7 +497,7 @@ private static Page<DiskType> listDiskTypes(final String zone,
497497
@Override
498498
public ComputeRpc.Tuple<String,
499499
Iterable<com.google.api.services.compute.model.DiskType>> call() {
500-
return serviceOptions.getComputeRpc().listDiskTypes(zone, optionsMap);
500+
return serviceOptions.getComputeRpcV1().listDiskTypes(zone, optionsMap);
501501
}
502502
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
503503
String cursor = result.x();
@@ -531,7 +531,7 @@ private static Page<DiskType> listDiskTypes(final ComputeOptions serviceOptions,
531531
@Override
532532
public ComputeRpc.Tuple<String,
533533
Iterable<com.google.api.services.compute.model.DiskType>> call() {
534-
return serviceOptions.getComputeRpc().listDiskTypes(optionsMap);
534+
return serviceOptions.getComputeRpcV1().listDiskTypes(optionsMap);
535535
}
536536
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
537537
String cursor = result.x();
@@ -586,7 +586,7 @@ private static Page<MachineType> listMachineTypes(final String zone,
586586
@Override
587587
public ComputeRpc.Tuple<String,
588588
Iterable<com.google.api.services.compute.model.MachineType>> call() {
589-
return serviceOptions.getComputeRpc().listMachineTypes(zone, optionsMap);
589+
return serviceOptions.getComputeRpcV1().listMachineTypes(zone, optionsMap);
590590
}
591591
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
592592
String cursor = result.x();
@@ -621,7 +621,7 @@ private static Page<MachineType> listMachineTypes(final ComputeOptions serviceOp
621621
@Override
622622
public ComputeRpc.Tuple<String,
623623
Iterable<com.google.api.services.compute.model.MachineType>> call() {
624-
return serviceOptions.getComputeRpc().listMachineTypes(optionsMap);
624+
return serviceOptions.getComputeRpcV1().listMachineTypes(optionsMap);
625625
}
626626
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
627627
String cursor = result.x();
@@ -672,7 +672,7 @@ private static Page<Region> listRegions(final ComputeOptions serviceOptions,
672672
@Override
673673
public ComputeRpc.Tuple<String,
674674
Iterable<com.google.api.services.compute.model.Region>> call() {
675-
return serviceOptions.getComputeRpc().listRegions(optionsMap);
675+
return serviceOptions.getComputeRpcV1().listRegions(optionsMap);
676676
}
677677
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
678678
String cursor = result.x();
@@ -723,7 +723,7 @@ private static Page<Zone> listZones(final ComputeOptions serviceOptions,
723723
@Override
724724
public ComputeRpc.Tuple<String,
725725
Iterable<com.google.api.services.compute.model.Zone>> call() {
726-
return serviceOptions.getComputeRpc().listZones(optionsMap);
726+
return serviceOptions.getComputeRpcV1().listZones(optionsMap);
727727
}
728728
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
729729
String cursor = result.x();
@@ -820,7 +820,7 @@ private static Page<Operation> listGlobalOperations(final ComputeOptions service
820820
@Override
821821
public ComputeRpc.Tuple<String,
822822
Iterable<com.google.api.services.compute.model.Operation>> call() {
823-
return serviceOptions.getComputeRpc().listGlobalOperations(optionsMap);
823+
return serviceOptions.getComputeRpcV1().listGlobalOperations(optionsMap);
824824
}
825825
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
826826
String cursor = result.x();
@@ -848,7 +848,7 @@ private static Page<Operation> listRegionOperations(final String region,
848848
@Override
849849
public ComputeRpc.Tuple<String,
850850
Iterable<com.google.api.services.compute.model.Operation>> call() {
851-
return serviceOptions.getComputeRpc().listRegionOperations(region, optionsMap);
851+
return serviceOptions.getComputeRpcV1().listRegionOperations(region, optionsMap);
852852
}
853853
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
854854
String cursor = result.x();
@@ -876,7 +876,7 @@ private static Page<Operation> listZoneOperations(final String zone,
876876
@Override
877877
public ComputeRpc.Tuple<String,
878878
Iterable<com.google.api.services.compute.model.Operation>> call() {
879-
return serviceOptions.getComputeRpc().listZoneOperations(zone, optionsMap);
879+
return serviceOptions.getComputeRpcV1().listZoneOperations(zone, optionsMap);
880880
}
881881
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
882882
String cursor = result.x();
@@ -994,7 +994,7 @@ private static Page<Address> listGlobalAddresses(final ComputeOptions serviceOpt
994994
@Override
995995
public ComputeRpc.Tuple<String,
996996
Iterable<com.google.api.services.compute.model.Address>> call() {
997-
return serviceOptions.getComputeRpc().listGlobalAddresses(optionsMap);
997+
return serviceOptions.getComputeRpcV1().listGlobalAddresses(optionsMap);
998998
}
999999
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
10001000
String cursor = result.x();
@@ -1022,7 +1022,7 @@ private static Page<Address> listRegionAddresses(final String region,
10221022
@Override
10231023
public ComputeRpc.Tuple<String,
10241024
Iterable<com.google.api.services.compute.model.Address>> call() {
1025-
return serviceOptions.getComputeRpc().listRegionAddresses(region, optionsMap);
1025+
return serviceOptions.getComputeRpcV1().listRegionAddresses(region, optionsMap);
10261026
}
10271027
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
10281028
String cursor = result.x();
@@ -1050,7 +1050,7 @@ private static Page<Address> listAddresses(final ComputeOptions serviceOptions,
10501050
@Override
10511051
public ComputeRpc.Tuple<String,
10521052
Iterable<com.google.api.services.compute.model.Address>> call() {
1053-
return serviceOptions.getComputeRpc().listAddresses(optionsMap);
1053+
return serviceOptions.getComputeRpcV1().listAddresses(optionsMap);
10541054
}
10551055
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
10561056
String cursor = result.x();
@@ -1148,7 +1148,7 @@ private static Page<Snapshot> listSnapshots(final ComputeOptions serviceOptions,
11481148
@Override
11491149
public ComputeRpc.Tuple<String,
11501150
Iterable<com.google.api.services.compute.model.Snapshot>> call() {
1151-
return serviceOptions.getComputeRpc().listSnapshots(optionsMap);
1151+
return serviceOptions.getComputeRpcV1().listSnapshots(optionsMap);
11521152
}
11531153
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
11541154
String cursor = result.x();
@@ -1246,7 +1246,7 @@ private static Page<Image> listImages(final String project, final ComputeOptions
12461246
@Override
12471247
public ComputeRpc.Tuple<String,
12481248
Iterable<com.google.api.services.compute.model.Image>> call() {
1249-
return serviceOptions.getComputeRpc().listImages(project, optionsMap);
1249+
return serviceOptions.getComputeRpcV1().listImages(project, optionsMap);
12501250
}
12511251
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
12521252
String cursor = result.x();
@@ -1364,7 +1364,7 @@ private static Page<Disk> listDisks(final String zone, final ComputeOptions serv
13641364
@Override
13651365
public ComputeRpc.Tuple<String,
13661366
Iterable<com.google.api.services.compute.model.Disk>> call() {
1367-
return serviceOptions.getComputeRpc().listDisks(zone, optionsMap);
1367+
return serviceOptions.getComputeRpcV1().listDisks(zone, optionsMap);
13681368
}
13691369
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
13701370
String cursor = result.x();
@@ -1392,7 +1392,7 @@ private static Page<Disk> listDisks(final ComputeOptions serviceOptions,
13921392
@Override
13931393
public ComputeRpc.Tuple<String,
13941394
Iterable<com.google.api.services.compute.model.Disk>> call() {
1395-
return serviceOptions.getComputeRpc().listDisks(optionsMap);
1395+
return serviceOptions.getComputeRpcV1().listDisks(optionsMap);
13961396
}
13971397
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
13981398
String cursor = result.x();
@@ -1501,7 +1501,7 @@ private static Page<Subnetwork> listSubnetworks(final String region,
15011501
@Override
15021502
public ComputeRpc.Tuple<String,
15031503
Iterable<com.google.api.services.compute.model.Subnetwork>> call() {
1504-
return serviceOptions.getComputeRpc().listSubnetworks(region, optionsMap);
1504+
return serviceOptions.getComputeRpcV1().listSubnetworks(region, optionsMap);
15051505
}
15061506
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
15071507
String cursor = result.x();
@@ -1529,7 +1529,7 @@ private static Page<Subnetwork> listSubnetworks(final ComputeOptions serviceOpti
15291529
@Override
15301530
public ComputeRpc.Tuple<String,
15311531
Iterable<com.google.api.services.compute.model.Subnetwork>> call() {
1532-
return serviceOptions.getComputeRpc().listSubnetworks(optionsMap);
1532+
return serviceOptions.getComputeRpcV1().listSubnetworks(optionsMap);
15331533
}
15341534
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
15351535
String cursor = result.x();
@@ -1610,7 +1610,7 @@ private static Page<Network> listNetworks(final ComputeOptions serviceOptions,
16101610
@Override
16111611
public ComputeRpc.Tuple<String,
16121612
Iterable<com.google.api.services.compute.model.Network>> call() {
1613-
return serviceOptions.getComputeRpc().listNetworks(optionsMap);
1613+
return serviceOptions.getComputeRpcV1().listNetworks(optionsMap);
16141614
}
16151615
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
16161616
String cursor = result.x();
@@ -1712,7 +1712,7 @@ private static Page<Instance> listInstances(final String zone,
17121712
@Override
17131713
public ComputeRpc.Tuple<String,
17141714
Iterable<com.google.api.services.compute.model.Instance>> call() {
1715-
return serviceOptions.getComputeRpc().listInstances(zone, optionsMap);
1715+
return serviceOptions.getComputeRpcV1().listInstances(zone, optionsMap);
17161716
}
17171717
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
17181718
String cursor = result.x();
@@ -1740,7 +1740,7 @@ private static Page<Instance> listInstances(final ComputeOptions serviceOptions,
17401740
@Override
17411741
public ComputeRpc.Tuple<String,
17421742
Iterable<com.google.api.services.compute.model.Instance>> call() {
1743-
return serviceOptions.getComputeRpc().listInstances(optionsMap);
1743+
return serviceOptions.getComputeRpcV1().listInstances(optionsMap);
17441744
}
17451745
}, serviceOptions.getRetryParams(), EXCEPTION_HANDLER, serviceOptions.getClock());
17461746
String cursor = result.x();

google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected Set<String> getScopes() {
112112
return SCOPES;
113113
}
114114

115-
protected ComputeRpc getComputeRpc() {
115+
protected ComputeRpc getComputeRpcV1() {
116116
return (ComputeRpc) getRpc();
117117
}
118118

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final class DatastoreImpl extends BaseService<DatastoreOptions> implements Datas
4949

5050
DatastoreImpl(DatastoreOptions options) {
5151
super(options);
52-
this.datastoreRpc = options.getDatastoreRpc();
52+
this.datastoreRpc = options.getDatastoreRpcV1();
5353
retryParams = MoreObjects.firstNonNull(options.getRetryParams(), RetryParams.noRetries());
5454
}
5555

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ protected Set<String> getScopes() {
175175
return SCOPES;
176176
}
177177

178-
protected DatastoreRpc getDatastoreRpc() {
178+
protected DatastoreRpc getDatastoreRpcV1() {
179179
return (DatastoreRpc) getRpc();
180180
}
181181

google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ private List<RunQueryResponse> buildResponsesForQueryPaginationWithLimit() {
595595
Entity entity4 = Entity.newBuilder(KEY4).set("value", StringValue.of("value")).build();
596596
Entity entity5 = Entity.newBuilder(KEY5).set("value", "value").build();
597597
datastore.add(ENTITY3, entity4, entity5);
598-
DatastoreRpc datastoreRpc = datastore.getOptions().getDatastoreRpc();
598+
DatastoreRpc datastoreRpc = datastore.getOptions().getDatastoreRpcV1();
599599
List<RunQueryResponse> responses = new ArrayList<>();
600600
Query<Entity> query = Query.newEntityQueryBuilder().build();
601601
RunQueryRequest.Builder requestPb = RunQueryRequest.newBuilder();

google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class DnsBatch {
4848

4949
DnsBatch(DnsOptions options) {
5050
this.options = options;
51-
this.dnsRpc = options.getDnsRpc();
51+
this.dnsRpc = options.getDnsRpcV1();
5252
this.batch = dnsRpc.createBatch();
5353
}
5454

google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public Page<RecordSet> getNextPage() {
110110

111111
DnsImpl(DnsOptions options) {
112112
super(options);
113-
dnsRpc = options.getDnsRpc();
113+
dnsRpc = options.getDnsRpcV1();
114114
}
115115

116116
static Function<ManagedZone, Zone> zoneFromPb(final DnsOptions options) {
@@ -131,7 +131,7 @@ private static Page<Zone> listZones(final DnsOptions serviceOptions,
131131
final Map<DnsRpc.Option, ?> optionsMap) {
132132
try {
133133
// get a list of managed zones
134-
final DnsRpc rpc = serviceOptions.getDnsRpc();
134+
final DnsRpc rpc = serviceOptions.getDnsRpcV1();
135135
DnsRpc.ListResult<ManagedZone> result =
136136
runWithRetries(new Callable<DnsRpc.ListResult<ManagedZone>>() {
137137
@Override
@@ -160,7 +160,7 @@ private static Page<ChangeRequest> listChangeRequests(final String zoneName,
160160
final DnsOptions serviceOptions, final Map<DnsRpc.Option, ?> optionsMap) {
161161
try {
162162
// get a list of changes
163-
final DnsRpc rpc = serviceOptions.getDnsRpc();
163+
final DnsRpc rpc = serviceOptions.getDnsRpcV1();
164164
DnsRpc.ListResult<Change> result = runWithRetries(new Callable<DnsRpc.ListResult<Change>>() {
165165
@Override
166166
public DnsRpc.ListResult<Change> call() {
@@ -189,7 +189,7 @@ private static Page<RecordSet> listRecordSets(final String zoneName,
189189
final DnsOptions serviceOptions, final Map<DnsRpc.Option, ?> optionsMap) {
190190
try {
191191
// get a list of record sets
192-
final DnsRpc rpc = serviceOptions.getDnsRpc();
192+
final DnsRpc rpc = serviceOptions.getDnsRpcV1();
193193
DnsRpc.ListResult<ResourceRecordSet> result = runWithRetries(
194194
new Callable<DnsRpc.ListResult<ResourceRecordSet>>() {
195195
@Override

0 commit comments

Comments
 (0)