Skip to content

Commit

Permalink
Removing the streamingBatchSize option, since it's no longer useful. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sduskis committed Aug 30, 2016
1 parent cc4217c commit d6269c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public class RetryOptions implements Serializable {

/** Constant <code>DEFAULT_STREAMING_BUFFER_SIZE=60</code> */
public static int DEFAULT_STREAMING_BUFFER_SIZE = 60;
/** Constant <code>DEFAULT_STREAMING_BATCH_SIZE=DEFAULT_STREAMING_BUFFER_SIZE / 2</code> */
public static int DEFAULT_STREAMING_BATCH_SIZE = DEFAULT_STREAMING_BUFFER_SIZE / 2;

/**
* Flag indicating whether or not grpc retries should be enabled.
Expand Down Expand Up @@ -92,7 +90,6 @@ public static class Builder {
private double backoffMultiplier = DEFAULT_BACKOFF_MULTIPLIER;
private int maxElaspedBackoffMillis = DEFAULT_MAX_ELAPSED_BACKOFF_MILLIS;
private int streamingBufferSize = DEFAULT_STREAMING_BUFFER_SIZE;
private int streamingBatchSize = DEFAULT_STREAMING_BATCH_SIZE;
private int readPartialRowTimeoutMillis = DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS;
private int maxScanTimeoutRetries = DEFAULT_MAX_SCAN_TIMEOUT_RETRIES;
private Set<Status.Code> statusToRetryOn = new HashSet<>(DEFAULT_ENABLE_GRPC_RETRIES_SET);
Expand All @@ -107,7 +104,6 @@ public Builder(RetryOptions options) {
this.backoffMultiplier = options.backoffMultiplier;
this.maxElaspedBackoffMillis = options.maxElaspedBackoffMillis;
this.streamingBufferSize = options.streamingBufferSize;
this.streamingBatchSize = options.streamingBatchSize;
this.readPartialRowTimeoutMillis = options.readPartialRowTimeoutMillis;
this.maxScanTimeoutRetries = options.maxScanTimeoutRetries;
this.statusToRetryOn = new HashSet<>(options.statusToRetryOn);
Expand Down Expand Up @@ -166,14 +162,6 @@ public Builder setStreamingBufferSize(int streamingBufferSize) {
return this;
}

/**
* Set the number of messages to request when scanning.
*/
public Builder setStreamingBatchSize(int streamingBatchSize) {
this.streamingBatchSize = streamingBatchSize;
return this;
}

/**
* Set the timeout in milliseconds for reading individual
* ReadRowsResponse messages from a stream.
Expand Down Expand Up @@ -216,7 +204,6 @@ public RetryOptions build() {
backoffMultiplier,
maxElaspedBackoffMillis,
streamingBufferSize,
streamingBatchSize,
readPartialRowTimeoutMillis,
maxScanTimeoutRetries,
ImmutableSet.copyOf(statusToRetryOn));
Expand All @@ -229,7 +216,6 @@ public RetryOptions build() {
private final int maxElaspedBackoffMillis;
private final double backoffMultiplier;
private final int streamingBufferSize;
private final int streamingBatchSize;
private final int readPartialRowTimeoutMillis;
private final int maxScanTimeoutRetries;
private final ImmutableSet<Code> statusToRetryOn;
Expand All @@ -255,7 +241,6 @@ public RetryOptions(
double backoffMultiplier,
int maxElaspedBackoffMillis,
int streamingBufferSize,
int streamingBatchSize,
int readPartialRowTimeoutMillis,
int maxScanTimeoutRetries,
ImmutableSet<Code> statusToRetryOn) {
Expand All @@ -265,7 +250,6 @@ public RetryOptions(
this.maxElaspedBackoffMillis = maxElaspedBackoffMillis;
this.backoffMultiplier = backoffMultiplier;
this.streamingBufferSize = streamingBufferSize;
this.streamingBatchSize = streamingBatchSize;
this.readPartialRowTimeoutMillis = readPartialRowTimeoutMillis;
this.maxScanTimeoutRetries = maxScanTimeoutRetries;
this.statusToRetryOn = statusToRetryOn;
Expand Down Expand Up @@ -334,15 +318,6 @@ public int getStreamingBufferSize() {
return streamingBufferSize;
}

/**
* The number of messages to request when scanning.
*
* @return a int.
*/
public int getStreamingBatchSize() {
return streamingBatchSize;
}

/**
* A timeout for reading individual ReadRowsResponse messages from a stream.
*
Expand Down Expand Up @@ -411,7 +386,6 @@ public boolean equals(Object obj) {
&& maxElaspedBackoffMillis == other.maxElaspedBackoffMillis
&& backoffMultiplier == other.backoffMultiplier
&& streamingBufferSize == other.streamingBufferSize
&& streamingBatchSize == other.streamingBatchSize
&& readPartialRowTimeoutMillis == other.readPartialRowTimeoutMillis
&& maxScanTimeoutRetries == other.maxScanTimeoutRetries;
}
Expand All @@ -428,7 +402,6 @@ public String toString() {
.add("maxElaspedBackoffMillis", maxElaspedBackoffMillis)
.add("backoffMultiplier", backoffMultiplier)
.add("streamingBufferSize", streamingBufferSize)
.add("streamingBatchSize", streamingBatchSize)
.add("readPartialRowTimeoutMillis", readPartialRowTimeoutMillis)
.add("maxScanTimeoutRetries", maxScanTimeoutRetries)
.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static com.google.cloud.bigtable.config.RetryOptions.DEFAULT_MAX_SCAN_TIMEOUT_RETRIES;
import static com.google.cloud.bigtable.config.RetryOptions.DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS;
import static com.google.cloud.bigtable.config.RetryOptions.DEFAULT_STREAMING_BUFFER_SIZE;
import static com.google.cloud.bigtable.config.RetryOptions.DEFAULT_STREAMING_BATCH_SIZE;
import static com.google.cloud.bigtable.config.RetryOptions.DEFAULT_ENABLE_GRPC_RETRIES_SET;

import com.google.api.client.util.ExponentialBackOff;
Expand All @@ -35,12 +34,12 @@ public static RetryOptions createTestRetryOptions(final NanoClock nanoClock) {
return createTestRetryOptions(nanoClock, false);
}

public static RetryOptions createTestRetryOptions(final NanoClock nanoClock, boolean allowRetriesWithoutTimestamp) {
public static RetryOptions createTestRetryOptions(final NanoClock nanoClock,
boolean allowRetriesWithoutTimestamp) {
return new RetryOptions(true, allowRetriesWithoutTimestamp, DEFAULT_INITIAL_BACKOFF_MILLIS,
DEFAULT_BACKOFF_MULTIPLIER, DEFAULT_MAX_ELAPSED_BACKOFF_MILLIS,
DEFAULT_STREAMING_BUFFER_SIZE, DEFAULT_STREAMING_BATCH_SIZE,
DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS, DEFAULT_MAX_SCAN_TIMEOUT_RETRIES,
DEFAULT_ENABLE_GRPC_RETRIES_SET) {
DEFAULT_STREAMING_BUFFER_SIZE, DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS,
DEFAULT_MAX_SCAN_TIMEOUT_RETRIES, DEFAULT_ENABLE_GRPC_RETRIES_SET) {
private static final long serialVersionUID = 1L;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ public class BigtableOptionsFactory {
*/
public static final String READ_BUFFER_SIZE = "google.bigtable.grpc.read.streaming.buffer.size";

/**
* Key to set the batch size of messages to request when scanning.
*/
public static final String READ_BATCH_SIZE = "google.bigtable.grpc.read.streaming.batch.size";

/**
* The number of grpc channels to open for asynchronous processing such as puts.
*/
Expand Down Expand Up @@ -402,11 +397,6 @@ private static RetryOptions createRetryOptions(Configuration configuration) {
LOG.debug("gRPC read buffer size (count): %d", streamingBufferSize);
retryOptionsBuilder.setStreamingBufferSize(streamingBufferSize);

int streamingBatchSize = configuration.getInt(
READ_BATCH_SIZE, RetryOptions.DEFAULT_STREAMING_BATCH_SIZE);
LOG.debug("gRPC read batch size (count): %d", streamingBatchSize);
retryOptionsBuilder.setStreamingBatchSize(streamingBatchSize);

int maxScanTimeoutRetries = configuration.getInt(
MAX_SCAN_TIMEOUT_RETRIES, RetryOptions.DEFAULT_MAX_SCAN_TIMEOUT_RETRIES);
LOG.debug("gRPC max scan timeout retries (count): %d", maxScanTimeoutRetries);
Expand Down

0 comments on commit d6269c8

Please sign in to comment.