Search in sources :

Example 1 with ReadRowsBatchingDescriptor

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();
}
Also used : ReadRowsBatchingDescriptor(com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor) Test(org.junit.Test)

Example 2 with ReadRowsBatchingDescriptor

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);
}
Also used : RetrySettings(com.google.api.gax.retrying.RetrySettings) ReadRowsBatchingDescriptor(com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor) StatusCode(com.google.api.gax.rpc.StatusCode) Test(org.junit.Test)

Example 3 with ReadRowsBatchingDescriptor

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);
}
Also used : RetrySettings(com.google.api.gax.retrying.RetrySettings) ReadRowsBatchingDescriptor(com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor) Test(org.junit.Test)

Aggregations

ReadRowsBatchingDescriptor (com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor)3 Test (org.junit.Test)3 RetrySettings (com.google.api.gax.retrying.RetrySettings)2 StatusCode (com.google.api.gax.rpc.StatusCode)1