Skip to content

Commit 4b960db

Browse files
committed
---
yaml --- r: 2719 b: refs/heads/update-datastore c: e27b5b3 h: refs/heads/master i: 2717: 76e14cb 2715: 3b35aaa 2711: 88da521 2703: c14a5c9 2687: 6a172f8
1 parent 1b7f8ca commit 4b960db

20 files changed

Lines changed: 70 additions & 89 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: 9fba6035e3f21f90848b12c35a2115cb30bccbb6
8+
refs/heads/update-datastore: e27b5b3d81c52c1a77e9e2c8a5b6f05a8544516e
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/BigQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ public static QueryResultsOption startIndex(long startIndex) {
443443
/**
444444
* Returns an option that sets how long to wait for the query to complete, in milliseconds,
445445
* before returning. Default is 10 seconds. If the timeout passes before the job completes,
446-
* {@link QueryResponse#jobComplete()} will be {@code false}.
446+
* {@link QueryResponse#jobCompleted()} will be {@code false}.
447447
*/
448448
public static QueryResultsOption maxWaitTime(long maxWaitTime) {
449449
checkArgument(maxWaitTime >= 0);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ public com.google.api.services.bigquery.model.QueryResponse call() {
514514
QueryResponse.Builder builder = QueryResponse.builder();
515515
JobId completeJobId = JobId.fromPb(results.getJobReference());
516516
builder.jobId(completeJobId);
517-
builder.jobComplete(results.getJobComplete());
517+
builder.jobCompleted(results.getJobComplete());
518518
List<TableRow> rowsPb = results.getRows();
519519
if (results.getJobComplete()) {
520-
builder.jobComplete(true);
520+
builder.jobCompleted(true);
521521
QueryResult.Builder resultBuilder = transformQueryResults(completeJobId, rowsPb,
522522
results.getPageToken(), options(), ImmutableMap.<BigQueryRpc.Option, Object>of());
523523
resultBuilder.totalBytesProcessed(results.getTotalBytesProcessed());
@@ -561,7 +561,7 @@ public GetQueryResultsResponse call() {
561561
JobId completeJobId = JobId.fromPb(results.getJobReference());
562562
builder.jobId(completeJobId);
563563
builder.etag(results.getEtag());
564-
builder.jobComplete(results.getJobComplete());
564+
builder.jobCompleted(results.getJobComplete());
565565
List<TableRow> rowsPb = results.getRows();
566566
if (results.getJobComplete()) {
567567
QueryResult.Builder resultBuilder = transformQueryResults(completeJobId, rowsPb,

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/QueryJobInfo.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ public Builder defaultDataset(DatasetId defaultDataset) {
225225
return self();
226226
}
227227

228+
/**
229+
* Sets the default dataset. This dataset is used for all unqualified table names used in the
230+
* query.
231+
*/
232+
public Builder defaultDataset(String defaultDataset) {
233+
return defaultDataset(DatasetId.of(defaultDataset));
234+
}
235+
228236
/**
229237
* Sets a priority for the query. If not specified the priority is assumed to be
230238
* {@link Priority#INTERACTIVE}.

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
* a temporary table that is deleted approximately 24 hours after the query is run. The query is run
3030
* through a BigQuery Job whose identity can be accessed via {@link QueryResponse#jobId()}. If the
3131
* query does not complete within the provided {@link Builder#maxWaitTime(Long)}, the response
32-
* returned by {@link BigQuery#query(QueryRequest)} will have {@link QueryResponse#jobComplete()}
32+
* returned by {@link BigQuery#query(QueryRequest)} will have {@link QueryResponse#jobCompleted()}
3333
* set to {@code false} and {@link QueryResponse#result()} set to {@code null}. To obtain query
3434
* results you can use {@link BigQuery#getQueryResults(JobId, BigQuery.QueryResultsOption...)} until
35-
* {@link QueryResponse#jobComplete()} returns {@code true}.
35+
* {@link QueryResponse#jobCompleted()} returns {@code true}.
3636
*
3737
* <p>Example usage of a query request:
3838
* <pre> {@code
@@ -43,7 +43,7 @@
4343
* .maxResults(1000L)
4444
* .build();
4545
* QueryResponse response = bigquery.query(request);
46-
* while (!response.jobComplete()) {
46+
* while (!response.jobCompleted()) {
4747
* Thread.sleep(1000);
4848
* response = bigquery.getQueryResults(response.jobId());
4949
* }
@@ -109,11 +109,18 @@ public Builder defaultDataset(DatasetId defaultDataset) {
109109
return this;
110110
}
111111

112+
/**
113+
* Sets the default dataset to assume for any unqualified table names in the query.
114+
*/
115+
public Builder defaultDataset(String defaultDataset) {
116+
return defaultDataset(DatasetId.of(defaultDataset));
117+
}
118+
112119
/**
113120
* Sets how long to wait for the query to complete, in milliseconds, before the request times
114121
* out and returns. Note that this is only a timeout for the request, not the query. If the
115122
* query takes longer to run than the timeout value, the call returns without any results and
116-
* with the {@link QueryResponse#jobComplete()} set to {@code false}. If not set, a wait time of
123+
* with the {@link QueryResponse#jobCompleted()} set to {@code false}. If not set, a wait time of
117124
* 10000 milliseconds (10 seconds) is used.
118125
*/
119126
public Builder maxWaitTime(Long maxWaitTime) {
@@ -182,7 +189,7 @@ public DatasetId defaultDataset() {
182189
* Returns how long to wait for the query to complete, in milliseconds, before the request times
183190
* out and returns. Note that this is only a timeout for the request, not the query. If the
184191
* query takes longer to run than the timeout value, the call returns without any results and
185-
* with the {@link QueryResponse#jobComplete()} set to {@code false}. You can call
192+
* with the {@link QueryResponse#jobCompleted()} set to {@code false}. You can call
186193
* {@link BigQuery#getQueryResults(JobId, BigQuery.QueryResultsOption...)} to wait for the query
187194
* to complete and read the results. If not set, a wait time of 10000 milliseconds (10 seconds)
188195
* is used.

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* <p>Example usage of a query response:
3232
* <pre> {@code
3333
* QueryResponse response = bigquery.query(request);
34-
* while (!response.jobComplete()) {
34+
* while (!response.jobCompleted()) {
3535
* Thread.sleep(1000);
3636
* response = bigquery.getQueryResults(response.jobId());
3737
* }
@@ -56,15 +56,15 @@ public class QueryResponse implements Serializable {
5656
private final QueryResult result;
5757
private final String etag;
5858
private final JobId jobId;
59-
private final boolean jobComplete;
59+
private final boolean jobCompleted;
6060
private final List<BigQueryError> executionErrors;
6161

6262
static final class Builder {
6363

6464
private QueryResult result;
6565
private String etag;
6666
private JobId jobId;
67-
private boolean jobComplete;
67+
private boolean jobCompleted;
6868
private List<BigQueryError> executionErrors;
6969

7070
private Builder() {}
@@ -84,8 +84,8 @@ Builder jobId(JobId jobId) {
8484
return this;
8585
}
8686

87-
Builder jobComplete(boolean jobComplete) {
88-
this.jobComplete = jobComplete;
87+
Builder jobCompleted(boolean jobCompleted) {
88+
this.jobCompleted = jobCompleted;
8989
return this;
9090
}
9191

@@ -103,13 +103,13 @@ private QueryResponse(Builder builder) {
103103
this.result = builder.result;
104104
this.etag = builder.etag;
105105
this.jobId = builder.jobId;
106-
this.jobComplete = builder.jobComplete;
106+
this.jobCompleted = builder.jobCompleted;
107107
this.executionErrors = builder.executionErrors != null ? builder.executionErrors
108108
: ImmutableList.<BigQueryError>of();
109109
}
110110

111111
/**
112-
* Returns the result of the query. Returns {@code null} if {@link #jobComplete()} is {@code
112+
* Returns the result of the query. Returns {@code null} if {@link #jobCompleted()} is {@code
113113
* false}.
114114
*/
115115
public QueryResult result() {
@@ -137,8 +137,8 @@ public JobId jobId() {
137137
* {@link #result()} returns {@code null}. This method can be used to check if query execution
138138
* completed and results are available.
139139
*/
140-
public boolean jobComplete() {
141-
return jobComplete;
140+
public boolean jobCompleted() {
141+
return jobCompleted;
142142
}
143143

144144
/**
@@ -164,7 +164,7 @@ public String toString() {
164164
.add("result", result)
165165
.add("etag", etag)
166166
.add("jobId", jobId)
167-
.add("jobComplete", jobComplete)
167+
.add("jobCompleted", jobCompleted)
168168
.add("executionErrors", executionErrors)
169169
.toString();
170170
}
@@ -183,7 +183,7 @@ public boolean equals(Object obj) {
183183
return false;
184184
}
185185
QueryResponse response = (QueryResponse) obj;
186-
return jobComplete == response.jobComplete
186+
return jobCompleted == response.jobCompleted
187187
&& Objects.equals(etag, response.etag)
188188
&& Objects.equals(result, response.result)
189189
&& Objects.equals(jobId, response.jobId)

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-bigquery/src/test/java/com/google/gcloud/bigquery/BigQueryImplTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ public void testQueryRequest() {
902902
assertNull(response.etag());
903903
assertNull(response.result());
904904
assertEquals(queryJob, response.jobId());
905-
assertEquals(false, response.jobComplete());
905+
assertEquals(false, response.jobCompleted());
906906
assertEquals(ImmutableList.<BigQueryError>of(), response.executionErrors());
907907
assertFalse(response.hasErrors());
908908
assertEquals(null, response.result());
@@ -926,7 +926,7 @@ public void testQueryRequestCompleted() {
926926
QueryResponse response = bigquery.query(QUERY_REQUEST);
927927
assertNull(response.etag());
928928
assertEquals(queryJob, response.jobId());
929-
assertEquals(true, response.jobComplete());
929+
assertEquals(true, response.jobCompleted());
930930
assertEquals(false, response.result().cacheHit());
931931
assertEquals(ImmutableList.<BigQueryError>of(), response.executionErrors());
932932
assertFalse(response.hasErrors());
@@ -959,7 +959,7 @@ public void testGetQueryResults() {
959959
QueryResponse response = bigquery.getQueryResults(queryJob);
960960
assertEquals("etag", response.etag());
961961
assertEquals(queryJob, response.jobId());
962-
assertEquals(true, response.jobComplete());
962+
assertEquals(true, response.jobCompleted());
963963
assertEquals(false, response.result().cacheHit());
964964
assertEquals(ImmutableList.<BigQueryError>of(), response.executionErrors());
965965
assertFalse(response.hasErrors());
@@ -993,7 +993,7 @@ public void testGetQueryResultsWithOptions() {
993993
QUERY_RESULTS_OPTION_INDEX, QUERY_RESULTS_OPTION_MAX_RESULTS,
994994
QUERY_RESULTS_OPTION_PAGE_TOKEN);
995995
assertEquals(queryJob, response.jobId());
996-
assertEquals(true, response.jobComplete());
996+
assertEquals(true, response.jobCompleted());
997997
assertEquals(false, response.result().cacheHit());
998998
assertEquals(ImmutableList.<BigQueryError>of(), response.executionErrors());
999999
assertFalse(response.hasErrors());

0 commit comments

Comments
 (0)