Skip to content

Commit 12f7458

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 2251 b: refs/heads/pubsub-alpha c: 3d1c1c8 h: refs/heads/master i: 2249: 8467a6a 2247: 8e7687f
1 parent 494d08c commit 12f7458

229 files changed

Lines changed: 3462 additions & 67928 deletions

File tree

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: 063d000abb08ae2076c780de363b3f339e99b691
6+
refs/heads/pubsub-alpha: 3d1c1c80b29ede59fe1c33f26be56b2901e5a29a
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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,33 +125,31 @@ 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;
128129
import com.google.gcloud.bigquery.BigQuery;
129130
import com.google.gcloud.bigquery.BigQueryOptions;
130131
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;
135134
import com.google.gcloud.bigquery.Schema;
136-
import com.google.gcloud.bigquery.StandardTableDefinition;
137-
import com.google.gcloud.bigquery.Table;
138135
import com.google.gcloud.bigquery.TableId;
139136
import com.google.gcloud.bigquery.TableInfo;
140137
141138
BigQuery bigquery = BigQueryOptions.defaultInstance().service();
142139
TableId tableId = TableId.of("dataset", "table");
143-
Table table = bigquery.getTable(tableId);
144-
if (table == null) {
140+
BaseTableInfo info = bigquery.getTable(tableId);
141+
if (info == null) {
145142
System.out.println("Creating table " + tableId);
146143
Field integerField = Field.of("fieldName", Field.Type.integer());
147-
Schema schema = Schema.of(integerField);
148-
bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
144+
bigquery.create(TableInfo.of(tableId, Schema.of(integerField)));
149145
} else {
150146
System.out.println("Loading data into table " + tableId);
151147
LoadJobConfiguration configuration = LoadJobConfiguration.of(tableId, "gs://bucket/path");
152-
Job loadJob = bigquery.create(JobInfo.of(configuration));
153-
while (!loadJob.isDone()) {
148+
JobInfo loadJob = JobInfo.of(configuration);
149+
loadJob = bigquery.create(loadJob);
150+
while (loadJob.status().state() != JobStatus.State.DONE) {
154151
Thread.sleep(1000L);
152+
loadJob = bigquery.getJob(loadJob.jobId());
155153
}
156154
if (loadJob.status().error() != null) {
157155
System.out.println("Job completed with errors");
@@ -250,6 +248,7 @@ Here is a code snippet showing a simple usage example from within Compute/App En
250248
import static java.nio.charset.StandardCharsets.UTF_8;
251249
252250
import com.google.gcloud.storage.Blob;
251+
import com.google.gcloud.storage.BlobInfo;
253252
import com.google.gcloud.storage.BlobId;
254253
import com.google.gcloud.storage.Storage;
255254
import com.google.gcloud.storage.StorageOptions;
@@ -259,7 +258,7 @@ import java.nio.channels.WritableByteChannel;
259258
260259
Storage storage = StorageOptions.defaultInstance().service();
261260
BlobId blobId = BlobId.of("bucket", "blob_name");
262-
Blob blob = Blob.get(storage, blobId);
261+
Blob blob = storage.get(storage, blobId);
263262
if (blob == null) {
264263
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
265264
storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ 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;
114115
import com.google.gcloud.bigquery.Field;
115116
import com.google.gcloud.bigquery.Schema;
116-
import com.google.gcloud.bigquery.StandardTableDefinition;
117-
import com.google.gcloud.bigquery.Table;
118117
import com.google.gcloud.bigquery.TableId;
119118
import com.google.gcloud.bigquery.TableInfo;
120119
```
@@ -127,8 +126,7 @@ Field stringField = Field.of("StringField", Field.Type.string());
127126
// Table schema definition
128127
Schema schema = Schema.of(stringField);
129128
// Create a table
130-
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
131-
Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition));
129+
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, schema));
132130
```
133131

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

208206
```java
207+
import com.google.gcloud.bigquery.BaseTableInfo;
209208
import com.google.gcloud.bigquery.BigQuery;
210209
import com.google.gcloud.bigquery.BigQueryOptions;
211210
import com.google.gcloud.bigquery.DatasetInfo;
@@ -216,8 +215,6 @@ import com.google.gcloud.bigquery.InsertAllResponse;
216215
import com.google.gcloud.bigquery.QueryRequest;
217216
import com.google.gcloud.bigquery.QueryResponse;
218217
import com.google.gcloud.bigquery.Schema;
219-
import com.google.gcloud.bigquery.StandardTableDefinition;
220-
import com.google.gcloud.bigquery.Table;
221218
import com.google.gcloud.bigquery.TableId;
222219
import com.google.gcloud.bigquery.TableInfo;
223220

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

249245
// Define rows to insert
250246
Map<String, Object> firstRow = new HashMap<>();
@@ -271,7 +267,7 @@ public class GcloudBigQueryExample {
271267
.build();
272268
// Request query to be executed and wait for results
273269
QueryResponse queryResponse = bigquery.query(queryRequest);
274-
while (!queryResponse.jobCompleted()) {
270+
while (!queryResponse.jobComplete()) {
275271
Thread.sleep(1000L);
276272
queryResponse = bigquery.getQueryResults(queryResponse.jobId());
277273
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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>
45
<artifactId>gcloud-java-bigquery</artifactId>
56
<packaging>jar</packaging>
67
<name>GCloud Java bigquery</name>

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

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

328-
private static final long serialVersionUID = -6851072781269419383L;
329-
330328
private final TableId id;
331329

332330
/**

0 commit comments

Comments
 (0)