use of com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor in project java-bigtable by googleapis.
the class BigtableBulkReadRowsCallSettingsTest method testEmptyBuilder.
@Test
public void testEmptyBuilder() {
BigtableBulkReadRowsCallSettings.Builder builder = BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor());
assertThat(builder.getBatchingSettings()).isNull();
assertThat(builder.getRetryableCodes()).isEmpty();
assertThat(builder.getRetrySettings()).isNotNull();
}
use of com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor in project java-bigtable by googleapis.
the class BigtableBulkReadRowsCallSettingsTest method testBuilder.
@Test
public void testBuilder() {
BigtableBulkReadRowsCallSettings.Builder builder = BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor());
Set<StatusCode.Code> retryCodes = ImmutableSet.of(StatusCode.Code.UNAVAILABLE);
RetrySettings retrySettings = RetrySettings.newBuilder().build();
builder.setBatchingSettings(BATCHING_SETTINGS).setRetryableCodes(retryCodes).setRetrySettings(retrySettings);
BigtableBulkReadRowsCallSettings settings = builder.build();
assertThat(settings.getBatchingSettings()).isEqualTo(BATCHING_SETTINGS);
assertThat(settings.getRetryableCodes()).isEqualTo(retryCodes);
assertThat(settings.getRetrySettings()).isEqualTo(retrySettings);
}
use of com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor in project java-bigtable by googleapis.
the class BigtableBulkReadRowsCallSettingsTest method testBuilderFromSettings.
@Test
public void testBuilderFromSettings() {
BigtableBulkReadRowsCallSettings.Builder builder = BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor());
RetrySettings retrySettings = RetrySettings.newBuilder().setTotalTimeout(Duration.ofMinutes(1)).build();
builder.setBatchingSettings(BATCHING_SETTINGS).setRetryableCodes(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED).setRetrySettings(retrySettings);
BigtableBulkReadRowsCallSettings settings = builder.build();
BigtableBulkReadRowsCallSettings.Builder newBuilder = settings.toBuilder();
assertThat(newBuilder.getBatchingSettings()).isEqualTo(BATCHING_SETTINGS);
assertThat(newBuilder.getRetryableCodes()).containsExactly(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED);
assertThat(newBuilder.getRetrySettings()).isEqualTo(retrySettings);
}
Aggregations