Skip to content

Commit 3026e77

Browse files
committed
Rename Storage.apply to Storage.submit
1 parent add5924 commit 3026e77

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

gcloud-java-storage/src/main/java/com/google/gcloud/storage/Bucket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public List<Blob> get(String blobName1, String blobName2, String... blobNames) {
319319
batch.get(info.name(), name);
320320
}
321321
List<Blob> blobs = new ArrayList<>(blobNames.length);
322-
BatchResponse response = storage.apply(batch.build());
322+
BatchResponse response = storage.submit(batch.build());
323323
for (BatchResponse.Result<BlobInfo> result : response.gets()) {
324324
BlobInfo blobInfo = result.get();
325325
blobs.add(blobInfo != null ? new Blob(storage, blobInfo) : null);

gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ private static void checkContentType(BlobInfo blobInfo) throws IllegalArgumentEx
14121412
* @return the batch response
14131413
* @throws StorageException upon failure
14141414
*/
1415-
BatchResponse apply(BatchRequest batchRequest);
1415+
BatchResponse submit(BatchRequest batchRequest);
14161416

14171417
/**
14181418
* Return a channel for reading the blob's content. The blob's latest generation is read. If the

gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public byte[] call() {
441441
}
442442

443443
@Override
444-
public BatchResponse apply(BatchRequest batchRequest) {
444+
public BatchResponse submit(BatchRequest batchRequest) {
445445
List<Tuple<StorageObject, Map<StorageRpc.Option, ?>>> toDelete =
446446
Lists.newArrayListWithCapacity(batchRequest.toDelete().size());
447447
for (Map.Entry<BlobId, Iterable<BlobSourceOption>> entry : batchRequest.toDelete().entrySet()) {
@@ -592,7 +592,7 @@ public List<BlobInfo> get(BlobId... blobIds) {
592592
for (BlobId blob : blobIds) {
593593
requestBuilder.get(blob);
594594
}
595-
BatchResponse response = apply(requestBuilder.build());
595+
BatchResponse response = submit(requestBuilder.build());
596596
return Collections.unmodifiableList(transformResultList(response.gets(), null));
597597
}
598598

@@ -602,7 +602,7 @@ public List<BlobInfo> update(BlobInfo... blobInfos) {
602602
for (BlobInfo blobInfo : blobInfos) {
603603
requestBuilder.update(blobInfo);
604604
}
605-
BatchResponse response = apply(requestBuilder.build());
605+
BatchResponse response = submit(requestBuilder.build());
606606
return Collections.unmodifiableList(transformResultList(response.updates(), null));
607607
}
608608

@@ -612,7 +612,7 @@ public List<Boolean> delete(BlobId... blobIds) {
612612
for (BlobId blob : blobIds) {
613613
requestBuilder.delete(blob);
614614
}
615-
BatchResponse response = apply(requestBuilder.build());
615+
BatchResponse response = submit(requestBuilder.build());
616616
return Collections.unmodifiableList(transformResultList(response.deletes(), Boolean.FALSE));
617617
}
618618

gcloud-java-storage/src/test/java/com/google/gcloud/storage/BucketTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void testGetAll() throws Exception {
175175
}
176176
BatchResponse response = new BatchResponse(Collections.<Result<Boolean>>emptyList(),
177177
Collections.<Result<BlobInfo>>emptyList(), batchResultList);
178-
expect(storage.apply(capture(capturedBatchRequest))).andReturn(response);
178+
expect(storage.submit(capture(capturedBatchRequest))).andReturn(response);
179179
replay(storage);
180180
List<Blob> blobs = bucket.get("n1", "n2", "n3");
181181
Set<BlobId> blobInfoSet = capturedBatchRequest.getValue().toGet().keySet();

gcloud-java-storage/src/test/java/com/google/gcloud/storage/ITStorageTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ public void testBatchRequest() {
584584
.update(updatedBlob1)
585585
.update(updatedBlob2)
586586
.build();
587-
BatchResponse updateResponse = storage.apply(updateRequest);
587+
BatchResponse updateResponse = storage.submit(updateRequest);
588588
assertEquals(2, updateResponse.updates().size());
589589
assertEquals(0, updateResponse.deletes().size());
590590
assertEquals(0, updateResponse.gets().size());
@@ -602,7 +602,7 @@ public void testBatchRequest() {
602602
.get(BUCKET, sourceBlobName1)
603603
.get(BUCKET, sourceBlobName2)
604604
.build();
605-
BatchResponse getResponse = storage.apply(getRequest);
605+
BatchResponse getResponse = storage.submit(getRequest);
606606
assertEquals(2, getResponse.gets().size());
607607
assertEquals(0, getResponse.deletes().size());
608608
assertEquals(0, getResponse.updates().size());
@@ -616,7 +616,7 @@ public void testBatchRequest() {
616616
.delete(BUCKET, sourceBlobName1)
617617
.delete(BUCKET, sourceBlobName2)
618618
.build();
619-
BatchResponse deleteResponse = storage.apply(deleteRequest);
619+
BatchResponse deleteResponse = storage.submit(deleteRequest);
620620
assertEquals(2, deleteResponse.deletes().size());
621621
assertEquals(0, deleteResponse.gets().size());
622622
assertEquals(0, deleteResponse.updates().size());
@@ -646,7 +646,7 @@ public void testBatchRequestManyDeletes() {
646646
.get(BUCKET, sourceBlobName1)
647647
.update(updatedBlob2)
648648
.build();
649-
BatchResponse response = storage.apply(updateRequest);
649+
BatchResponse response = storage.submit(updateRequest);
650650
assertEquals(2 * MAX_BATCH_DELETES, response.deletes().size());
651651
assertEquals(1, response.updates().size());
652652
assertEquals(1, response.gets().size());
@@ -685,7 +685,7 @@ public void testBatchRequestFail() {
685685
.get(BUCKET, blobName, Storage.BlobGetOption.generationMatch(-1L))
686686
.get(BlobId.of(BUCKET, blobName, -1L))
687687
.build();
688-
BatchResponse batchResponse = storage.apply(batchRequest);
688+
BatchResponse batchResponse = storage.submit(batchRequest);
689689
assertEquals(1, batchResponse.updates().size());
690690
assertEquals(2, batchResponse.deletes().size());
691691
assertEquals(2, batchResponse.gets().size());

gcloud-java-storage/src/test/java/com/google/gcloud/storage/StorageImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ public Tuple<StorageObject, StorageException> apply(StorageObject f) {
975975
EasyMock.expect(storageRpcMock.batch(EasyMock.capture(capturedBatchRequest))).andReturn(res);
976976
EasyMock.replay(storageRpcMock);
977977
storage = options.service();
978-
BatchResponse batchResponse = storage.apply(req);
978+
BatchResponse batchResponse = storage.submit(req);
979979

980980
// Verify captured StorageRpc.BatchRequest
981981
List<Tuple<StorageObject, Map<StorageRpc.Option, ?>>> capturedToDelete =

0 commit comments

Comments
 (0)