Skip to content

Commit 66a85dc

Browse files
committed
---
yaml --- r: 2257 b: refs/heads/pubsub-alpha c: cdec697 h: refs/heads/master i: 2255: f10e3b4
1 parent 4b09f31 commit 66a85dc

51 files changed

Lines changed: 2876 additions & 2253 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ refs/heads/master: 689bbb466df4b2d5d2483d6edb8ac5c7c7f7c6fa
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
6-
refs/heads/pubsub-alpha: 288c9935d84f82cd67318b27facb6025772225a6
6+
refs/heads/pubsub-alpha: cdec697470a3e55066936d7099a0f066ae5f3005
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
88
refs/heads/update-datastore: 482954f2c5055231e5b3122ea91d2ba00ce8187c
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

branches/pubsub-alpha/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,33 @@ Here is a code snippet showing a simple usage example from within Compute/App En
125125
must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
126126
127127
```java
128-
import com.google.gcloud.bigquery.BaseTableInfo;
129128
import com.google.gcloud.bigquery.BigQuery;
130129
import com.google.gcloud.bigquery.BigQueryOptions;
131130
import com.google.gcloud.bigquery.Field;
131+
import com.google.gcloud.bigquery.Job;
132132
import com.google.gcloud.bigquery.JobStatus;
133133
import com.google.gcloud.bigquery.JobInfo;
134+
import com.google.gcloud.bigquery.LoadJobConfiguration;
134135
import com.google.gcloud.bigquery.Schema;
136+
import com.google.gcloud.bigquery.StandardTableDefinition;
137+
import com.google.gcloud.bigquery.Table;
135138
import com.google.gcloud.bigquery.TableId;
136139
import com.google.gcloud.bigquery.TableInfo;
137140
138141
BigQuery bigquery = BigQueryOptions.defaultInstance().service();
139142
TableId tableId = TableId.of("dataset", "table");
140-
BaseTableInfo info = bigquery.getTable(tableId);
141-
if (info == null) {
143+
Table table = bigquery.getTable(tableId);
144+
if (table == null) {
142145
System.out.println("Creating table " + tableId);
143146
Field integerField = Field.of("fieldName", Field.Type.integer());
144-
bigquery.create(TableInfo.of(tableId, Schema.of(integerField)));
147+
Schema schema = Schema.of(integerField);
148+
bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
145149
} else {
146150
System.out.println("Loading data into table " + tableId);
147151
LoadJobConfiguration configuration = LoadJobConfiguration.of(tableId, "gs://bucket/path");
148-
JobInfo loadJob = JobInfo.of(configuration);
149-
loadJob = bigquery.create(loadJob);
150-
while (loadJob.status().state() != JobStatus.State.DONE) {
152+
Job loadJob = bigquery.create(JobInfo.of(configuration));
153+
while (!loadJob.isDone()) {
151154
Thread.sleep(1000L);
152-
loadJob = bigquery.getJob(loadJob.jobId());
153155
}
154156
if (loadJob.status().error() != null) {
155157
System.out.println("Job completed with errors");

branches/pubsub-alpha/gcloud-java-bigquery/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ are created from a BigQuery SQL query. In this code snippet we show how to creat
111111
with only one string field. Add the following imports at the top of your file:
112112

113113
```java
114-
import com.google.gcloud.bigquery.BaseTableInfo;
115114
import com.google.gcloud.bigquery.Field;
116115
import com.google.gcloud.bigquery.Schema;
116+
import com.google.gcloud.bigquery.StandardTableDefinition;
117+
import com.google.gcloud.bigquery.Table;
117118
import com.google.gcloud.bigquery.TableId;
118119
import com.google.gcloud.bigquery.TableInfo;
119120
```
@@ -126,7 +127,8 @@ Field stringField = Field.of("StringField", Field.Type.string());
126127
// Table schema definition
127128
Schema schema = Schema.of(stringField);
128129
// Create a table
129-
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, schema));
130+
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
131+
Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition));
130132
```
131133

132134
#### Loading data into a table
@@ -204,7 +206,6 @@ the code from the main method to your application's servlet class and change the
204206
display on your webpage.
205207

206208
```java
207-
import com.google.gcloud.bigquery.BaseTableInfo;
208209
import com.google.gcloud.bigquery.BigQuery;
209210
import com.google.gcloud.bigquery.BigQueryOptions;
210211
import com.google.gcloud.bigquery.DatasetInfo;
@@ -215,6 +216,8 @@ import com.google.gcloud.bigquery.InsertAllResponse;
215216
import com.google.gcloud.bigquery.QueryRequest;
216217
import com.google.gcloud.bigquery.QueryResponse;
217218
import com.google.gcloud.bigquery.Schema;
219+
import com.google.gcloud.bigquery.StandardTableDefinition;
220+
import com.google.gcloud.bigquery.Table;
218221
import com.google.gcloud.bigquery.TableId;
219222
import com.google.gcloud.bigquery.TableInfo;
220223

@@ -240,7 +243,8 @@ public class GcloudBigQueryExample {
240243
// Table schema definition
241244
Schema schema = Schema.of(stringField);
242245
// Create a table
243-
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, schema));
246+
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
247+
Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition));
244248

245249
// Define rows to insert
246250
Map<String, Object> firstRow = new HashMap<>();
@@ -267,7 +271,7 @@ public class GcloudBigQueryExample {
267271
.build();
268272
// Request query to be executed and wait for results
269273
QueryResponse queryResponse = bigquery.query(queryRequest);
270-
while (!queryResponse.jobComplete()) {
274+
while (!queryResponse.jobCompleted()) {
271275
Thread.sleep(1000L);
272276
queryResponse = bigquery.getQueryResults(queryResponse.jobId());
273277
}

branches/pubsub-alpha/gcloud-java-bigquery/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.google.gcloud</groupId>
54
<artifactId>gcloud-java-bigquery</artifactId>
65
<packaging>jar</packaging>
76
<name>GCloud Java bigquery</name>

branches/pubsub-alpha/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Acl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ Access toPb() {
325325
*/
326326
public static final class View extends Entity {
327327

328+
private static final long serialVersionUID = -6851072781269419383L;
329+
328330
private final TableId id;
329331

330332
/**

0 commit comments

Comments
 (0)