@Test public void testWhenRetriesAreDisabled() throws IOException { RetryOptions retryOptions = RetryOptions.builder().setEnableRetries(false).build(); BigtableOptions options = BigtableOptions.builder() .setProjectId(TEST_PROJECT_ID) .setInstanceId(TEST_INSTANCE_ID) .setRetryOptions(retryOptions) .build(); expectException.expect(IllegalStateException.class); expectException.expectMessage("Disabling retries is not currently supported."); dataSettings = BigtableVeneerSettingsFactory.createBigtableDataSettings(options); }
public static BigtableDataSettings createBigtableDataSettings( @Nonnull final BigtableOptions options) throws IOException { checkState( options.getRetryOptions().enableRetries(), "Disabling retries is not currently supported."); final BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilder(); final Builder dataSettingStub = builder.stubSettings(); Duration shortRpcTimeoutMs = ofMillis(options.getCallOptionsConfig().getShortRpcTimeoutMs()); builder .setProjectId(options.getProjectId()) .setInstanceId(options.getInstanceId()) .setAppProfileId(options.getAppProfileId()); dataSettingStub .setEndpoint(options.getDataHost() + ":" + options.getPort()) .setHeaderProvider(buildHeaderProvider(options.getUserAgent())) .setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); if (options.usePlaintextNegotiation()) { dataSettingStub.setTransportChannelProvider( buildChannelProvider(dataSettingStub.getEndpoint(), options)); } dataSettingStub.checkAndMutateRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); dataSettingStub.readModifyWriteRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); buildBulkMutationsSettings(dataSettingStub, options); buildReadRowsSettings(dataSettingStub, options); buildReadRowSettings(dataSettingStub, options); buildBulkReadRowsSettings(dataSettingStub, options); buildMutateRowSettings(dataSettingStub, options); buildSampleRowKeysSettings(dataSettingStub, options); return builder.build(); }
BigtableVeneerSettingsFactory { public static BigtableDataSettings createBigtableDataSettings( @Nonnull final BigtableOptions options) throws IOException { checkState( options.getRetryOptions().enableRetries(), "Disabling retries is not currently supported."); final BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilder(); final Builder dataSettingStub = builder.stubSettings(); Duration shortRpcTimeoutMs = ofMillis(options.getCallOptionsConfig().getShortRpcTimeoutMs()); builder .setProjectId(options.getProjectId()) .setInstanceId(options.getInstanceId()) .setAppProfileId(options.getAppProfileId()); dataSettingStub .setEndpoint(options.getDataHost() + ":" + options.getPort()) .setHeaderProvider(buildHeaderProvider(options.getUserAgent())) .setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); if (options.usePlaintextNegotiation()) { dataSettingStub.setTransportChannelProvider( buildChannelProvider(dataSettingStub.getEndpoint(), options)); } dataSettingStub.checkAndMutateRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); dataSettingStub.readModifyWriteRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); buildBulkMutationsSettings(dataSettingStub, options); buildReadRowsSettings(dataSettingStub, options); buildReadRowSettings(dataSettingStub, options); buildBulkReadRowsSettings(dataSettingStub, options); buildMutateRowSettings(dataSettingStub, options); buildSampleRowKeysSettings(dataSettingStub, options); return builder.build(); } }
BigtableVeneerSettingsFactory { public static BigtableDataSettings createBigtableDataSettings( @Nonnull final BigtableOptions options) throws IOException { checkState( options.getRetryOptions().enableRetries(), "Disabling retries is not currently supported."); final BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilder(); final Builder dataSettingStub = builder.stubSettings(); Duration shortRpcTimeoutMs = ofMillis(options.getCallOptionsConfig().getShortRpcTimeoutMs()); builder .setProjectId(options.getProjectId()) .setInstanceId(options.getInstanceId()) .setAppProfileId(options.getAppProfileId()); dataSettingStub .setEndpoint(options.getDataHost() + ":" + options.getPort()) .setHeaderProvider(buildHeaderProvider(options.getUserAgent())) .setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); if (options.usePlaintextNegotiation()) { dataSettingStub.setTransportChannelProvider( buildChannelProvider(dataSettingStub.getEndpoint(), options)); } dataSettingStub.checkAndMutateRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); dataSettingStub.readModifyWriteRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); buildBulkMutationsSettings(dataSettingStub, options); buildReadRowsSettings(dataSettingStub, options); buildReadRowSettings(dataSettingStub, options); buildBulkReadRowsSettings(dataSettingStub, options); buildMutateRowSettings(dataSettingStub, options); buildSampleRowKeysSettings(dataSettingStub, options); return builder.build(); }  }
BigtableVeneerSettingsFactory { public static BigtableDataSettings createBigtableDataSettings( @Nonnull final BigtableOptions options) throws IOException { checkState( options.getRetryOptions().enableRetries(), "Disabling retries is not currently supported."); final BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilder(); final Builder dataSettingStub = builder.stubSettings(); Duration shortRpcTimeoutMs = ofMillis(options.getCallOptionsConfig().getShortRpcTimeoutMs()); builder .setProjectId(options.getProjectId()) .setInstanceId(options.getInstanceId()) .setAppProfileId(options.getAppProfileId()); dataSettingStub .setEndpoint(options.getDataHost() + ":" + options.getPort()) .setHeaderProvider(buildHeaderProvider(options.getUserAgent())) .setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); if (options.usePlaintextNegotiation()) { dataSettingStub.setTransportChannelProvider( buildChannelProvider(dataSettingStub.getEndpoint(), options)); } dataSettingStub.checkAndMutateRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); dataSettingStub.readModifyWriteRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); buildBulkMutationsSettings(dataSettingStub, options); buildReadRowsSettings(dataSettingStub, options); buildReadRowSettings(dataSettingStub, options); buildBulkReadRowsSettings(dataSettingStub, options); buildMutateRowSettings(dataSettingStub, options); buildSampleRowKeysSettings(dataSettingStub, options); return builder.build(); }  static BigtableDataSettings createBigtableDataSettings(
      @Nonnull final BigtableOptions options); static BigtableTableAdminSettings createTableAdminSettings(
      @Nonnull final BigtableOptions options); }
