Skip to content

Commit 59ac7b1

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 3573 b: refs/heads/pubsub-alpha c: d1765c7 h: refs/heads/master i: 3571: 77a99bd
1 parent ee5ff2f commit 59ac7b1

150 files changed

Lines changed: 7905 additions & 11327 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
@@ -2,7 +2,7 @@
22
refs/heads/master: 36a62ef856d199f8efd09501b5ba65c422c01f23
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 7406918e071dd2c5677a638ae2a06e7592b6542c
5-
refs/heads/pubsub-alpha: 030e8198afd31017bb49d2944ba889a016495164
5+
refs/heads/pubsub-alpha: d1765c7c5ba2cefe99203f22b06bee1d2dd60751
66
refs/heads/update-datastore: 47aae517c2cb33f1dccd909adaced73ec9d0f4df
77
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
88
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd

branches/pubsub-alpha/README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ If you are using Maven, add this to your pom.xml file
2727
<dependency>
2828
<groupId>com.google.gcloud</groupId>
2929
<artifactId>gcloud-java</artifactId>
30-
<version>0.1.2</version>
30+
<version>0.1.3</version>
3131
</dependency>
3232
```
3333
If you are using Gradle, add this to your dependencies
3434
```Groovy
35-
compile 'com.google.gcloud:gcloud-java:0.1.2'
35+
compile 'com.google.gcloud:gcloud-java:0.1.3'
3636
```
3737
If you are using SBT, add this to your dependencies
3838
```Scala
39-
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.1.2"
39+
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.1.3"
4040
```
4141

4242
Example Applications
@@ -50,8 +50,8 @@ Example Applications
5050
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/DatastoreExample.html).
5151
- [`ResourceManagerExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/ResourceManagerExample.java) - A simple command line interface providing some of Cloud Resource Manager's functionality
5252
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/ResourceManagerExample.html).
53-
- [`SparkDemo`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava) - An example of using gcloud-java-datastore from within the SparkJava and App Engine Managed VM frameworks.
54-
- Read about how it works on the example's [README page](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/managedvms/sparkjava#how-does-it-work).
53+
- [`SparkDemo`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managed_vms/sparkjava) - An example of using gcloud-java-datastore from within the SparkJava and App Engine Managed VM frameworks.
54+
- Read about how it works on the example's [README page](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/managed_vms/sparkjava#how-does-it-work).
5555
- [`StorageExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java) - A simple command line interface providing some of Cloud Storage's functionality
5656
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/StorageExample.html).
5757

@@ -125,30 +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;
133-
import com.google.gcloud.bigquery.LoadJobInfo;
133+
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);
147-
LoadJobInfo loadJob = LoadJobInfo.of(tableId, "gs://bucket/path");
148-
loadJob = bigquery.create(loadJob);
149-
while (loadJob.status().state() != JobStatus.State.DONE) {
151+
LoadJobConfiguration configuration = LoadJobConfiguration.of(tableId, "gs://bucket/path");
152+
Job loadJob = bigquery.create(JobInfo.of(configuration));
153+
while (!loadJob.isDone()) {
150154
Thread.sleep(1000L);
151-
loadJob = bigquery.getJob(loadJob.jobId());
152155
}
153156
if (loadJob.status().error() != null) {
154157
System.out.println("Job completed with errors");
@@ -209,20 +212,22 @@ Google Cloud Resource Manager (Alpha)
209212
Here is a code snippet showing a simple usage example. Note that you must supply Google SDK credentials for this service, not other forms of authentication listed in the [Authentication section](#authentication).
210213
211214
```java
212-
import com.google.gcloud.resourcemanager.ProjectInfo;
215+
import com.google.gcloud.resourcemanager.Project;
213216
import com.google.gcloud.resourcemanager.ResourceManager;
214217
import com.google.gcloud.resourcemanager.ResourceManagerOptions;
215218
216219
import java.util.Iterator;
217220
218221
ResourceManager resourceManager = ResourceManagerOptions.defaultInstance().service();
219-
ProjectInfo myProject = resourceManager.get("some-project-id"); // Use an existing project's ID
220-
ProjectInfo newProjectInfo = resourceManager.replace(myProject.toBuilder()
221-
.addLabel("launch-status", "in-development").build());
222-
System.out.println("Updated the labels of project " + newProjectInfo.projectId()
223-
+ " to be " + newProjectInfo.labels());
222+
Project myProject = resourceManager.get("some-project-id"); // Use an existing project's ID
223+
Project newProject = myProject.toBuilder()
224+
.addLabel("launch-status", "in-development")
225+
.build()
226+
.replace();
227+
System.out.println("Updated the labels of project " + newProject.projectId()
228+
+ " to be " + newProject.labels());
224229
// List all the projects you have permission to view.
225-
Iterator<ProjectInfo> projectIterator = resourceManager.list().iterateAll();
230+
Iterator<Project> projectIterator = resourceManager.list().iterateAll();
226231
System.out.println("Projects I can view:");
227232
while (projectIterator.hasNext()) {
228233
System.out.println(projectIterator.next().projectId());
@@ -245,6 +250,7 @@ Here is a code snippet showing a simple usage example from within Compute/App En
245250
import static java.nio.charset.StandardCharsets.UTF_8;
246251
247252
import com.google.gcloud.storage.Blob;
253+
import com.google.gcloud.storage.BlobInfo;
248254
import com.google.gcloud.storage.BlobId;
249255
import com.google.gcloud.storage.Storage;
250256
import com.google.gcloud.storage.StorageOptions;
@@ -254,7 +260,7 @@ import java.nio.channels.WritableByteChannel;
254260
255261
Storage storage = StorageOptions.defaultInstance().service();
256262
BlobId blobId = BlobId.of("bucket", "blob_name");
257-
Blob blob = Blob.get(storage, blobId);
263+
Blob blob = storage.get(blobId);
258264
if (blob == null) {
259265
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
260266
storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));

branches/pubsub-alpha/RELEASING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ As mentioned before, there is an optional version argument. By default, the scr
2626

2727
6. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).
2828

