use of com.google.cloud.bigtable.config.BigtableOptions in project beam by apache.
the class BigtableIOTest method testReadWithBigTableOptionsSetsRetryOptions.
@Test
public void testReadWithBigTableOptionsSetsRetryOptions() {
final int initialBackoffMillis = -1;
BigtableOptions.Builder optionsBuilder = BIGTABLE_OPTIONS.toBuilder();
RetryOptions.Builder retryOptionsBuilder = new RetryOptions.Builder();
retryOptionsBuilder.setInitialBackoffMillis(initialBackoffMillis);
optionsBuilder.setRetryOptions(retryOptionsBuilder.build());
BigtableIO.Read read = BigtableIO.read().withBigtableOptions(optionsBuilder.build());
BigtableOptions options = read.getBigtableOptions();
assertEquals(initialBackoffMillis, options.getRetryOptions().getInitialBackoffMillis());
assertThat(options.getRetryOptions(), Matchers.equalTo(retryOptionsBuilder.build()));
}
use of com.google.cloud.bigtable.config.BigtableOptions in project beam by apache.
the class BigtableServiceImplTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
BigtableOptions options = new BigtableOptions.Builder().setProjectId(PROJECT_ID).setInstanceId(INSTANCE_ID).build();
when(mockSession.getOptions()).thenReturn(options);
when(mockSession.createBulkMutation(eq(TABLE_NAME))).thenReturn(mockBulkMutation);
when(mockSession.getDataClient()).thenReturn(mockBigtableDataClient);
// Setup the ProcessWideContainer for testing metrics are set.
MetricsContainerImpl container = new MetricsContainerImpl(null);
MetricsEnvironment.setProcessWideContainer(container);
}
Aggregations