Skip to content

Commit 6e0d7d8

Browse files
committed
---
yaml --- r: 6899 b: refs/heads/tswast-patch-1 c: d2dbd99 h: refs/heads/master i: 6897: 8b2dc62 6895: 0f33116
1 parent fc5f9bc commit 6e0d7d8

31 files changed

Lines changed: 1549 additions & 1144 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: 3f39ab2edf65cc2184baf0d2a964711ac98b02aa
60+
refs/heads/tswast-patch-1: d2dbd99056186fde1f41fd33f2ca7e6c853a00f0
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ Here is a code snippet showing a simple usage example from within Compute/App En
250250
import static java.nio.charset.StandardCharsets.UTF_8;
251251
252252
import com.google.gcloud.storage.Blob;
253+
import com.google.gcloud.storage.BlobInfo;
253254
import com.google.gcloud.storage.BlobId;
254255
import com.google.gcloud.storage.Storage;
255256
import com.google.gcloud.storage.StorageOptions;
@@ -259,7 +260,7 @@ import java.nio.channels.WritableByteChannel;
259260
260261
Storage storage = StorageOptions.defaultInstance().service();
261262
BlobId blobId = BlobId.of("bucket", "blob_name");
262-
Blob blob = Blob.get(storage, blobId);
263+
Blob blob = storage.get(blobId);
263264
if (blob == null) {
264265
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
265266
storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));

branches/tswast-patch-1/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/tswast-patch-1/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ public boolean delete() {
182182
* @param rows rows to be inserted
183183
* @throws BigQueryException upon failure
184184
*/
185-
InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows) throws BigQueryException {
185+
public InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows)
186+
throws BigQueryException {
186187
return bigquery.insertAll(InsertAllRequest.of(tableId(), rows));
187188
}
188189

