@Test public void testSettingRetryOptions() throws IOException { configuration.set(BigtableOptionsFactory.ENABLE_GRPC_RETRIES_KEY, "false"); configuration.set(BigtableOptionsFactory.ENABLE_GRPC_RETRY_DEADLINEEXCEEDED_KEY, "false"); configuration.set(BigtableOptionsFactory.MAX_ELAPSED_BACKOFF_MILLIS_KEY, "111"); configuration.set(BigtableOptionsFactory.READ_PARTIAL_ROW_TIMEOUT_MS, "123"); RetryOptions retryOptions = BigtableOptionsFactory.fromConfiguration(configuration).getRetryOptions(); assertEquals(false, retryOptions.enableRetries()); assertEquals(false, retryOptions.retryOnDeadlineExceeded()); assertEquals(111, retryOptions.getMaxElapsedBackoffMillis()); assertEquals(123, retryOptions.getReadPartialRowTimeoutMillis()); }
public static BigtableOptions fromConfiguration(final Configuration configuration) throws IOException { BigtableOptions.Builder bigtableOptionsBuilder = BigtableOptions.builder(); bigtableOptionsBuilder.setProjectId(getValue(configuration, PROJECT_ID_KEY, "Project ID")); bigtableOptionsBuilder.setInstanceId(getValue(configuration, INSTANCE_ID_KEY, "Instance ID")); String appProfileId = configuration.get(APP_PROFILE_ID_KEY); if (appProfileId != null) { bigtableOptionsBuilder.setAppProfileId(appProfileId); } String dataHostOverride = configuration.get(BIGTABLE_HOST_KEY); if (dataHostOverride != null) { LOG.debug("API Data endpoint host %s.", dataHostOverride); bigtableOptionsBuilder.setDataHost(dataHostOverride); } String adminHostOverride = configuration.get(BIGTABLE_ADMIN_HOST_KEY); if (adminHostOverride != null) { LOG.debug("Admin endpoint host %s.", adminHostOverride); bigtableOptionsBuilder.setAdminHost(adminHostOverride); } String portOverrideStr = configuration.get(BIGTABLE_PORT_KEY); if (portOverrideStr != null) { bigtableOptionsBuilder.setPort(Integer.parseInt(portOverrideStr)); } String usePlaintextStr = configuration.get(BIGTABLE_USE_PLAINTEXT_NEGOTIATION); if (usePlaintextStr != null) { bigtableOptionsBuilder.setUsePlaintextNegotiation(Boolean.parseBoolean(usePlaintextStr)); } setBulkOptions(configuration, bigtableOptionsBuilder); setChannelOptions(configuration, bigtableOptionsBuilder); setClientCallOptions(configuration, bigtableOptionsBuilder); String emulatorHost = configuration.get(BIGTABLE_EMULATOR_HOST_KEY); if (emulatorHost != null) { bigtableOptionsBuilder.enableEmulator(emulatorHost); } String useBatchStr = configuration.get(BIGTABLE_USE_BATCH); if (useBatchStr != null) { bigtableOptionsBuilder.setUseBatch(Boolean.parseBoolean(useBatchStr)); } String useGcjClientStr = configuration.get(BIGTABLE_USE_GCJ_CLIENT); if (useGcjClientStr != null) { bigtableOptionsBuilder.setUseGCJClient(Boolean.parseBoolean(useGcjClientStr)); } return bigtableOptionsBuilder.build(); }
BigtableOptionsFactory { public static BigtableOptions fromConfiguration(final Configuration configuration) throws IOException { BigtableOptions.Builder bigtableOptionsBuilder = BigtableOptions.builder(); bigtableOptionsBuilder.setProjectId(getValue(configuration, PROJECT_ID_KEY, "Project ID")); bigtableOptionsBuilder.setInstanceId(getValue(configuration, INSTANCE_ID_KEY, "Instance ID")); String appProfileId = configuration.get(APP_PROFILE_ID_KEY); if (appProfileId != null) { bigtableOptionsBuilder.setAppProfileId(appProfileId); } String dataHostOverride = configuration.get(BIGTABLE_HOST_KEY); if (dataHostOverride != null) { LOG.debug("API Data endpoint host %s.", dataHostOverride); bigtableOptionsBuilder.setDataHost(dataHostOverride); } String adminHostOverride = configuration.get(BIGTABLE_ADMIN_HOST_KEY); if (adminHostOverride != null) { LOG.debug("Admin endpoint host %s.", adminHostOverride); bigtableOptionsBuilder.setAdminHost(adminHostOverride); } String portOverrideStr = configuration.get(BIGTABLE_PORT_KEY); if (portOverrideStr != null) { bigtableOptionsBuilder.setPort(Integer.parseInt(portOverrideStr)); } String usePlaintextStr = configuration.get(BIGTABLE_USE_PLAINTEXT_NEGOTIATION); if (usePlaintextStr != null) { bigtableOptionsBuilder.setUsePlaintextNegotiation(Boolean.parseBoolean(usePlaintextStr)); } setBulkOptions(configuration, bigtableOptionsBuilder); setChannelOptions(configuration, bigtableOptionsBuilder); setClientCallOptions(configuration, bigtableOptionsBuilder); String emulatorHost = configuration.get(BIGTABLE_EMULATOR_HOST_KEY); if (emulatorHost != null) { bigtableOptionsBuilder.enableEmulator(emulatorHost); } String useBatchStr = configuration.get(BIGTABLE_USE_BATCH); if (useBatchStr != null) { bigtableOptionsBuilder.setUseBatch(Boolean.parseBoolean(useBatchStr)); } String useGcjClientStr = configuration.get(BIGTABLE_USE_GCJ_CLIENT); if (useGcjClientStr != null) { bigtableOptionsBuilder.setUseGCJClient(Boolean.parseBoolean(useGcjClientStr)); } return bigtableOptionsBuilder.build(); } }
BigtableOptionsFactory { public static BigtableOptions fromConfiguration(final Configuration configuration) throws IOException { BigtableOptions.Builder bigtableOptionsBuilder = BigtableOptions.builder(); bigtableOptionsBuilder.setProjectId(getValue(configuration, PROJECT_ID_KEY, "Project ID")); bigtableOptionsBuilder.setInstanceId(getValue(configuration, INSTANCE_ID_KEY, "Instance ID")); String appProfileId = configuration.get(APP_PROFILE_ID_KEY); if (appProfileId != null) { bigtableOptionsBuilder.setAppProfileId(appProfileId); } String dataHostOverride = configuration.get(BIGTABLE_HOST_KEY); if (dataHostOverride != null) { LOG.debug("API Data endpoint host %s.", dataHostOverride); bigtableOptionsBuilder.setDataHost(dataHostOverride); } String adminHostOverride = configuration.get(BIGTABLE_ADMIN_HOST_KEY); if (adminHostOverride != null) { LOG.debug("Admin endpoint host %s.", adminHostOverride); bigtableOptionsBuilder.setAdminHost(adminHostOverride); } String portOverrideStr = configuration.get(BIGTABLE_PORT_KEY); if (portOverrideStr != null) { bigtableOptionsBuilder.setPort(Integer.parseInt(portOverrideStr)); } String usePlaintextStr = configuration.get(BIGTABLE_USE_PLAINTEXT_NEGOTIATION); if (usePlaintextStr != null) { bigtableOptionsBuilder.setUsePlaintextNegotiation(Boolean.parseBoolean(usePlaintextStr)); } setBulkOptions(configuration, bigtableOptionsBuilder); setChannelOptions(configuration, bigtableOptionsBuilder); setClientCallOptions(configuration, bigtableOptionsBuilder); String emulatorHost = configuration.get(BIGTABLE_EMULATOR_HOST_KEY); if (emulatorHost != null) { bigtableOptionsBuilder.enableEmulator(emulatorHost); } String useBatchStr = configuration.get(BIGTABLE_USE_BATCH); if (useBatchStr != null) { bigtableOptionsBuilder.setUseBatch(Boolean.parseBoolean(useBatchStr)); } String useGcjClientStr = configuration.get(BIGTABLE_USE_GCJ_CLIENT); if (useGcjClientStr != null) { bigtableOptionsBuilder.setUseGCJClient(Boolean.parseBoolean(useGcjClientStr)); } return bigtableOptionsBuilder.build(); }  }
BigtableOptionsFactory { public static BigtableOptions fromConfiguration(final Configuration configuration) throws IOException { BigtableOptions.Builder bigtableOptionsBuilder = BigtableOptions.builder(); bigtableOptionsBuilder.setProjectId(getValue(configuration, PROJECT_ID_KEY, "Project ID")); bigtableOptionsBuilder.setInstanceId(getValue(configuration, INSTANCE_ID_KEY, "Instance ID")); String appProfileId = configuration.get(APP_PROFILE_ID_KEY); if (appProfileId != null) { bigtableOptionsBuilder.setAppProfileId(appProfileId); } String dataHostOverride = configuration.get(BIGTABLE_HOST_KEY); if (dataHostOverride != null) { LOG.debug("API Data endpoint host %s.", dataHostOverride); bigtableOptionsBuilder.setDataHost(dataHostOverride); } String adminHostOverride = configuration.get(BIGTABLE_ADMIN_HOST_KEY); if (adminHostOverride != null) { LOG.debug("Admin endpoint host %s.", adminHostOverride); bigtableOptionsBuilder.setAdminHost(adminHostOverride); } String portOverrideStr = configuration.get(BIGTABLE_PORT_KEY); if (portOverrideStr != null) { bigtableOptionsBuilder.setPort(Integer.parseInt(portOverrideStr)); } String usePlaintextStr = configuration.get(BIGTABLE_USE_PLAINTEXT_NEGOTIATION); if (usePlaintextStr != null) { bigtableOptionsBuilder.setUsePlaintextNegotiation(Boolean.parseBoolean(usePlaintextStr)); } setBulkOptions(configuration, bigtableOptionsBuilder); setChannelOptions(configuration, bigtableOptionsBuilder); setClientCallOptions(configuration, bigtableOptionsBuilder); String emulatorHost = configuration.get(BIGTABLE_EMULATOR_HOST_KEY); if (emulatorHost != null) { bigtableOptionsBuilder.enableEmulator(emulatorHost); } String useBatchStr = configuration.get(BIGTABLE_USE_BATCH); if (useBatchStr != null) { bigtableOptionsBuilder.setUseBatch(Boolean.parseBoolean(useBatchStr)); } String useGcjClientStr = configuration.get(BIGTABLE_USE_GCJ_CLIENT); if (useGcjClientStr != null) { bigtableOptionsBuilder.setUseGCJClient(Boolean.parseBoolean(useGcjClientStr)); } return bigtableOptionsBuilder.build(); }  static BigtableOptions fromConfiguration(final Configuration configuration); }
BigtableOptionsFactory { public static BigtableOptions fromConfiguration(final Configuration configuration) throws IOException { BigtableOptions.Builder bigtableOptionsBuilder = BigtableOptions.builder(); bigtableOptionsBuilder.setProjectId(getValue(configuration, PROJECT_ID_KEY, "Project ID")); bigtableOptionsBuilder.setInstanceId(getValue(configuration, INSTANCE_ID_KEY, "Instance ID")); String appProfileId = configuration.get(APP_PROFILE_ID_KEY); if (appProfileId != null) { bigtableOptionsBuilder.setAppProfileId(appProfileId); } String dataHostOverride = configuration.get(BIGTABLE_HOST_KEY); if (dataHostOverride != null) { LOG.debug("API Data endpoint host %s.", dataHostOverride); bigtableOptionsBuilder.setDataHost(dataHostOverride); } String adminHostOverride = configuration.get(BIGTABLE_ADMIN_HOST_KEY); if (adminHostOverride != null) { LOG.debug("Admin endpoint host %s.", adminHostOverride); bigtableOptionsBuilder.setAdminHost(adminHostOverride); } String portOverrideStr = configuration.get(BIGTABLE_PORT_KEY); if (portOverrideStr != null) { bigtableOptionsBuilder.setPort(Integer.parseInt(portOverrideStr)); } String usePlaintextStr = configuration.get(BIGTABLE_USE_PLAINTEXT_NEGOTIATION); if (usePlaintextStr != null) { bigtableOptionsBuilder.setUsePlaintextNegotiation(Boolean.parseBoolean(usePlaintextStr)); } setBulkOptions(configuration, bigtableOptionsBuilder); setChannelOptions(configuration, bigtableOptionsBuilder); setClientCallOptions(configuration, bigtableOptionsBuilder); String emulatorHost = configuration.get(BIGTABLE_EMULATOR_HOST_KEY); if (emulatorHost != null) { bigtableOptionsBuilder.enableEmulator(emulatorHost); } String useBatchStr = configuration.get(BIGTABLE_USE_BATCH); if (useBatchStr != null) { bigtableOptionsBuilder.setUseBatch(Boolean.parseBoolean(useBatchStr)); } String useGcjClientStr = configuration.get(BIGTABLE_USE_GCJ_CLIENT); if (useGcjClientStr != null) { bigtableOptionsBuilder.setUseGCJClient(Boolean.parseBoolean(useGcjClientStr)); } return bigtableOptionsBuilder.build(); }  static BigtableOptions fromConfiguration(final Configuration configuration); static final String BIGTABLE_PORT_KEY; static final String BIGTABLE_ADMIN_HOST_KEY; static final String BIGTABLE_HOST_KEY; static final String BIGTABLE_EMULATOR_HOST_KEY; static final String PROJECT_ID_KEY; static final String INSTANCE_ID_KEY; static final String APP_PROFILE_ID_KEY; static final String BIGTABLE_SNAPSHOT_CLUSTER_ID_KEY; static final String BIGTABLE_SNAPSHOT_DEFAULT_TTL_SECS_KEY; static final String CUSTOM_USER_AGENT_KEY; static final String BIGTABLE_USE_SERVICE_ACCOUNTS_KEY; static final boolean BIGTABLE_USE_SERVICE_ACCOUNTS_DEFAULT; static final String BIGTABLE_NULL_CREDENTIAL_ENABLE_KEY; static final boolean BIGTABLE_NULL_CREDENTIAL_ENABLE_DEFAULT; static final String BIGTABLE_SERVICE_ACCOUNT_EMAIL_KEY; static final String BIGTABLE_SERVICE_ACCOUNT_P12_KEYFILE_LOCATION_KEY; static final String BIGTABLE_SERVICE_ACCOUNT_JSON_KEYFILE_LOCATION_KEY; static final String BIGTABLE_SERVICE_ACCOUNT_JSON_VALUE_KEY; static final String ENABLE_GRPC_RETRIES_KEY; static final String ALLOW_NO_TIMESTAMP_RETRIES_KEY; static final String ADDITIONAL_RETRY_CODES; static final String ENABLE_GRPC_RETRY_DEADLINEEXCEEDED_KEY; static final String INITIAL_ELAPSED_BACKOFF_MILLIS_KEY; static final String MAX_ELAPSED_BACKOFF_MILLIS_KEY; static final String READ_PARTIAL_ROW_TIMEOUT_MS; static final String MAX_SCAN_TIMEOUT_RETRIES; static final String READ_BUFFER_SIZE; static final String BIGTABLE_DATA_CHANNEL_COUNT_KEY; static final String BIGTABLE_USE_BULK_API; static final String BIGTABLE_USE_BATCH; static final String BIGTABLE_BULK_MAX_REQUEST_SIZE_BYTES; static final String BIGTABLE_BULK_MAX_ROW_KEY_COUNT; static final String BIGTABLE_BULK_AUTOFLUSH_MS_KEY; static final String MAX_INFLIGHT_RPCS_KEY; static final String BIGTABLE_BUFFERED_MUTATOR_MAX_MEMORY_KEY; @Deprecated
  static final String BIGTABLE_BUFFERED_MUTATOR_ENABLE_THROTTLING; @Deprecated
  static final String BIGTABLE_BUFFERED_MUTATOR_THROTTLING_THRESHOLD_MILLIS; static final String BIGTABLE_USE_PLAINTEXT_NEGOTIATION; static final String BIGTABLE_USE_CACHED_DATA_CHANNEL_POOL; static final String BIGTABLE_ASYNC_MUTATOR_COUNT_KEY; static final String BIGTABLE_USE_TIMEOUTS_KEY; static final String BIGTABLE_RPC_TIMEOUT_MS_KEY; @Deprecated
  static final String BIGTABLE_LONG_RPC_TIMEOUT_MS_KEY; static final String BIGTABLE_MUTATE_RPC_TIMEOUT_MS_KEY; static final String BIGTABLE_READ_RPC_TIMEOUT_MS_KEY; static final String BIGTABLE_NAMESPACE_WARNING_KEY; static final String BIGTABLE_USE_GCJ_CLIENT; }