Skip to content

Commit 76e14cb

Browse files
committed
---
yaml --- r: 2717 b: refs/heads/update-datastore c: 3026e77 h: refs/heads/master i: 2715: 3b35aaa
1 parent affb9f7 commit 76e14cb

11 files changed

Lines changed: 15 additions & 60 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: 483b4d8fdd2927a5eda068713ba3a4cd18a6f8ce
8+
refs/heads/update-datastore: 3026e77428e35d47f2e68541849082710394a8c8
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
1010
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQueryException.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.google.gcloud.bigquery;
1818

19-
import com.google.api.client.googleapis.json.GoogleJsonError;
20-
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
2119
import com.google.common.collect.ImmutableSet;
2220
import com.google.gcloud.BaseServiceException;
2321
import com.google.gcloud.RetryHelper.RetryHelperException;
@@ -55,16 +53,7 @@ public BigQueryException(int code, String message, BigQueryError error) {
5553

5654
public BigQueryException(IOException exception) {
5755
super(exception, true);
58-
BigQueryError bigqueryError = null;
59-
if (exception instanceof GoogleJsonResponseException) {
60-
GoogleJsonError error = ((GoogleJsonResponseException) exception).getDetails();
61-
if (error != null && error.getErrors() != null && !error.getErrors().isEmpty()) {
62-
GoogleJsonError.ErrorInfo errorInfo = error.getErrors().get(0);
63-
bigqueryError = new BigQueryError(errorInfo.getReason(), errorInfo.getLocation(),
64-
errorInfo.getMessage(), (String) error.get("debugInfo"));
65-
}
66-
}
67-
this.error = bigqueryError;
56+
this.error = null;
6857
}
6958

7059
/**

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/ExternalTableInfo.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import com.google.api.services.bigquery.model.Table;
2222
import com.google.common.base.MoreObjects.ToStringHelper;
2323

24-
import java.util.Objects;
25-
2624
/**
2725
* Google BigQuery External Table information. BigQuery's external tables are tables whose data
2826
* reside outside of BigQuery but can be queried as normal BigQuery tables. External tables are
@@ -105,17 +103,6 @@ ToStringHelper toStringHelper() {
105103
return super.toStringHelper().add("configuration", configuration);
106104
}
107105

108-
@Override
109-
public boolean equals(Object obj) {
110-
return obj instanceof ExternalTableInfo
111-
&& Objects.equals(toPb(), ((ExternalTableInfo) obj).toPb());
112-
}
113-
114-
@Override
115-
public int hashCode() {
116-
return Objects.hash(super.hashCode(), configuration);
117-
}
118-
119106
@Override
120107
Table toPb() {
121108
Table tablePb = super.toPb();

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/TableInfo.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,6 @@ ToStringHelper toStringHelper() {
213213
.add("streamingBuffer", streamingBuffer);
214214
}
215215

216-
@Override
217-
public boolean equals(Object obj) {
218-
return obj instanceof TableInfo && Objects.equals(toPb(), ((TableInfo) obj).toPb());
219-
}
220-
221-
@Override
222-
public int hashCode() {
223-
return Objects.hash(super.hashCode(), location, streamingBuffer);
224-
}
225-
226216
@Override
227217
Table toPb() {
228218
Table tablePb = super.toPb();

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/ViewInfo.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.common.collect.Lists;
2626

2727
import java.util.List;
28-
import java.util.Objects;
2928

3029
/**
3130
* Google BigQuery View Table information. BigQuery's views are logical views, not materialized
@@ -144,16 +143,6 @@ ToStringHelper toStringHelper() {
144143
.add("userDefinedFunctions", userDefinedFunctions);
145144
}
146145

147-
@Override
148-
public boolean equals(Object obj) {
149-
return obj instanceof ViewInfo && Objects.equals(toPb(), ((ViewInfo) obj).toPb());
150-
}
151-
152-
@Override
153-
public int hashCode() {
154-
return Objects.hash(super.hashCode(), query, userDefinedFunctions);
155-
}
156-
157146
@Override
158147
Table toPb() {
159148
Table tablePb = super.toPb();

branches/update-datastore/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);

branches/update-datastore/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

branches/update-datastore/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

branches/update-datastore/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();

branches/update-datastore/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());

0 commit comments

Comments
 (0)