@@ -197,8 +198,8 @@ InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows) throws Big
197198
* to be invalid
198199
* @throws BigQueryException upon failure
199200
*/
200-
InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows, boolean skipInvalidRows,
201-
boolean ignoreUnknownValues) throws BigQueryException {
201+
public InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows,
202+
boolean skipInvalidRows, boolean ignoreUnknownValues) throws BigQueryException {
202203
InsertAllRequest request = InsertAllRequest.builder(tableId(), rows)
203204
.skipInvalidRows(skipInvalidRows)
204205
.ignoreUnknownValues(ignoreUnknownValues)
@@ -212,7 +213,7 @@ InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows, boolean sk
212213
* @param options table data list options
213214
* @throws BigQueryException upon failure
214215
*/
215-
Page<List<FieldValue>> list(BigQuery.TableDataListOption... options) throws BigQueryException {
216+
public Page<List<FieldValue>> list(BigQuery.TableDataListOption... options) throws BigQueryException {
216217
return bigquery.listTableData(tableId(), options);
217218
}
218219

@@ -225,7 +226,7 @@ Page<List<FieldValue>> list(BigQuery.TableDataListOption... options) throws BigQ
225226
* @param options job options
226227
* @throws BigQueryException upon failure
227228
*/
228-
Job copy(String destinationDataset, String destinationTable, BigQuery.JobOption... options)
229+
public Job copy(String destinationDataset, String destinationTable, BigQuery.JobOption... options)
229230
throws BigQueryException {
230231
return copy(TableId.of(destinationDataset, destinationTable), options);
231232
}
@@ -238,7 +239,8 @@ Job copy(String destinationDataset, String destinationTable, BigQuery.JobOption.
238239
* @param options job options
239240
* @throws BigQueryException upon failure
240241
*/
241-
Job copy(TableId destinationTable, BigQuery.JobOption... options) throws BigQueryException {
242+
public Job copy(TableId destinationTable, BigQuery.JobOption... options)
243+
throws BigQueryException {
242244
CopyJobConfiguration configuration = CopyJobConfiguration.of(destinationTable, tableId());
243245
return bigquery.create(JobInfo.of(configuration), options);
244246
}
@@ -253,7 +255,7 @@ Job copy(TableId destinationTable, BigQuery.JobOption... options) throws BigQuer
253255
* @param options job options
254256
* @throws BigQueryException upon failure
255257
*/
256-
Job extract(String format, String destinationUri, BigQuery.JobOption... options)
258+
public Job extract(String format, String destinationUri, BigQuery.JobOption... options)
257259
throws BigQueryException {
258260
return extract(format, ImmutableList.of(destinationUri), options);
259261
}
@@ -268,7 +270,7 @@ Job extract(String format, String destinationUri, BigQuery.JobOption... options)
268270
* @param options job options
269271
* @throws BigQueryException upon failure
270272
*/
271-
Job extract(String format, List<String> destinationUris, BigQuery.JobOption... options)
273+
public Job extract(String format, List<String> destinationUris, BigQuery.JobOption... options)
272274
throws BigQueryException {
273275
ExtractJobConfiguration extractConfiguration =
274276
ExtractJobConfiguration.of(tableId(), destinationUris, format);
@@ -285,7 +287,7 @@ Job extract(String format, List<String> destinationUris, BigQuery.JobOption... o
285287
* @param options job options
286288
* @throws BigQueryException upon failure
287289
*/
288-
Job load(FormatOptions format, String sourceUri, BigQuery.JobOption... options)
290+
public Job load(FormatOptions format, String sourceUri, BigQuery.JobOption... options)
289291
throws BigQueryException {
290292
return load(format, ImmutableList.of(sourceUri), options);
291293
}
@@ -300,7 +302,7 @@ Job load(FormatOptions format, String sourceUri, BigQuery.JobOption... options)
300302
* @param options job options
301303
* @throws BigQueryException upon failure
302304
*/
303-
Job load(FormatOptions format, List<String> sourceUris, BigQuery.JobOption... options)
305+
public Job load(FormatOptions format, List<String> sourceUris, BigQuery.JobOption... options)
304306
throws BigQueryException {
305307
LoadJobConfiguration loadConfig = LoadJobConfiguration.of(tableId(), sourceUris, format);
306308
return bigquery.create(JobInfo.of(loadConfig), options);

branches/tswast-patch-1/gcloud-java-contrib/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-contrib</artifactId>
65
<packaging>jar</packaging>
76
<name>GCloud Java contributions</name>

branches/tswast-patch-1/gcloud-java-core/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-core</artifactId>
65
<packaging>jar</packaging>
76
<name>GCloud Java core</name>

branches/tswast-patch-1/gcloud-java-datastore/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-datastore</artifactId>
65
<packaging>jar</packaging>
76
<name>GCloud Java datastore</name>

branches/tswast-patch-1/gcloud-java-examples/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-examples</artifactId>
65
<packaging>jar</packaging>
76
<name>GCloud Java examples</name>

branches/tswast-patch-1/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.gcloud.storage.BlobId;
2626
import com.google.gcloud.storage.BlobInfo;
2727
import com.google.gcloud.storage.Bucket;
28-
import com.google.gcloud.storage.BucketInfo;
2928
import com.google.gcloud.storage.CopyWriter;
3029
import com.google.gcloud.storage.Storage;
3130
import com.google.gcloud.storage.Storage.ComposeRequest;
@@ -133,27 +132,27 @@ public void run(Storage storage, BlobId... blobIds) {
133132
if (blobIds.length == 1) {
134133
if (blobIds[0].name().isEmpty()) {
135134
// get Bucket
136-
Bucket bucket = Bucket.get(storage, blobIds[0].bucket());
135+
Bucket bucket = storage.get(blobIds[0].bucket());
137136
if (bucket == null) {
138137
System.out.println("No such bucket");
139138
return;
140139
}
141-
System.out.println("Bucket info: " + bucket.info());
140+
System.out.println("Bucket info: " + bucket);
142141
} else {
143142
// get Blob
144-
Blob blob = Blob.get(storage, blobIds[0]);
143+
Blob blob = storage.get(blobIds[0]);
145144
if (blob == null) {
146145
System.out.println("No such object");
147146
return;
148147
}
149-
System.out.println("Blob info: " + blob.info());
148+
System.out.println("Blob info: " + blob);
150149
}
151150
} else {
152151
// use batch to get multiple blobs.
153-
List<Blob> blobs = Blob.get(storage, Arrays.asList(blobIds));
152+
List<Blob> blobs = storage.get(blobIds);
154153
for (Blob blob : blobs) {
155154
if (blob != null) {
156-
System.out.println(blob.info());
155+
System.out.println(blob);
157156
}
158157
}
159158
}
@@ -184,7 +183,7 @@ private static class DeleteAction extends BlobsAction {
184183
@Override
185184
public void run(Storage storage, BlobId... blobIds) {
186185
// use batch operation
187-
List<Boolean> deleteResults = Blob.delete(storage, blobIds);
186+
List<Boolean> deleteResults = storage.delete(blobIds);
188187
int index = 0;
189188
for (Boolean deleted : deleteResults) {
190189
if (deleted) {
@@ -218,20 +217,20 @@ String parse(String... args) {
218217
public void run(Storage storage, String bucketName) {
219218
if (bucketName == null) {
220219
// list buckets
221-
Iterator<BucketInfo> bucketInfoIterator = storage.list().iterateAll();
222-
while (bucketInfoIterator.hasNext()) {
223-
System.out.println(bucketInfoIterator.next());
220+
Iterator<Bucket> bucketIterator = storage.list().iterateAll();
221+
while (bucketIterator.hasNext()) {
222+
System.out.println(bucketIterator.next());
224223
}
225224
} else {
226225
// list a bucket's blobs
227-
Bucket bucket = Bucket.get(storage, bucketName);
226+
Bucket bucket = storage.get(bucketName);
228227
if (bucket == null) {
229228
System.out.println("No such bucket");
230229
return;
231230
}
232231
Iterator<Blob> blobIterator = bucket.list().iterateAll();
233232
while (blobIterator.hasNext()) {
234-
System.out.println(blobIterator.next().info());
233+
System.out.println(blobIterator.next());
235234
}
236235
}
237236
}
@@ -257,8 +256,7 @@ private void run(Storage storage, Path uploadFrom, BlobInfo blobInfo) throws IOE
257256
if (Files.size(uploadFrom) > 1_000_000) {
258257
// When content is not available or large (1MB or more) it is recommended
259258
// to write it in chunks via the blob's channel writer.
260-
Blob blob = new Blob(storage, blobInfo);
261-
try (WriteChannel writer = blob.writer()) {
259+
try (WriteChannel writer = storage.writer(blobInfo)) {
262260
byte[] buffer = new byte[1024];
263261
try (InputStream input = Files.newInputStream(uploadFrom)) {
264262
int limit;
@@ -311,7 +309,7 @@ public void run(Storage storage, Tuple<BlobId, Path> tuple) throws IOException {
311309
}
312310

313311
private void run(Storage storage, BlobId blobId, Path downloadTo) throws IOException {
314-
Blob blob = Blob.get(storage, blobId);
312+
Blob blob = storage.get(blobId);
315313
if (blob == null) {
316314
System.out.println("No such object");
317315
return;
@@ -320,7 +318,7 @@ private void run(Storage storage, BlobId blobId, Path downloadTo) throws IOExcep
320318
if (downloadTo != null) {
321319
writeTo = new PrintStream(new FileOutputStream(downloadTo.toFile()));
322320
}
323-
if (blob.info().size() < 1_000_000) {
321+
if (blob.size() < 1_000_000) {
324322
// Blob is small read all its content in one request
325323
byte[] content = blob.content();
326324
writeTo.write(content);
@@ -438,13 +436,13 @@ public void run(Storage storage, Tuple<BlobId, Map<String, String>> tuple)
438436
}
439437

440438
private void run(Storage storage, BlobId blobId, Map<String, String> metadata) {
441-
Blob blob = Blob.get(storage, blobId);
439+
Blob blob = storage.get(blobId);
442440
if (blob == null) {
443441
System.out.println("No such object");
444442
return;
445443
}
446-
Blob updateBlob = blob.update(blob.info().toBuilder().metadata(metadata).build());
447-
System.out.println("Updated " + updateBlob.info());
444+
Blob updateBlob = blob.toBuilder().metadata(metadata).build().update();
445+
System.out.println("Updated " + updateBlob);
448446
}
449447

450448
@Override
@@ -488,9 +486,8 @@ public void run(Storage storage, Tuple<ServiceAccountAuthCredentials, BlobInfo>
488486
run(storage, tuple.x(), tuple.y());
489487
}
490488

491-
private void run(Storage storage, ServiceAccountAuthCredentials cred, BlobInfo blobInfo)
492-
throws IOException {
493-
Blob blob = new Blob(storage, blobInfo);
489+
private void run(Storage storage, ServiceAccountAuthCredentials cred, BlobInfo blobInfo) {
490+
Blob blob = storage.get(blobInfo.blobId());
494491
System.out.println("Signed URL: "
495492
+ blob.signUrl(1, TimeUnit.DAYS, SignUrlOption.serviceAccount(cred)));
496493
}

branches/tswast-patch-1/gcloud-java-resourcemanager/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-resourcemanager</artifactId>
65
<packaging>jar</packaging>
76
<name>GCloud Java resource manager</name>

0 commit comments

Comments
 (0)