Skip to content

Commit 8a1aa78

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 6917 b: refs/heads/tswast-patch-1 c: d1765c7 h: refs/heads/master i: 6915: 62764e8
1 parent 91dbb78 commit 8a1aa78

38 files changed

Lines changed: 452 additions & 964 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 1ab48bbca745376b2e72f81dd09fc9e8dfd97759
60+
refs/heads/tswast-patch-1: d1765c7c5ba2cefe99203f22b06bee1d2dd60751
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/README.md

Lines changed: 45 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services.
66
[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
77
[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
88
[![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java.svg)]( https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java.svg)
9-
[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/gcloud-java)
109

1110
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1211
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs)
@@ -43,17 +42,17 @@ libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.1.3"
4342
Example Applications
4443
--------------------
4544

46-
- [`BigQueryExample`](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/bigquery/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality
45+
- [`BigQueryExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality
4746
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/BigQueryExample.html).
4847
- [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf) - An App Engine app that manages a virtual bookshelf.
4948
- This app uses `gcloud-java` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service.
50-
- [`DatastoreExample`](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/datastore/DatastoreExample.java) - A simple command line interface for the Cloud Datastore
49+
- [`DatastoreExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/DatastoreExample.java) - A simple command line interface for the Cloud Datastore
5150
- 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).
52-
- [`ResourceManagerExample`](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/resourcemanager/ResourceManagerExample.java) - A simple command line interface providing some of Cloud Resource Manager's functionality
51+
- [`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
5352
- 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).
5453
- [`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.
5554
- 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).
56-
- [`StorageExample`](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/storage/StorageExample.java) - A simple command line interface providing some of Cloud Storage's functionality
55+
- [`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
5756
- 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).
5857

5958
Specifying a Project ID
@@ -124,15 +123,15 @@ Google Cloud BigQuery (Alpha)
124123
125124
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you
126125
must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
127-
Complete source code can be found at
128-
[CreateTableAndLoadData.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/bigquery/snippets/CreateTableAndLoadData.java).
129126
130127
```java
131128
import com.google.gcloud.bigquery.BigQuery;
132129
import com.google.gcloud.bigquery.BigQueryOptions;
133130
import com.google.gcloud.bigquery.Field;
134-
import com.google.gcloud.bigquery.FormatOptions;
135131
import com.google.gcloud.bigquery.Job;
132+
import com.google.gcloud.bigquery.JobStatus;
133+
import com.google.gcloud.bigquery.JobInfo;
134+
import com.google.gcloud.bigquery.LoadJobConfiguration;
136135
import com.google.gcloud.bigquery.Schema;
137136
import com.google.gcloud.bigquery.StandardTableDefinition;
138137
import com.google.gcloud.bigquery.Table;
@@ -146,17 +145,19 @@ if (table == null) {
146145
System.out.println("Creating table " + tableId);
147146
Field integerField = Field.of("fieldName", Field.Type.integer());
148147
Schema schema = Schema.of(integerField);
149-
table = bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
150-
}
151-
System.out.println("Loading data into table " + tableId);
152-
Job loadJob = table.load(FormatOptions.csv(), "gs://bucket/path");
153-
while (!loadJob.isDone()) {
154-
Thread.sleep(1000L);
155-
}
156-
if (loadJob.status().error() != null) {
157-
System.out.println("Job completed with errors");
148+
bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
158149
} else {
159-
System.out.println("Job succeeded");
150+
System.out.println("Loading data into table " + tableId);
151+
LoadJobConfiguration configuration = LoadJobConfiguration.of(tableId, "gs://bucket/path");
152+
Job loadJob = bigquery.create(JobInfo.of(configuration));
153+
while (!loadJob.isDone()) {
154+
Thread.sleep(1000L);
155+
}
156+
if (loadJob.status().error() != null) {
157+
System.out.println("Job completed with errors");
158+
} else {
159+
System.out.println("Job succeeded");
160+
}
160161
}
161162
```
162163
@@ -170,32 +171,8 @@ Google Cloud Datastore
170171
171172
#### Preview
172173
173-
Here are two code snippets showing simple usage examples from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
174-
175-
The first snippet shows how to create a Datastore entity. Complete source code can be found at
176-
[CreateEntity.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/datastore/snippets/CreateEntity.java).
177-
178-
```java
179-
import com.google.gcloud.datastore.Datastore;
180-
import com.google.gcloud.datastore.DatastoreOptions;
181-
import com.google.gcloud.datastore.DateTime;
182-
import com.google.gcloud.datastore.Entity;
183-
import com.google.gcloud.datastore.Key;
184-
import com.google.gcloud.datastore.KeyFactory;
174+
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
185175
186-
Datastore datastore = DatastoreOptions.defaultInstance().service();
187-
KeyFactory keyFactory = datastore.newKeyFactory().kind("keyKind");
188-
Key key = keyFactory.newKey("keyName");
189-
Entity entity = Entity.builder(key)
190-
.set("name", "John Doe")
191-
.set("age", 30)
192-
.set("access_time", DateTime.now())
193-
.build();
194-
datastore.put(entity);
195-
```
196-
The second snippet shows how to update a Datastore entity if it exists. Complete source code can be
197-
found at
198-
[UpdateEntity.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/datastore/snippets/UpdateEntity.java).
199176
```java
200177
import com.google.gcloud.datastore.Datastore;
201178
import com.google.gcloud.datastore.DatastoreOptions;
@@ -205,10 +182,17 @@ import com.google.gcloud.datastore.Key;
205182
import com.google.gcloud.datastore.KeyFactory;
206183
207184
Datastore datastore = DatastoreOptions.defaultInstance().service();
208-
KeyFactory keyFactory = datastore.newKeyFactory().kind("keyKind");
209-
Key key = keyFactory.newKey("keyName");
185+
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
186+
Key key = keyFactory.newKey(keyName);
210187
Entity entity = datastore.get(key);
211-
if (entity != null) {
188+
if (entity == null) {
189+
entity = Entity.builder(key)
190+
.set("name", "John Do")
191+
.set("age", 30)
192+
.set("access_time", DateTime.now())
193+
.build();
194+
datastore.put(entity);
195+
} else {
212196
System.out.println("Updating access_time for " + entity.getString("name"));
213197
entity = Entity.builder(entity)
214198
.set("access_time", DateTime.now())
@@ -226,8 +210,7 @@ Google Cloud Resource Manager (Alpha)
226210
#### Preview
227211
228212
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).
229-
Complete source code can be found at
230-
[UpdateAndListProjects.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/resourcemanager/snippets/UpdateAndListProjects.java).
213+
231214
```java
232215
import com.google.gcloud.resourcemanager.Project;
233216
import com.google.gcloud.resourcemanager.ResourceManager;
@@ -236,15 +219,14 @@ import com.google.gcloud.resourcemanager.ResourceManagerOptions;
236219
import java.util.Iterator;
237220
238221
ResourceManager resourceManager = ResourceManagerOptions.defaultInstance().service();
239-
Project project = resourceManager.get("some-project-id"); // Use an existing project's ID
240-
if (project != null) {
241-
Project newProject = project.toBuilder()
242-
.addLabel("launch-status", "in-development")
243-
.build()
244-
.replace();
245-
System.out.println("Updated the labels of project " + newProject.projectId()
246-
+ " to be " + newProject.labels());
247-
}
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());
229+
// List all the projects you have permission to view.
248230
Iterator<Project> projectIterator = resourceManager.list().iterateAll();
249231
System.out.println("Projects I can view:");
250232
while (projectIterator.hasNext()) {
@@ -262,32 +244,13 @@ Google Cloud Storage
262244
263245
#### Preview
264246
265-
Here are two code snippets showing simple usage examples from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
266-
267-
The first snippet shows how to create a Storage blob. Complete source code can be found at
268-
[CreateBlob.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/storage/snippets/CreateBlob.java).
247+
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
269248
270249
```java
271250
import static java.nio.charset.StandardCharsets.UTF_8;
272251
273252
import com.google.gcloud.storage.Blob;
274-
import com.google.gcloud.storage.BlobId;
275253
import com.google.gcloud.storage.BlobInfo;
276-
import com.google.gcloud.storage.Storage;
277-
import com.google.gcloud.storage.StorageOptions;
278-
279-
Storage storage = StorageOptions.defaultInstance().service();
280-
BlobId blobId = BlobId.of("bucket", "blob_name");
281-
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
282-
Blob blob = storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
283-
```
284-
The second snippet shows how to update a Storage blob if it exists. Complete source code can be
285-
found at
286-
[UpdateBlob.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/storage/snippets/UpdateBlob.java).
287-
```java
288-
import static java.nio.charset.StandardCharsets.UTF_8;
289-
290-
import com.google.gcloud.storage.Blob;
291254
import com.google.gcloud.storage.BlobId;
292255
import com.google.gcloud.storage.Storage;
293256
import com.google.gcloud.storage.StorageOptions;
@@ -298,7 +261,11 @@ import java.nio.channels.WritableByteChannel;
298261
Storage storage = StorageOptions.defaultInstance().service();
299262
BlobId blobId = BlobId.of("bucket", "blob_name");
300263
Blob blob = storage.get(blobId);
301-
if (blob != null) {
264+
if (blob == null) {
265+
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
266+
storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
267+
} else {
268+
System.out.println("Updating content for " + blobId.name());
302269
byte[] prevContent = blob.content();
303270
System.out.println(new String(prevContent, UTF_8));
304271
WritableByteChannel channel = blob.writer();

branches/tswast-patch-1/codacy-conf.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

branches/tswast-patch-1/gcloud-java-bigquery/README.md

Lines changed: 83 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Java idiomatic client for [Google Cloud BigQuery] (https://cloud.google.com/bigq
66
[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
77
[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
88
[![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-bigquery.svg)]( https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-bigquery.svg)
9-
[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/gcloud-java)
109

1110
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1211
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/bigquery/package-summary.html)
@@ -35,7 +34,7 @@ libraryDependencies += "com.google.gcloud" % "gcloud-java-bigquery" % "0.1.3"
3534

3635
Example Application
3736
-------------------
38-
- [`BigQueryExample`](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/bigquery/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality.
37+
- [`BigQueryExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality.
3938
Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/BigQueryExample.html).
4039

4140
Authentication
@@ -201,13 +200,91 @@ while (rowIterator.hasNext()) {
201200
```
202201
#### Complete source code
203202

204-
In
205-
[InsertDataAndQueryTable.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/bigquery/snippets/InsertDataAndQueryTable.java)
206-
we put together all the code shown above into one program. The program assumes that you are
207-
running on Compute Engine or from your own desktop. To run the example on App Engine, simply move
203+
Here we put together all the code shown above into one program. This program assumes that you are
204+
running on Compute Engine or from your own desktop. To run this example on App Engine, simply move
208205
the code from the main method to your application's servlet class and change the print statements to
209206
display on your webpage.
210207

208+
```java
209+
import com.google.gcloud.bigquery.BigQuery;
210+
import com.google.gcloud.bigquery.BigQueryOptions;
211+
import com.google.gcloud.bigquery.DatasetInfo;
212+
import com.google.gcloud.bigquery.Field;
213+
import com.google.gcloud.bigquery.FieldValue;
214+
import com.google.gcloud.bigquery.InsertAllRequest;
215+
import com.google.gcloud.bigquery.InsertAllResponse;
216+
import com.google.gcloud.bigquery.QueryRequest;
217+
import com.google.gcloud.bigquery.QueryResponse;
218+
import com.google.gcloud.bigquery.Schema;
219+
import com.google.gcloud.bigquery.StandardTableDefinition;
220+
import com.google.gcloud.bigquery.Table;
221+
import com.google.gcloud.bigquery.TableId;
222+
import com.google.gcloud.bigquery.TableInfo;
223+
224+
import java.util.HashMap;
225+
import java.util.Iterator;
226+
import java.util.List;
227+
import java.util.Map;
228+
229+
public class GcloudBigQueryExample {
230+
231+
public static void main(String[] args) throws InterruptedException {
232+
233+
// Create a service instance
234+
BigQuery bigquery = BigQueryOptions.defaultInstance().service();
235+
236+
// Create a dataset
237+
String datasetId = "my_dataset_id";
238+
bigquery.create(DatasetInfo.builder(datasetId).build());
239+
240+
TableId tableId = TableId.of(datasetId, "my_table_id");
241+
// Table field definition
242+
Field stringField = Field.of("StringField", Field.Type.string());
243+
// Table schema definition
244+
Schema schema = Schema.of(stringField);
245+
// Create a table
246+
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
247+
Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition));
248+
249+
// Define rows to insert
250+
Map<String, Object> firstRow = new HashMap<>();
251+
Map<String, Object> secondRow = new HashMap<>();
252+
firstRow.put("StringField", "value1");
253+
secondRow.put("StringField", "value2");
254+
// Create an insert request
255+
InsertAllRequest insertRequest = InsertAllRequest.builder(tableId)
256+
.addRow(firstRow)
257+
.addRow(secondRow)
258+
.build();
259+
// Insert rows
260+
InsertAllResponse insertResponse = bigquery.insertAll(insertRequest);
261+
// Check if errors occurred
262+
if (insertResponse.hasErrors()) {
263+
System.out.println("Errors occurred while inserting rows");
264+
}
265+
266+
// Create a query request
267+
QueryRequest queryRequest =
268+
QueryRequest.builder("SELECT * FROM my_dataset_id.my_table_id")
269+
.maxWaitTime(60000L)
270+
.maxResults(1000L)
271+
.build();
272+
// Request query to be executed and wait for results
273+
QueryResponse queryResponse = bigquery.query(queryRequest);
274+
while (!queryResponse.jobCompleted()) {
275+
Thread.sleep(1000L);
276+
queryResponse = bigquery.getQueryResults(queryResponse.jobId());
277+
}
278+
// Read rows
279+
Iterator<List<FieldValue>> rowIterator = queryResponse.result().iterateAll();
280+
System.out.println("Table rows:");
281+
while (rowIterator.hasNext()) {
282+
System.out.println(rowIterator.next());
283+
}
284+
}
285+
}
286+
```
287+
211288
Troubleshooting
212289
---------------
213290

branches/tswast-patch-1/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/InsertAllRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public Builder addRow(RowToInsert rowToInsert) {
177177
* Adds a row to be inserted with associated id.
178178
*
179179
* <p>Example usage of adding a row with associated id:
180-
* <pre> {@code
180+
* <pre> {@code
181181
* InsertAllRequest.Builder builder = InsertAllRequest.builder(tableId);
182182
* List<Long> repeatedFieldValue = Arrays.asList(1L, 2L);
183183
* Map<String, Object> recordContent = new HashMap<String, Object>();
@@ -198,7 +198,7 @@ public Builder addRow(String id, Map<String, Object> content) {
198198
* Adds a row to be inserted without an associated id.
199199
*
200200
* <p>Example usage of adding a row without an associated id:
201-
* <pre> {@code
201+
* <pre> {@code
202202
* InsertAllRequest.Builder builder = InsertAllRequest.builder(tableId);
203203
* List<Long> repeatedFieldValue = Arrays.asList(1L, 2L);
204204
* Map<String, Object> recordContent = new HashMap<String, Object>();

branches/tswast-patch-1/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/QueryRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* {@link QueryResponse#jobCompleted()} returns {@code true}.
3636
*
3737
* <p>Example usage of a query request:
38-
* <pre> {@code
38+
* <pre> {@code
3939
* // Substitute "field", "table" and "dataset" with real field, table and dataset identifiers
4040
* QueryRequest request = QueryRequest.builder("SELECT field FROM table")
4141
* .defaultDataset(DatasetId.of("dataset"))

0 commit comments

Comments
 (0)