29+
7. Be sure to update App Engine documentation and [java-docs-samples](https://github.com/GoogleCloudPlatform/java-docs-samples) code as necessary. See directions [here](https://docs.google.com/a/google.com/document/d/1SS3xNn2v0qW7EadGUPBUAPIQAH5VY6WSFmT17ZjjUVE/edit?usp=sharing).
30+
2931
### To push a snapshot version
3032

3133
Pushing a snapshot is completely automated. If "-SNAPSHOT" is included in the version denoted by the base directory's pom.xml, then an updated artifact will be pushed to the snapshot repository when Travis CI successfully completes a non-PR build.

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ If you are using Maven, add this to your pom.xml file
2020
<dependency>
2121
<groupId>com.google.gcloud</groupId>
2222
<artifactId>gcloud-java-bigquery</artifactId>
23-
<version>0.1.2</version>
23+
<version>0.1.3</version>
2424
</dependency>
2525
```
2626
If you are using Gradle, add this to your dependencies
2727
```Groovy
28-
compile 'com.google.gcloud:gcloud-java-bigquery:0.1.2'
28+
compile 'com.google.gcloud:gcloud-java-bigquery:0.1.3'
2929
```
3030
If you are using SBT, add this to your dependencies
3131
```Scala
32-
libraryDependencies += "com.google.gcloud" % "gcloud-java-bigquery" % "0.1.2"
32+
libraryDependencies += "com.google.gcloud" % "gcloud-java-bigquery" % "0.1.3"
3333
```
3434

3535
Example Application
@@ -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: 1 addition & 2 deletions
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>
@@ -11,7 +10,7 @@
1110
<parent>
1211
<groupId>com.google.gcloud</groupId>
1312
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.1.3-SNAPSHOT</version>
13+
<version>0.1.4-SNAPSHOT</version>
1514
</parent>
1615
<properties>
1716
<site.installationModule>gcloud-java-bigquery</site.installationModule>

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)