Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
5e0de55
Add options(namespace) method to LocalDatastoreHelper (#936)
mziccard Apr 18, 2016
e213176
Add support for batches to DNS (#940)
mziccard Apr 20, 2016
0a6c6f7
Chain cause exception to service exception in translateAndThrow (#946)
mziccard Apr 21, 2016
121783a
Make DNS batch get zone/changerequest return null for NOT_FOUND (#953)
mziccard Apr 22, 2016
766a76d
Revert maven-source-plugin to version 2.4 to speed up builds (#961)
mziccard Apr 28, 2016
90894b3
Add gcloud-java-compute module
mziccard Feb 22, 2016
a566ef4
Add Compute Engine immutable resources
mziccard Feb 22, 2016
c9f028e
Add DeprecationStatus to disk and machine type, other fixes
mziccard Feb 22, 2016
35fc77d
Migrate IDs from Long to BigInteger
mziccard Feb 23, 2016
d34490f
Add deprecation status to zone and region
mziccard Feb 24, 2016
785c3fe
Add test for missing fields, fix NPE, minor docs and lint fixes
mziccard Feb 24, 2016
feec3f1
Add matchesUrl method to identity objects. Add tests
mziccard Feb 24, 2016
9bd877a
Refactor Compute immutable resources' identities and classes
mziccard Feb 29, 2016
bf2a408
Remove tab indentation from compute's pom.xml
mziccard Feb 29, 2016
41f7ab7
Replace com.google.api.client.util.DateTime with Joda formatter
mziccard Mar 1, 2016
7fc133e
Add service methods for immutable Compute resources
mziccard Mar 1, 2016
566c581
Add RemoteComputeHelper and integration tests
mziccard Mar 1, 2016
c9add80
Refactor compute service
mziccard Mar 4, 2016
e1712e9
Add support for Compute's operations
mziccard Mar 8, 2016
091d7a8
Fix Compute operations issues
mziccard Mar 10, 2016
29f2bad
Rename maxResults to pageSize, add tests for pagination
mziccard Mar 13, 2016
8fad79d
Refactor compute operations
mziccard Mar 15, 2016
ba4fcf0
Remove final from immutable resource classes
mziccard Mar 15, 2016
de30a25
Operations: better javadoc for delete, stricter parsing of identities
mziccard Mar 16, 2016
3565376
Add support for Compute's addresses
mziccard Mar 16, 2016
f3c30f1
Provide better javadoc to address related classes
mziccard Mar 17, 2016
2d691aa
Refactor identity classes
mziccard Mar 21, 2016
6e1a3f9
Refactor Address and AddressInfo classes
mziccard Mar 21, 2016
e56cb4b
Remove unused imports
mziccard Mar 21, 2016
6f9ff34
Refactor Compute service class
mziccard Mar 21, 2016
514e3fe
Better javadoc for RemoteComputeHelper.baseResourceName
mziccard Mar 21, 2016
9cf9309
Make AddressInfo.builder return Builder instead of BuilderImpl
mziccard Mar 21, 2016
1d5f171
Use TO_PB_FUNCTION when possible in ComputeImplTest
mziccard Mar 22, 2016
44fedd6
Remove repeated casts in identities'equals method
mziccard Mar 22, 2016
f36d92c
Replace 'an unique' with 'the unique' everywhere
mziccard Mar 22, 2016
4c8f888
Add SnapshotInfo, related classes and tests
mziccard Mar 22, 2016
65fdd48
Add SnapshotInfo and related classes to SerializationTest, minor fixes
mziccard Mar 23, 2016
36ddd14
Add functional methods for snapshots and Snapshot class
mziccard Mar 23, 2016
f66ea60
Fix minor issues with functional snapshot methods and tests
mziccard Mar 24, 2016
de2a6b4
Add missing final, fix codacy issues
mziccard Mar 25, 2016
2d8d0ec
Better javadoc for aggregated list methods
mziccard Mar 25, 2016
5d2c682
Add ImageInfo and related non-functional classes
mziccard Mar 31, 2016
cd08330
Add functional methods for images and Image class
mziccard Apr 2, 2016
e7866b2
Add DiskInfo, disk configurations and test classes
mziccard Apr 7, 2016
f085a41
Add functional methods for disks and Disk class (#870)
mziccard Apr 11, 2016
5bb3e9d
Move Compute's spi package to compute.spi (#901)
mziccard Apr 12, 2016
382ab77
Add RemoteComputeHelperTest (#900)
mziccard Apr 12, 2016
6e2c262
Compute Operation: remove creationTimestamp field and fix isDone() (#…
mziccard Apr 13, 2016
a4f9f2d
Fix compute homepage URL (#927)
mziccard Apr 15, 2016
282f1fc
Add SubnetworkInfo, NetworkId, SubnetworkId and test classes (#895)
mziccard Apr 19, 2016
e15ed45
Add NetworkInfo, configuration classes and tests (#941)
mziccard Apr 19, 2016
ec9c0f1
Add functional methods for networks and subnetworks (#944)
mziccard Apr 20, 2016
19227df
Chain cause in ComputeException.translateAndThrow, add tests (#948)
mziccard Apr 20, 2016
4fb78d8
Add NetworkInterface, AccessConfig classes and related tests (#947)
mziccard Apr 22, 2016
428fdbd
Add AttachedDisk class, related configurations and tests (#917)
mziccard Apr 25, 2016
20032e7
Add InstanceInfo, related classes and tests (#955)
mziccard Apr 26, 2016
cdf660c
Rename type name getters (#957)
mziccard Apr 26, 2016
9d1d455
Add functional methods for instances, Instance class and tests (#959)
mziccard Apr 27, 2016
b8989f3
Add travis_wait directive before verify script (#965)
mziccard Apr 27, 2016
4888e12
Rename id to generatedId for Compute resources (#966)
mziccard Apr 27, 2016
77821f5
Compute: rename get/delete methods to getXxx/deleteXxx (#968)
mziccard Apr 28, 2016
d77974a
Add Compute examples and snippets. Add them to READMEs. (#967)
mziccard Apr 29, 2016
dd0b186
Rename package com.google.gcloud to com.google.cloud
mziccard Apr 29, 2016
17c6eba
Use BaseSerializationTest in compute's serialization test
mziccard Apr 29, 2016
ae0a6d2
Use FieldSelector interface and Helper in compute
mziccard Apr 29, 2016
f0ae430
Update Compute equals methods to support mocking
mziccard Apr 29, 2016
22fb41f
Merge pull request #970 from mziccard/compute-alpha
mziccard Apr 29, 2016
8e38d5b
Release 0.2.1
mziccard Apr 29, 2016
076e5bf
Merge pull request #971 from mziccard/release-0.2.1
mziccard Apr 29, 2016
3c8da93
Updating version in README files. [ci skip]
Apr 29, 2016
ddee42f
update version to 0.2.2-SNAPSHOT
mziccard Apr 29, 2016
82023df
Merge pull request #973 from mziccard/update-to-0.2.2-SNAPSHOT
mziccard Apr 29, 2016
c339bf8
Re-enable ignored BigQuery integration tests (#986)
mziccard May 6, 2016
a8a88d1
Use new datastore client that permits IP addresses for localhost (#1002)
ajkannan May 12, 2016
8fc4f7a
Make LocalDatastoreHelper use https instead of http (#942)
pehrs May 12, 2016
af79f8f
Refactor Datastore example, add example on embedded entities (#980)
mziccard May 13, 2016
554b03e
Fix StorageImpl.signUrl with object names starting with / (#1013)
mziccard May 17, 2016
d5cf726
Fix readAllBytes permission error on GAE (#1010)
mziccard May 18, 2016
4c0332e
Move Clock out of ServiceOptions, use it in RetryHelper (#954)
mziccard May 20, 2016
e921bbe
Refactor storage batches to use StorageBatchRequest and BatchResult (…
mziccard May 20, 2016
e835197
Release 0.2.2
mziccard May 20, 2016
838a583
Merge pull request #1019 from mziccard/release-0.2.2
mziccard May 20, 2016
4aa33a1
Updating version in README files. [ci skip]
May 20, 2016
1b913b9
Update version to 0.2.3-SNAPSHOT
mziccard May 20, 2016
fceeb65
Merge pull request #1020 from mziccard/update-to-0.2.3-SNAPSHOT
mziccard May 20, 2016
11f4573
Add OAuth2AuthCredentials class and tests (#1030)
mziccard May 28, 2016
d3a49ea
Add createTime() to BlobInfo and Blob classes (#1034)
mziccard Jun 1, 2016
eb6f182
Add support for incomplete entities to Datastore.put (#1040)
mziccard Jun 8, 2016
f176d81
Extend StorageExample to show how to add ACLs to blobs and buckets (#…
mziccard Jun 8, 2016
3b35a9e
Add whenDone method and CompletionCallback to Job and Operation (#1016)
mziccard Jun 9, 2016
6539fbf
Update bigquery dependency and add support for BYTES datatype (#1045)
mziccard Jun 10, 2016
cb57550
Release 0.2.3
mziccard Jun 10, 2016
539a17d
Merge pull request #1050 from mziccard/release-0.2.3
mziccard Jun 10, 2016
adb2f65
Updating version in README files. [ci skip]
Jun 10, 2016
45e2751
Update version to 0.2.4-SNAPSHOT
mziccard Jun 10, 2016
20e5280
Merge pull request #1051 from mziccard/update-to-0.2.4-SNAPSHOT
mziccard Jun 10, 2016
fe90bc0
Merge branch 'master' into gcs-nio
jart Jun 13, 2016
1ac7ecd
Update pom.xml versions
jart Jun 13, 2016
6c47760
FakeStorageRpc with master changes
jart Jun 13, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ before_install:
- cp target/travis/settings.xml ~/.m2/settings.xml
install: mvn install -DskipTests=true -Dgpg.skip=true
script:
- utilities/verify.sh
- travis_wait 30 utilities/verify.sh
after_success:
- utilities/after_success.sh
env:
Expand Down
97 changes: 87 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services.
This client supports the following Google Cloud Platform services:

- [Google Cloud BigQuery] (#google-cloud-bigquery-alpha) (Alpha)
- [Google Cloud Compute] (#google-cloud-compute-alpha) (Alpha)
- [Google Cloud Datastore] (#google-cloud-datastore)
- [Google Cloud DNS] (#google-cloud-dns-alpha) (Alpha)
- [Google Cloud Resource Manager] (#google-cloud-resource-manager-alpha) (Alpha)
Expand All @@ -33,23 +34,25 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>gcloud-java</artifactId>
<version>0.2.0</version>
<version>0.2.3</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:gcloud-java:0.2.0'
compile 'com.google.cloud:gcloud-java:0.2.3'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "gcloud-java" % "0.2.0"
libraryDependencies += "com.google.cloud" % "gcloud-java" % "0.2.3"
```

Example Applications
--------------------

- [`BigQueryExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/bigquery/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality
- Read more about using this application on the [`BigQueryExample` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/cloud/examples/bigquery/BigQueryExample.html).
- [`ComputeExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java) - A simple command line interface providing some of Cloud Compute's functionality
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/cloud/examples/compute/ComputeExample.html).
- [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf) - An App Engine app that manages a virtual bookshelf.
- This app uses `gcloud-java` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service.
- [`DatastoreExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java) - A simple command line interface for Cloud Datastore
Expand Down Expand Up @@ -104,7 +107,7 @@ First, ensure that the necessary Google Cloud APIs are enabled for your project.
Next, choose a method for authenticating API requests from within your project:

1. When using `gcloud-java` libraries from within Compute/App Engine, no additional authentication steps are necessary.
2. When using `gcloud-java` libraries elsewhere, there are two options:
2. When using `gcloud-java` libraries elsewhere, there are three options:
* [Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). After downloading that key, you must do one of the following:
* Define the environment variable GOOGLE_APPLICATION_CREDENTIALS to be the location of the key. For example:
```bash
Expand All @@ -113,11 +116,18 @@ Next, choose a method for authenticating API requests from within your project:
* Supply the JSON credentials file when building the service options. For example, this Storage object has the necessary permissions to interact with your Google Cloud Storage data:
```java
Storage storage = StorageOptions.builder()
.authCredentials(AuthCredentials.createForJson(new FileInputStream("/path/to/my/key.json"))
.authCredentials(AuthCredentials.createForJson(new FileInputStream("/path/to/my/key.json"))
.build()
.service();
```
* If running locally for development/testing, you can use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login` in command line). Be sure to set your project ID as described above.
* If you already have an OAuth2 access token, you can use it to authenticate (notice that in this case the access token will not be automatically refreshed):
```java
Storage storage = StorageOptions.builder()
.authCredentials(AuthCredentials.createFor("your_access_token"))
.build()
.service();
```
* If running locally for development/testing, you can use use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login` in command line). Be sure to set your project ID as described above.
```

`gcloud-java` looks for credentials in the following order, stopping once it finds credentials:

Expand Down Expand Up @@ -163,16 +173,79 @@ if (table == null) {
}
System.out.println("Loading data into table " + tableId);
Job loadJob = table.load(FormatOptions.csv(), "gs://bucket/path");
while (!loadJob.isDone()) {
Thread.sleep(1000L);
}
loadJob = loadJob.waitFor();
if (loadJob.status().error() != null) {
System.out.println("Job completed with errors");
} else {
System.out.println("Job succeeded");
}
```

Google Cloud Compute (Alpha)
----------------------

- [API Documentation][compute-api]
- [Official Documentation][cloud-compute-docs]

#### Preview

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.

The first snippet shows how to create a snapshot from an existing disk. Complete source code can be
found at
[CreateSnapshot.java](./gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/snippets/CreateSnapshot.java).

```java
import com.google.cloud.compute.Compute;
import com.google.cloud.compute.ComputeOptions;
import com.google.cloud.compute.Disk;
import com.google.cloud.compute.DiskId;
import com.google.cloud.compute.Snapshot;

Compute compute = ComputeOptions.defaultInstance().service();
DiskId diskId = DiskId.of("us-central1-a", "disk-name");
Disk disk = compute.getDisk(diskId, Compute.DiskOption.fields());
if (disk != null) {
String snapshotName = "disk-name-snapshot";
Operation operation = disk.createSnapshot(snapshotName);
operation = operation.waitFor();
if (operation.errors() == null) {
// use snapshot
Snapshot snapshot = compute.getSnapshot(snapshotName);
}
}
```
The second snippet shows how to create a virtual machine instance. Complete source code can be found
at
[CreateInstance.java](./gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/snippets/CreateInstance.java).
```java
import com.google.cloud.compute.AttachedDisk;
import com.google.cloud.compute.Compute;
import com.google.cloud.compute.ComputeOptions;
import com.google.cloud.compute.ImageId;
import com.google.cloud.compute.Instance;
import com.google.cloud.compute.InstanceId;
import com.google.cloud.compute.InstanceInfo;
import com.google.cloud.compute.MachineTypeId;
import com.google.cloud.compute.NetworkId;

Compute compute = ComputeOptions.defaultInstance().service();
ImageId imageId = ImageId.of("debian-cloud", "debian-8-jessie-v20160329");
NetworkId networkId = NetworkId.of("default");
AttachedDisk attachedDisk = AttachedDisk.of(AttachedDisk.CreateDiskConfiguration.of(imageId));
NetworkInterface networkInterface = NetworkInterface.of(networkId);
InstanceId instanceId = InstanceId.of("us-central1-a", "instance-name");
MachineTypeId machineTypeId = MachineTypeId.of("us-central1-a", "n1-standard-1");
Operation operation =
compute.create(InstanceInfo.of(instanceId, machineTypeId, attachedDisk, networkInterface));
operation = operation.waitFor();
if (operation.errors() == null) {
// use instance
Instance instance = compute.getInstance(instanceId);
}
```

Google Cloud Datastore
----------------------

Expand Down Expand Up @@ -455,3 +528,7 @@ Apache 2.0 - See [LICENSE] for more information.
[cloud-bigquery]: https://cloud.google.com/bigquery/
[cloud-bigquery-docs]: https://cloud.google.com/bigquery/docs/overview
[bigquery-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/cloud/bigquery/package-summary.html

[cloud-compute]: https://cloud.google.com/compute/
[cloud-compute-docs]: https://cloud.google.com/compute/docs/overview
[compute-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/cloud/compute/package-summary.html
6 changes: 3 additions & 3 deletions gcloud-java-bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>gcloud-java-bigquery</artifactId>
<version>0.2.0</version>
<version>0.2.3</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:gcloud-java-bigquery:0.2.0'
compile 'com.google.cloud:gcloud-java-bigquery:0.2.3'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "gcloud-java-bigquery" % "0.2.0"
libraryDependencies += "com.google.cloud" % "gcloud-java-bigquery" % "0.2.3"
```

Example Application
Expand Down
4 changes: 2 additions & 2 deletions gcloud-java-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>gcloud-java-pom</artifactId>
<version>0.2.1-SNAPSHOT</version>
<version>0.2.4-SNAPSHOT</version>
</parent>
<properties>
<site.installationModule>gcloud-java-bigquery</site.installationModule>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-bigquery</artifactId>
<version>v2-rev270-1.21.0</version>
<version>v2-rev303-1.22.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @see <a href="https://cloud.google.com/bigquery/troubleshooting-errors">Google Cloud
* BigQuery error codes</a>
*/
public class BigQueryException extends BaseServiceException {
public final class BigQueryException extends BaseServiceException {

// see: https://cloud.google.com/bigquery/troubleshooting-errors
private static final Set<Error> RETRYABLE_ERRORS = ImmutableSet.of(
Expand All @@ -44,7 +44,12 @@ public class BigQueryException extends BaseServiceException {
private final BigQueryError error;

public BigQueryException(int code, String message) {
this(code, message, null);
this(code, message, (Throwable) null);
}

public BigQueryException(int code, String message, Throwable cause) {
super(code, message, null, true, cause);
this.error = null;
}

public BigQueryException(int code, String message, BigQueryError error) {
Expand Down Expand Up @@ -100,6 +105,6 @@ public int hashCode() {
*/
static BaseServiceException translateAndThrow(RetryHelperException ex) {
BaseServiceException.translateAndPropagateIfPossible(ex);
throw new BigQueryException(UNKNOWN_CODE, ex.getMessage());
throw new BigQueryException(UNKNOWN_CODE, ex.getMessage(), ex.getCause());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public Dataset create(DatasetInfo dataset, DatasetOption... options) {
public com.google.api.services.bigquery.model.Dataset call() {
return bigQueryRpc.create(datasetPb, optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER));
}, options().retryParams(), EXCEPTION_HANDLER, options().clock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -182,7 +182,7 @@ public Table create(TableInfo table, TableOption... options) {
public com.google.api.services.bigquery.model.Table call() {
return bigQueryRpc.create(tablePb, optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER));
}, options().retryParams(), EXCEPTION_HANDLER, options().clock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -200,7 +200,7 @@ public Job create(JobInfo job, JobOption... options) {
public com.google.api.services.bigquery.model.Job call() {
return bigQueryRpc.create(jobPb, optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER));
}, options().retryParams(), EXCEPTION_HANDLER, options().clock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -221,7 +221,7 @@ public Dataset getDataset(final DatasetId datasetId, DatasetOption... options) {
public com.google.api.services.bigquery.model.Dataset call() {
return bigQueryRpc.getDataset(datasetId.dataset(), optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER);
}, options().retryParams(), EXCEPTION_HANDLER, options().clock());
return answer == null ? null : Dataset.fromPb(this, answer);
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -244,7 +244,7 @@ private static Page<Dataset> listDatasets(final BigQueryOptions serviceOptions,
Iterable<com.google.api.services.bigquery.model.Dataset>> call() {
return serviceOptions.rpc().listDatasets(optionsMap);
}
}, serviceOptions.retryParams(), EXCEPTION_HANDLER);
}, serviceOptions.retryParams(), EXCEPTION_HANDLER, serviceOptions.clock());
String cursor = result.x();
return new PageImpl<>(new DatasetPageFetcher(serviceOptions, cursor, optionsMap), cursor,
Iterables.transform(result.y(),
Expand Down Expand Up @@ -273,7 +273,7 @@ public boolean delete(final DatasetId datasetId, DatasetDeleteOption... options)
public Boolean call() {
return bigQueryRpc.deleteDataset(datasetId.dataset(), optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER);
}, options().retryParams(), EXCEPTION_HANDLER, options().clock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -292,7 +292,7 @@ public boolean delete(final TableId tableId) {
public Boolean call() {
return bigQueryRpc.deleteTable(tableId.dataset(), tableId.table());
}
}, options().retryParams(), EXCEPTION_HANDLER);
}, options().retryParams(), EXCEPTION_HANDLER, options().clock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -310,7 +310,7 @@ public Dataset update(DatasetInfo dataset, DatasetOption... options) {
public com.google.api.services.bigquery.model.Dataset call() {
return bigQueryRpc.patch(datasetPb, optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER));
}, options().retryParams(), EXCEPTION_HANDLER, options().clock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -328,7 +328,7 @@ public Table update(TableInfo table, TableOption... options) {
public com.google.api.services.bigquery.model.Table call() {
return bigQueryRpc.patch(tablePb, optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER));
}, options().retryParams(), EXCEPTION_HANDLER, options().clock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -349,7 +349,7 @@ public Table getTable(final TableId tableId, TableOption... options) {
public com.google.api.services.bigquery.model.Table call() {
return bigQueryRpc.getTable(tableId.dataset(), tableId.table(), optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER);
}, options().retryParams(), EXCEPTION_HANDLER, options().clock());
return answer == null ? null : Table.fromPb(this, answer);
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -377,7 +377,7 @@ private static Page<Table> listTables(final String datasetId, final BigQueryOpti
call() {
return serviceOptions.rpc().listTables(datasetId, optionsMap);
}
}, serviceOptions.retryParams(), EXCEPTION_HANDLER);
}, serviceOptions.retryParams(), EXCEPTION_HANDLER, serviceOptions.clock());
String cursor = result.x();
Iterable<Table> tables = Iterables.transform(result.y(),
new Function<com.google.api.services.bigquery.model.Table, Table>() {
Expand Down Expand Up @@ -432,7 +432,7 @@ public BigQueryRpc.Tuple<String, Iterable<TableRow>> call() {
return serviceOptions.rpc()
.listTableData(tableId.dataset(), tableId.table(), optionsMap);
}
}, serviceOptions.retryParams(), EXCEPTION_HANDLER);
}, serviceOptions.retryParams(), EXCEPTION_HANDLER, serviceOptions.clock());
String cursor = result.x();
return new PageImpl<>(new TableDataPageFetcher(tableId, serviceOptions, cursor, optionsMap),
cursor, transformTableData(result.y()));
Expand Down Expand Up @@ -467,7 +467,7 @@ public Job getJob(final JobId jobId, JobOption... options) {
public com.google.api.services.bigquery.model.Job call() {
return bigQueryRpc.getJob(jobId.job(), optionsMap);
}
}, options().retryParams(), EXCEPTION_HANDLER);
}, options().retryParams(), EXCEPTION_HANDLER, options().clock());
return answer == null ? null : Job.fromPb(this, answer);
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -489,7 +489,7 @@ private static Page<Job> listJobs(final BigQueryOptions serviceOptions,
call() {
return serviceOptions.rpc().listJobs(optionsMap);
}
}, serviceOptions.retryParams(), EXCEPTION_HANDLER);
}, serviceOptions.retryParams(), EXCEPTION_HANDLER, serviceOptions.clock());
String cursor = result.x();
Iterable<Job> jobs = Iterables.transform(result.y(),
new Function<com.google.api.services.bigquery.model.Job, Job>() {
Expand All @@ -514,7 +514,7 @@ public boolean cancel(final JobId jobId) {
public Boolean call() {
return bigQueryRpc.cancel(jobId.job());
}
}, options().retryParams(), EXCEPTION_HANDLER);
}, options().retryParams(), EXCEPTION_HANDLER, options().clock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
}
Expand All @@ -529,7 +529,7 @@ public QueryResponse query(final QueryRequest request) {
public com.google.api.services.bigquery.model.QueryResponse call() {
return bigQueryRpc.query(request.setProjectId(options().projectId()).toPb());
}
}, options().retryParams(), EXCEPTION_HANDLER);
}, options().retryParams(), EXCEPTION_HANDLER, options().clock());
QueryResponse.Builder builder = QueryResponse.builder();
JobId completeJobId = JobId.fromPb(results.getJobReference());
builder.jobId(completeJobId);
Expand Down Expand Up @@ -574,7 +574,7 @@ private static QueryResponse getQueryResults(final JobId jobId,
public GetQueryResultsResponse call() {
return serviceOptions.rpc().getQueryResults(jobId.job(), optionsMap);
}
}, serviceOptions.retryParams(), EXCEPTION_HANDLER);
}, serviceOptions.retryParams(), EXCEPTION_HANDLER, serviceOptions.clock());
QueryResponse.Builder builder = QueryResponse.builder();
JobId completeJobId = JobId.fromPb(results.getJobReference());
builder.jobId(completeJobId);
Expand Down
Loading