BigtableVeneerSettingsFactory { public static BigtableDataSettings createBigtableDataSettings( @Nonnull final BigtableOptions options) throws IOException { checkState( options.getRetryOptions().enableRetries(), "Disabling retries is not currently supported."); final BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilder(); final Builder dataSettingStub = builder.stubSettings(); Duration shortRpcTimeoutMs = ofMillis(options.getCallOptionsConfig().getShortRpcTimeoutMs()); builder .setProjectId(options.getProjectId()) .setInstanceId(options.getInstanceId()) .setAppProfileId(options.getAppProfileId()); dataSettingStub .setEndpoint(options.getDataHost() + ":" + options.getPort()) .setHeaderProvider(buildHeaderProvider(options.getUserAgent())) .setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); if (options.usePlaintextNegotiation()) { dataSettingStub.setTransportChannelProvider( buildChannelProvider(dataSettingStub.getEndpoint(), options)); } dataSettingStub.checkAndMutateRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); dataSettingStub.readModifyWriteRowSettings().setSimpleTimeoutNoRetries(shortRpcTimeoutMs); buildBulkMutationsSettings(dataSettingStub, options); buildReadRowsSettings(dataSettingStub, options); buildReadRowSettings(dataSettingStub, options); buildBulkReadRowsSettings(dataSettingStub, options); buildMutateRowSettings(dataSettingStub, options); buildSampleRowKeysSettings(dataSettingStub, options); return builder.build(); }  static BigtableDataSettings createBigtableDataSettings(
      @Nonnull final BigtableOptions options); static BigtableTableAdminSettings createTableAdminSettings(
      @Nonnull final BigtableOptions options);  }