Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into test-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vkedia committed Mar 8, 2017
2 parents 8c5a6ec + be2c36f commit c964be8
Show file tree
Hide file tree
Showing 438 changed files with 2,665 additions and 11,572 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud</artifactId>
<version>0.9.2-alpha</version>
<version>0.9.4-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud:0.9.2-alpha'
compile 'com.google.cloud:google-cloud:0.9.4-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.9.2-alpha"
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.9.4-alpha"
```

Example Applications
Expand Down Expand Up @@ -109,12 +109,12 @@ Most `google-cloud` libraries require a project ID. There are multiple ways to

`google-cloud` determines the project ID from the following sources in the listed order, stopping once it finds a value:

1. Project ID supplied when building the service options
1. The project ID supplied when building the service options
2. Project ID specified by the environment variable `GOOGLE_CLOUD_PROJECT`
3. App Engine project ID
4. Project ID specified in the JSON credentials file pointed by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
5. Google Cloud SDK project ID
6. Compute Engine project ID
3. The App Engine project ID
4. The project ID specified in the JSON credentials file pointed by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
5. The Google Cloud SDK project ID
6. The Compute Engine project ID

Authentication
--------------
Expand Down
2 changes: 1 addition & 1 deletion SUPPORTING_NEW_SERVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The library should contain:
* Classes representing model objects and request-related options. Model objects that correspond to service resources should have a subclass that provides functions related to that resource. For example, see [`BlobInfo`](https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java) (the metadata class) and [`Blob`](https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java) (the functional class). The builders for both objects should implement a common interface or abstract class, and the functional subclass builder should delegate to the metadata class builder.
* Request-related options classes. Operations should accept these options as varargs when appropriate. Supplying options as varargs allows for supporting more advanced use cases without affecting the method signature. The options classes should provide static methods to create instances with specific options settings. A common option is to request that only specific fields of a model object should be included in a response. Typically such an option is created via a `fields(...)` method which accepts a vararg of type `<ResourceName>Field` enum. The enum should implement the [FieldSelector](https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java) interface.

In general, make classes immutable whenever possible, providing builders as necessary. Make model object classes `java.util.Serializable`. Prefer making classes final, with the following exceptions: (1) functional objects and (2) classes in which the user cannot set all attributes. If a class cannot be made final, then `hashCode` or `equals` overrides should be made final if possible.
In general, make classes immutable whenever possible, providing builders as necessary. Make model object classes `java.io.Serializable`. Prefer making classes final, with the following exceptions: (1) functional objects and (2) classes in which the user cannot set all attributes. If a class cannot be made final, then `hashCode` or `equals` overrides should be made final if possible.

`google-cloud-core` provides functionality for code patterns used across `google-cloud` libraries. The following are some important core concepts:
* Paging: Google Cloud services often expose page-based listing using page tokens. The [`Page`](https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-core/src/main/java/com/google/cloud/Page.java) interface should be used for page-based listing. A `Page` contains an iterator over results in that page, as well as methods to get the next page and all results in future pages. `Page` requires a `NextPageFetcher` implementation (see the `NextPageFetcher` interface in [`PageImpl`](https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java)). This implementation should delegate constructing request options to the `nextRequestOptions` method in `PageImpl`.
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-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>google-cloud-bigquery</artifactId>
<version>0.9.2-beta</version>
<version>0.9.4-beta</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-bigquery:0.9.2-beta'
compile 'com.google.cloud:google-cloud-bigquery:0.9.4-beta'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.9.2-beta"
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.9.4-beta"
```

Example Application
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom</artifactId>
<version>0.9.3-alpha-SNAPSHOT</version>
<version>0.9.5-alpha-SNAPSHOT</version>
</parent>
<properties>
<site.installationModule>google-cloud-bigquery</site.installationModule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ public enum Type {
this.type = type;
}

@Deprecated
public Type type() {
return getType();
}

