Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added java docs for BulkProcessingOptions #22863

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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