Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update starter modules in spring-cloud-preview #1586

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 spring-cloud-gcp-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</distributionManagement>

<properties>
<gcp-libraries-bom.version>26.5.0</gcp-libraries-bom.version>
<gcp-libraries-bom.version>26.7.0</gcp-libraries-bom.version>
<cloud-sql-socket-factory.version>1.9.0</cloud-sql-socket-factory.version>
<guava.version>31.1-jre</guava.version>
<r2dbc-postgres-driver.version>1.0.0.RELEASE</r2dbc-postgres-driver.version>
Expand Down
174 changes: 87 additions & 87 deletions spring-cloud-previews/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,40 @@ public JobServiceSettings jobServiceSettings(
.cancelHyperparameterTuningJobSettings()
.setRetrySettings(cancelHyperparameterTuningJobRetrySettings);

RetrySettings createNasJobRetrySettings =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This corresponds to changes from googleapis/google-cloud-java#9073

RetryUtil.updateRetrySettings(
clientSettingsBuilder.createNasJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.createNasJobSettings().setRetrySettings(createNasJobRetrySettings);

RetrySettings getNasJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getNasJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.getNasJobSettings().setRetrySettings(getNasJobRetrySettings);

RetrySettings listNasJobsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listNasJobsSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.listNasJobsSettings().setRetrySettings(listNasJobsRetrySettings);

RetrySettings cancelNasJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.cancelNasJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.cancelNasJobSettings().setRetrySettings(cancelNasJobRetrySettings);

RetrySettings getNasTrialDetailRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getNasTrialDetailSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.getNasTrialDetailSettings()
.setRetrySettings(getNasTrialDetailRetrySettings);

RetrySettings listNasTrialDetailsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listNasTrialDetailsSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.listNasTrialDetailsSettings()
.setRetrySettings(listNasTrialDetailsRetrySettings);

RetrySettings createBatchPredictionJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createBatchPredictionJobSettings().getRetrySettings(),
Expand Down Expand Up @@ -507,6 +541,74 @@ public JobServiceSettings jobServiceSettings(
"Configured method-level retry settings for cancelHyperparameterTuningJob from properties.");
}
}
Retry createNasJobRetry = clientProperties.getCreateNasJobRetry();
if (createNasJobRetry != null) {
RetrySettings createNasJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createNasJobSettings().getRetrySettings(), createNasJobRetry);
clientSettingsBuilder.createNasJobSettings().setRetrySettings(createNasJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for createNasJob from properties.");
}
}
Retry getNasJobRetry = clientProperties.getGetNasJobRetry();
if (getNasJobRetry != null) {
RetrySettings getNasJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getNasJobSettings().getRetrySettings(), getNasJobRetry);
clientSettingsBuilder.getNasJobSettings().setRetrySettings(getNasJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for getNasJob from properties.");
}
}
Retry listNasJobsRetry = clientProperties.getListNasJobsRetry();
if (listNasJobsRetry != null) {
RetrySettings listNasJobsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listNasJobsSettings().getRetrySettings(), listNasJobsRetry);
clientSettingsBuilder.listNasJobsSettings().setRetrySettings(listNasJobsRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for listNasJobs from properties.");
}
}
Retry cancelNasJobRetry = clientProperties.getCancelNasJobRetry();
if (cancelNasJobRetry != null) {
RetrySettings cancelNasJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.cancelNasJobSettings().getRetrySettings(), cancelNasJobRetry);
clientSettingsBuilder.cancelNasJobSettings().setRetrySettings(cancelNasJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for cancelNasJob from properties.");
}
}
Retry getNasTrialDetailRetry = clientProperties.getGetNasTrialDetailRetry();
if (getNasTrialDetailRetry != null) {
RetrySettings getNasTrialDetailRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getNasTrialDetailSettings().getRetrySettings(),
getNasTrialDetailRetry);
clientSettingsBuilder
.getNasTrialDetailSettings()
.setRetrySettings(getNasTrialDetailRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getNasTrialDetail from properties.");
}
}
Retry listNasTrialDetailsRetry = clientProperties.getListNasTrialDetailsRetry();
if (listNasTrialDetailsRetry != null) {
RetrySettings listNasTrialDetailsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listNasTrialDetailsSettings().getRetrySettings(),
listNasTrialDetailsRetry);
clientSettingsBuilder
.listNasTrialDetailsSettings()
.setRetrySettings(listNasTrialDetailsRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listNasTrialDetails from properties.");
}
}
Retry createBatchPredictionJobRetry = clientProperties.getCreateBatchPredictionJobRetry();
if (createBatchPredictionJobRetry != null) {
RetrySettings createBatchPredictionJobRetrySettings =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public class JobServiceSpringProperties implements CredentialsSupplier {
/** OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries. */
@NestedConfigurationProperty
private final Credentials credentials =
new Credentials("https://www.googleapis.com/auth/cloud-platform");
new Credentials(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only");
/** Quota project to use for billing. */
private String quotaProjectId;
/** Number of threads used for executors. */
Expand Down Expand Up @@ -100,6 +102,36 @@ public class JobServiceSpringProperties implements CredentialsSupplier {
* this takes precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry cancelHyperparameterTuningJobRetry;
/**
* Allow override of retry settings at method-level for createNasJob. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry createNasJobRetry;
/**
* Allow override of retry settings at method-level for getNasJob. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry getNasJobRetry;
/**
* Allow override of retry settings at method-level for listNasJobs. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry listNasJobsRetry;
/**
* Allow override of retry settings at method-level for cancelNasJob. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry cancelNasJobRetry;
/**
* Allow override of retry settings at method-level for getNasTrialDetail. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry getNasTrialDetailRetry;
/**
* Allow override of retry settings at method-level for listNasTrialDetails. If defined, this
* takes precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry listNasTrialDetailsRetry;
/**
* Allow override of retry settings at method-level for createBatchPredictionJob. If defined, this
* takes precedence over service-level retry configurations for that RPC method.
Expand Down Expand Up @@ -302,6 +334,54 @@ public void setCancelHyperparameterTuningJobRetry(Retry cancelHyperparameterTuni
this.cancelHyperparameterTuningJobRetry = cancelHyperparameterTuningJobRetry;
}

public Retry getCreateNasJobRetry() {
return this.createNasJobRetry;
}

public void setCreateNasJobRetry(Retry createNasJobRetry) {
this.createNasJobRetry = createNasJobRetry;
}

public Retry getGetNasJobRetry() {
return this.getNasJobRetry;
}

public void setGetNasJobRetry(Retry getNasJobRetry) {
this.getNasJobRetry = getNasJobRetry;
}

public Retry getListNasJobsRetry() {
return this.listNasJobsRetry;
}

public void setListNasJobsRetry(Retry listNasJobsRetry) {
this.listNasJobsRetry = listNasJobsRetry;
}

public Retry getCancelNasJobRetry() {
return this.cancelNasJobRetry;
}

public void setCancelNasJobRetry(Retry cancelNasJobRetry) {
this.cancelNasJobRetry = cancelNasJobRetry;
}

public Retry getGetNasTrialDetailRetry() {
return this.getNasTrialDetailRetry;
}

public void setGetNasTrialDetailRetry(Retry getNasTrialDetailRetry) {
this.getNasTrialDetailRetry = getNasTrialDetailRetry;
}

public Retry getListNasTrialDetailsRetry() {
return this.listNasTrialDetailsRetry;
}

public void setListNasTrialDetailsRetry(Retry listNasTrialDetailsRetry) {
this.listNasTrialDetailsRetry = listNasTrialDetailsRetry;
}

public Retry getCreateBatchPredictionJobRetry() {
return this.createBatchPredictionJobRetry;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ public TensorboardServiceSettings tensorboardServiceSettings(
clientSettingsBuilder.getTensorboardSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.getTensorboardSettings().setRetrySettings(getTensorboardRetrySettings);

RetrySettings readTensorboardUsageRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.readTensorboardUsageSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.readTensorboardUsageSettings()
.setRetrySettings(readTensorboardUsageRetrySettings);

RetrySettings listTensorboardsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listTensorboardsSettings().getRetrySettings(), serviceRetry);
Expand Down Expand Up @@ -352,6 +360,20 @@ public TensorboardServiceSettings tensorboardServiceSettings(
LOGGER.trace("Configured method-level retry settings for getTensorboard from properties.");
}
}
Retry readTensorboardUsageRetry = clientProperties.getReadTensorboardUsageRetry();
if (readTensorboardUsageRetry != null) {
RetrySettings readTensorboardUsageRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.readTensorboardUsageSettings().getRetrySettings(),
readTensorboardUsageRetry);
clientSettingsBuilder
.readTensorboardUsageSettings()
.setRetrySettings(readTensorboardUsageRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for readTensorboardUsage from properties.");
}
}
Retry listTensorboardsRetry = clientProperties.getListTensorboardsRetry();
if (listTensorboardsRetry != null) {
RetrySettings listTensorboardsRetrySettings =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public class TensorboardServiceSpringProperties implements CredentialsSupplier {
* precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry getTensorboardRetry;
/**
* Allow override of retry settings at method-level for readTensorboardUsage. If defined, this
* takes precedence over service-level retry configurations for that RPC method.
*/
@NestedConfigurationProperty private Retry readTensorboardUsageRetry;
/**
* Allow override of retry settings at method-level for listTensorboards. If defined, this takes
* precedence over service-level retry configurations for that RPC method.
Expand Down Expand Up @@ -210,6 +215,14 @@ public void setGetTensorboardRetry(Retry getTensorboardRetry) {
this.getTensorboardRetry = getTensorboardRetry;
}

public Retry getReadTensorboardUsageRetry() {
return this.readTensorboardUsageRetry;
}

public void setReadTensorboardUsageRetry(Retry readTensorboardUsageRetry) {
this.readTensorboardUsageRetry = readTensorboardUsageRetry;
}

public Retry getListTensorboardsRetry() {
return this.listTensorboardsRetry;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ protected TetherSpringAutoConfiguration(
@Bean
@ConditionalOnMissingBean(name = "defaultTetherTransportChannelProvider")
public TransportChannelProvider defaultTetherTransportChannelProvider() {
if (this.clientProperties.getUseRest()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This corresponds to useRestOption update in the generator: see googleapis/sdk-platform-java#1343 for details.

return TetherSettings.defaultHttpJsonTransportProviderBuilder().build();
}
return TetherSettings.defaultTransportChannelProvider();
}

Expand All @@ -116,15 +113,7 @@ public TetherSettings tetherSettings(
@Qualifier("defaultTetherTransportChannelProvider")
TransportChannelProvider defaultTransportChannelProvider)
throws IOException {
TetherSettings.Builder clientSettingsBuilder;
if (this.clientProperties.getUseRest()) {
clientSettingsBuilder = TetherSettings.newHttpJsonBuilder();
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Using REST (HTTP/JSON) transport.");
}
} else {
clientSettingsBuilder = TetherSettings.newBuilder();
}
TetherSettings.Builder clientSettingsBuilder = TetherSettings.newBuilder();
clientSettingsBuilder
.setCredentialsProvider(this.credentialsProvider)
.setTransportChannelProvider(defaultTransportChannelProvider)
Expand Down
Loading