Skip to content

Commit

Permalink
Added java docs for BulkProcessingOptions (#22863)
Browse files Browse the repository at this point in the history
* Added java docs for BulkProcessingOptions

* Added java docs for BulkProcessingThresholds
  • Loading branch information
kushagraThapar authored Jul 8, 2021
1 parent 7385cd8 commit cf269bf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

import com.azure.cosmos.implementation.ImplementationBridgeHelpers;
import com.azure.cosmos.implementation.batch.BatchRequestResponseConstants;
import com.azure.cosmos.implementation.spark.OperationContext;
import com.azure.cosmos.implementation.spark.OperationContextAndListenerTuple;
import com.azure.cosmos.models.CosmosItemRequestOptions;
import com.azure.cosmos.util.Beta;
import reactor.core.publisher.Flux;

Expand All @@ -30,6 +28,11 @@ public final class BulkProcessingOptions<TContext> {
private final BulkProcessingThresholds<TContext> thresholds;
private OperationContextAndListenerTuple operationContextAndListenerTuple;

/**
* Constructor
* @param batchContext batch context
* @param thresholds thresholds
*/
@Beta(value = Beta.SinceVersion.V4_17_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public BulkProcessingOptions(TContext batchContext, BulkProcessingThresholds<TContext> thresholds) {
this.batchContext = batchContext;
Expand All @@ -40,16 +43,27 @@ public BulkProcessingOptions(TContext batchContext, BulkProcessingThresholds<TCo
}
}

/**
* Constructor
* @param batchContext batch context
*/
@Beta(value = Beta.SinceVersion.V4_9_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public BulkProcessingOptions(TContext batchContext) {
this(batchContext, null);
}

/**
* Constructor
*/
@Beta(value = Beta.SinceVersion.V4_9_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public BulkProcessingOptions() {
this(null);
}

/**
* Returns micro batch size
* @return micro batch size
*/
@Beta(value = Beta.SinceVersion.V4_9_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public int getMaxMicroBatchSize() {
return maxMicroBatchSize;
Expand Down Expand Up @@ -77,6 +91,10 @@ public BulkProcessingOptions<TContext> setMaxMicroBatchSize(int maxMicroBatchSiz
return this;
}

/**
* Returns max micro batch concurrency
* @return max micro batch concurrency
*/
@Beta(value = Beta.SinceVersion.V4_9_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public int getMaxMicroBatchConcurrency() {
return maxMicroBatchConcurrency;
Expand All @@ -95,6 +113,10 @@ public BulkProcessingOptions<TContext> setMaxMicroBatchConcurrency(int maxMicroB
return this;
}

/**
* Returns max micro batch interval
* @return max micro batch interval
*/
@Beta(value = Beta.SinceVersion.V4_9_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public Duration getMaxMicroBatchInterval() {
return maxMicroBatchInterval;
Expand All @@ -113,6 +135,10 @@ public BulkProcessingOptions<TContext> setMaxMicroBatchInterval(Duration maxMicr
return this;
}

/**
* Returns max targeted micro batch retry rate
* @return max targeted micro batch retry rate
*/
@Beta(value = Beta.SinceVersion.V4_17_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public double getMaxTargetedMicroBatchRetryRate() {
return this.maxMicroBatchRetryRate;
Expand Down Expand Up @@ -145,16 +171,28 @@ public BulkProcessingOptions<TContext> setTargetedMicroBatchRetryRate(double min
return this;
}

/**
* Returns min targeted micro batch retry rate
* @return min targeted micro batch retry rate
*/
@Beta(value = Beta.SinceVersion.V4_17_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public double getMinTargetedMicroBatchRetryRate() {
return this.minMicroBatchRetryRate;
}

/**
* Returns batch context
* @return batch context
*/
@Beta(value = Beta.SinceVersion.V4_9_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public TContext getBatchContext() {
return batchContext;
}

/**
* Returns thresholds
* @return thresholds
*/
@Beta(value = Beta.SinceVersion.V4_17_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public BulkProcessingThresholds<TContext> getThresholds() {
return this.thresholds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
* expected to have similar characteristics and the context for determining the micro batch size should be preserved.
*/
@Beta(value = Beta.SinceVersion.V4_17_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public class BulkProcessingThresholds<TContext> {
public final class BulkProcessingThresholds<TContext> {
private final ConcurrentMap<String, PartitionScopeThresholds<TContext>> partitionScopeThresholds;

/**
* Constructor
*/
@Beta(value = Beta.SinceVersion.V4_17_0, warningText = Beta.PREVIEW_SUBJECT_TO_CHANGE_WARNING)
public BulkProcessingThresholds() {
this.partitionScopeThresholds = new ConcurrentHashMap<>();
Expand Down

0 comments on commit cf269bf

Please sign in to comment.