use of com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor in project java-bigtable by googleapis.
the class BigtableBatchingCallSettingsTest method testEmptyBuilder.
@Test
public void testEmptyBuilder() {
BigtableBatchingCallSettings.Builder builder = BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor());
assertThat(builder.getBatchingSettings()).isNull();
assertThat(builder.getRetryableCodes()).isEmpty();
assertThat(builder.getRetrySettings()).isNotNull();
assertThat(builder.isLatencyBasedThrottlingEnabled()).isFalse();
assertThat(builder.getTargetRpcLatencyMs()).isNull();
assertThat(builder.getDynamicFlowControlSettings()).isNull();
}
use of com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor in project java-bigtable by googleapis.
the class BigtableBatchingCallSettingsTest method testFlowControlMandatorySettings.
@Test
public void testFlowControlMandatorySettings() {
Exception actualEx = null;
try {
BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()).setBatchingSettings(BatchingSettings.newBuilder().setFlowControlSettings(FlowControlSettings.newBuilder().setMaxOutstandingElementCount(null).setMaxOutstandingRequestBytes(null).build()).build()).build();
} catch (Exception ex) {
actualEx = ex;
}
assertThat(actualEx).isInstanceOf(IllegalStateException.class);
BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()).setBatchingSettings(BatchingSettings.newBuilder().setFlowControlSettings(FlowControlSettings.newBuilder().setMaxOutstandingElementCount(10L).setMaxOutstandingRequestBytes(10L).build()).setElementCountThreshold(10L).setRequestByteThreshold(10L).build()).build();
actualEx = null;
try {
BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()).setBatchingSettings(BatchingSettings.newBuilder().setFlowControlSettings(FlowControlSettings.newBuilder().setMaxOutstandingElementCount(10L).setMaxOutstandingRequestBytes(5L).build()).setElementCountThreshold(10L).setRequestByteThreshold(10L).build()).build();
} catch (Exception ex) {
actualEx = ex;
}
assertThat(actualEx).isInstanceOf(IllegalArgumentException.class);
actualEx = null;
try {
BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()).setBatchingSettings(BatchingSettings.newBuilder().setFlowControlSettings(FlowControlSettings.newBuilder().setMaxOutstandingElementCount(5L).setMaxOutstandingRequestBytes(10L).build()).setElementCountThreshold(10L).setRequestByteThreshold(10L).build()).build();
} catch (Exception ex) {
actualEx = ex;
}
assertThat(actualEx).isInstanceOf(IllegalArgumentException.class);
}
Aggregations