public Type getType() {
return type;
Expand Down Expand Up @@ -131,13 +127,6 @@ public Domain(String domain) {
this.domain = domain;
}

/**
* Returns the domain name.
*/
@Deprecated
public String domain() {
return getDomain();
}

/**
* Returns the domain name.
Expand Down Expand Up @@ -201,15 +190,6 @@ public Group(String identifier) {
this.identifier = identifier;
}

/**
* Returns group's identifier, can be either a
* <a href="https://cloud.google.com/bigquery/docs/reference/v2/datasets#access.specialGroup">
* special group identifier</a> or a group email.
*/
@Deprecated
public String identifier() {
return getIdentifier();
}

/**
* Returns group's identifier, can be either a
Expand Down Expand Up @@ -306,13 +286,6 @@ public User(String email) {
this.email = email;
}

/**
* Returns user's email.
*/
@Deprecated
public String email() {
return getEmail();
}

/**
* Returns user's email.
Expand Down Expand Up @@ -369,13 +342,6 @@ public View(TableId id) {
this.id = id;
}

/**
* Returns table's identity.
*/
@Deprecated
public TableId id() {
return getId();
}

/**
* Returns table's identity.
Expand Down Expand Up @@ -417,13 +383,6 @@ private Acl(Entity entity, Role role) {
this.role = role;
}

/**
* Returns the entity for this ACL.
*/
@Deprecated
public Entity entity() {
return getEntity();
}

/**
* Returns the entity for this ACL.
Expand All @@ -432,13 +391,6 @@ public Entity getEntity() {
return entity;
}

/**
* Returns the role specified by this ACL.
*/
@Deprecated
public Role role() {
return getRole();
}

/**
* Returns the role specified by this ACL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ enum DatasetField implements FieldSelector {
this.selector = selector;
}

@Override
@Deprecated
public String selector() {
return getSelector();
}

@Override
public String getSelector() {
Expand Down Expand Up @@ -111,11 +106,6 @@ enum TableField implements FieldSelector {
this.selector = selector;
}

@Override
@Deprecated
public String selector() {
return getSelector();
}

@Override
public String getSelector() {
Expand Down Expand Up @@ -148,11 +138,6 @@ enum JobField implements FieldSelector {
this.selector = selector;
}

@Override
@Deprecated
public String selector() {
return getSelector();
}

@Override
public String getSelector() {
Expand Down Expand Up @@ -207,7 +192,7 @@ private DatasetOption(BigQueryRpc.Option option, Object value) {
/**
* Returns an option to specify the dataset's fields to be returned by the RPC call. If this
* option is not provided all dataset's fields are returned. {@code DatasetOption.fields} can
* be used to specify only the fields of interest. {@link Dataset#datasetId()} is always
* be used to specify only the fields of interest. {@link Dataset#getDatasetId()} is always
* returned, even if not specified.
*/
public static DatasetOption fields(DatasetField... fields) {
Expand Down Expand Up @@ -277,8 +262,8 @@ private TableOption(BigQueryRpc.Option option, Object value) {
/**
* Returns an option to specify the table's fields to be returned by the RPC call. If this
* option is not provided all table's fields are returned. {@code TableOption.fields} can be
* used to specify only the fields of interest. {@link Table#tableId()} and type (which is part
* of {@link Table#definition()}) are always returned, even if not specified.
* used to specify only the fields of interest. {@link Table#getTableId()} and type (which is part
* of {@link Table#getDefinition()}) are always returned, even if not specified.
*/
public static TableOption fields(TableField... fields) {
return new TableOption(BigQueryRpc.Option.FIELDS,
Expand Down Expand Up @@ -372,9 +357,9 @@ public static JobListOption pageToken(String pageToken) {
/**
* Returns an option to specify the job's fields to be returned by the RPC call. If this option
* is not provided all job's fields are returned. {@code JobOption.fields()} can be used to
* specify only the fields of interest. {@link Job#jobId()}, {@link JobStatus#state()},
* {@link JobStatus#error()} as well as type-specific configuration (e.g.
* {@link QueryJobConfiguration#query()} for Query Jobs) are always returned, even if not
* specify only the fields of interest. {@link Job#getJobId()}, {@link JobStatus#getState()},
* {@link JobStatus#getError()} as well as type-specific configuration (e.g.
* {@link QueryJobConfiguration#getQuery()} for Query Jobs) are always returned, even if not
* specified. {@link JobField#SELF_LINK} and {@link JobField#ETAG} can not be selected when
* listing jobs.
*/
Expand All @@ -398,8 +383,8 @@ private JobOption(BigQueryRpc.Option option, Object value) {
/**
* Returns an option to specify the job's fields to be returned by the RPC call. If this option
* is not provided all job's fields are returned. {@code JobOption.fields()} can be used to
* specify only the fields of interest. {@link Job#jobId()} as well as type-specific
* configuration (e.g. {@link QueryJobConfiguration#query()} for Query Jobs) are always
* specify only the fields of interest. {@link Job#getJobId()} as well as type-specific
* configuration (e.g. {@link QueryJobConfiguration#getQuery()} for Query Jobs) are always
* returned, even if not specified.
*/
public static JobOption fields(JobField... fields) {
Expand Down Expand Up @@ -468,7 +453,7 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) {
* } catch (BigQueryException e) {
* // the dataset was not created
* }
* }</pre>
* } </pre>
*
* @throws BigQueryException upon failure
*/
Expand Down Expand Up @@ -546,8 +531,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) {

/**
* Lists the project's datasets. This method returns partial information on each dataset:
* ({@link Dataset#datasetId()}, {@link Dataset#friendlyName()} and
* {@link Dataset#generatedId()}). To get complete information use either
* ({@link Dataset#getDatasetId()}, {@link Dataset#getFriendlyName()} and
* {@link Dataset#getGeneratedId()}). To get complete information use either
* {@link #getDataset(String, DatasetOption...)} or
* {@link #getDataset(DatasetId, DatasetOption...)}.
*
Expand All @@ -567,8 +552,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) {

/**
* Lists the datasets in the provided project. This method returns partial information on each
* dataset: ({@link Dataset#datasetId()}, {@link Dataset#friendlyName()} and
* {@link Dataset#generatedId()}). To get complete information use either
* dataset: ({@link Dataset#getDatasetId()}, {@link Dataset#getFriendlyName()} and
* {@link Dataset#getGeneratedId()}). To get complete information use either
* {@link #getDataset(String, DatasetOption...)} or
* {@link #getDataset(DatasetId, DatasetOption...)}.
*
Expand Down Expand Up @@ -734,8 +719,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) {

/**
* Lists the tables in the dataset. This method returns partial information on each table:
* ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#generatedId()} and type,
* which is part of {@link Table#definition()}). To get complete information use either
* ({@link Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()} and type,
* which is part of {@link Table#getDefinition()}). To get complete information use either
* {@link #getTable(TableId, TableOption...)} or
* {@link #getTable(String, String, TableOption...)}.
*
Expand All @@ -756,8 +741,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) {

/**
* Lists the tables in the dataset. This method returns partial information on each table:
* ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#generatedId()} and type,
* which is part of {@link Table#definition()}). To get complete information use either
* ({@link Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()}
* and type, which is part of {@link Table#getDefinition()}). To get complete information use either
* {@link #getTable(TableId, TableOption...)} or
* {@link #getTable(String, String, TableOption...)}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
/**
* Google Cloud BigQuery Error. Objects of this class represent errors encountered by the BigQuery
* service while executing a request. A BigQuery Job that terminated with an error has a non-null
* {@link JobStatus#error()}. A job can also encounter errors during its execution that do not cause
* the whole job to fail (see {@link JobStatus#executionErrors()}). Similarly, queries and insert
* all requests can cause BigQuery errors that do not mean the whole operation failed (see
* {@link QueryResponse#executionErrors()} and {@link InsertAllResponse#insertErrors()}). When a
* {@link BigQueryException} is thrown the BigQuery Error that caused it, if any, can be accessed
* with {@link BigQueryException#error()}.
* {@link JobStatus#getError()}. A job can also encounter errors during its execution that do not
* cause the whole job to fail (see {@link JobStatus#getExecutionErrors()}). Similarly, queries and
* insert all requests can cause BigQuery errors that do not mean the whole operation failed (see
* {@link QueryResponse#getExecutionErrors()} and {@link InsertAllResponse#getInsertErrors()}).
* When a {@link BigQueryException} is thrown the BigQuery Error that caused it, if any, can be
* accessed with {@link BigQueryException#getError()}.
*/
public final class BigQueryError implements Serializable {

Expand Down Expand Up @@ -70,16 +70,6 @@ public BigQueryError(String reason, String location, String message) {
this.debugInfo = null;
}

/**
* Returns short error code that summarizes the error.
*
* @see <a href="https://cloud.google.com/bigquery/troubleshooting-errors">Troubleshooting
* Errors</a>
*/
@Deprecated
public String reason() {
return getReason();
}

/**
* Returns short error code that summarizes the error.
Expand All @@ -91,13 +81,6 @@ public String getReason() {
return reason;
}

/**
* Returns where the error occurred, if present.
*/
@Deprecated
public String location() {
return getLocation();
}

/**
* Returns where the error occurred, if present.
Expand All @@ -110,13 +93,6 @@ String getDebugInfo() {
return debugInfo;
}

/**
* Returns a human-readable description of the error.
*/
@Deprecated
public String message() {
return getMessage();
}

/**
* Returns a human-readable description of the error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ public BigQueryException(IOException exception) {
this.error = error;
}

/**
* Returns the {@link BigQueryError} that caused this exception. Returns {@code null} if none
* exists.
*/
@Deprecated
public BigQueryError error() {
return getError();
}

/**
* Returns the {@link BigQueryError} that caused this exception. Returns {@code null} if none
Expand Down
Loading

0 comments on commit c964be8

Please sign in to comment.