Skip to content

Commit cf478ae

Browse files
Removed Beta tag from Bulk, Batch and Patch APIs. Deleted Deprecated classes (Azure#24433)
* Removed Beta tag from Bulk, Batch and Patch APIs. Deleted Deprecated classes * Removed unnecessary APIs from BridgeInternal, fixed unit tests * Removed unnecessary ImplementationBridgeHelpers * Updated java docs for a dummy commit to restart the pipeline
1 parent 1d332e2 commit cf478ae

File tree

44 files changed

+58
-4475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+58
-4475
lines changed

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/BridgeInternal.java

Lines changed: 0 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
import com.azure.cosmos.implementation.DiagnosticsClientContext;
1313
import com.azure.cosmos.implementation.Document;
1414
import com.azure.cosmos.implementation.FeedResponseDiagnostics;
15-
import com.azure.cosmos.implementation.ImplementationBridgeHelpers;
1615
import com.azure.cosmos.implementation.InternalObjectNode;
1716
import com.azure.cosmos.implementation.JsonSerializable;
1817
import com.azure.cosmos.implementation.MetadataDiagnosticsContext;
1918
import com.azure.cosmos.implementation.QueryMetrics;
2019
import com.azure.cosmos.implementation.ReplicationPolicy;
21-
import com.azure.cosmos.implementation.RequestOptions;
2220
import com.azure.cosmos.implementation.RequestTimeline;
2321
import com.azure.cosmos.implementation.Resource;
2422
import com.azure.cosmos.implementation.ResourceResponse;
@@ -35,11 +33,9 @@
3533
import com.azure.cosmos.implementation.directconnectivity.Uri;
3634
import com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdChannelAcquisitionTimeline;
3735
import com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdEndpointStatistics;
38-
import com.azure.cosmos.implementation.patch.PatchOperation;
3936
import com.azure.cosmos.implementation.query.QueryInfo;
4037
import com.azure.cosmos.implementation.query.metrics.ClientSideMetrics;
4138
import com.azure.cosmos.implementation.routing.PartitionKeyInternal;
42-
import com.azure.cosmos.models.CosmosBulkExecutionOptions;
4339
import com.azure.cosmos.models.CosmosItemResponse;
4440
import com.azure.cosmos.models.CosmosStoredProcedureProperties;
4541
import com.azure.cosmos.models.FeedResponse;
@@ -714,110 +710,6 @@ public static Duration getRequestTimeoutFromGatewayConnectionConfig(GatewayConne
714710
return gatewayConnectionConfig.getRequestTimeout();
715711
}
716712

717-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
718-
public static String getOperationValueForCosmosItemOperationType(CosmosItemOperationType cosmosItemOperationType) {
719-
return cosmosItemOperationType.getOperationValue();
720-
}
721-
722-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
723-
public static RequestOptions toRequestOptions(TransactionalBatchRequestOptions transactionalBatchRequestOptions) {
724-
return transactionalBatchRequestOptions.toRequestOptions();
725-
}
726-
727-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
728-
public static TransactionalBatchOperationResult createTransactionBatchResult(
729-
String eTag,
730-
double requestCharge,
731-
ObjectNode resourceObject,
732-
int statusCode,
733-
Duration retryAfter,
734-
int subStatusCode,
735-
CosmosItemOperation cosmosItemOperation) {
736-
737-
return new TransactionalBatchOperationResult(
738-
eTag,
739-
requestCharge,
740-
resourceObject,
741-
statusCode,
742-
retryAfter,
743-
subStatusCode,
744-
cosmosItemOperation);
745-
}
746-
747-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
748-
public static CosmosBulkItemResponse createCosmosBulkItemResponse(
749-
TransactionalBatchOperationResult result,
750-
TransactionalBatchResponse response) {
751-
752-
return new CosmosBulkItemResponse(
753-
result.getETag(),
754-
result.getRequestCharge(),
755-
result.getResourceObject(),
756-
result.getStatusCode(),
757-
result.getRetryAfterDuration(),
758-
result.getSubStatusCode(),
759-
response.getResponseHeaders(),
760-
response.getDiagnostics());
761-
}
762-
763-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
764-
public static <TContext> CosmosBulkOperationResponse<TContext> createCosmosBulkOperationResponse(
765-
CosmosItemOperation operation,
766-
CosmosBulkItemResponse response,
767-
TContext batchContext) {
768-
769-
return new CosmosBulkOperationResponse<>(
770-
operation,
771-
response,
772-
batchContext);
773-
}
774-
775-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
776-
public static <TContext> CosmosBulkOperationResponse<TContext> createCosmosBulkOperationResponse(
777-
CosmosItemOperation operation,
778-
Exception exception,
779-
TContext batchContext) {
780-
781-
return new CosmosBulkOperationResponse<>(
782-
operation,
783-
exception,
784-
batchContext);
785-
}
786-
787-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
788-
public static TransactionalBatchResponse createTransactionBatchResponse(
789-
int responseStatusCode,
790-
int responseSubStatusCode,
791-
String errorMessage,
792-
Map<String, String> responseHeaders,
793-
CosmosDiagnostics cosmosDiagnostics) {
794-
795-
return new TransactionalBatchResponse(
796-
responseStatusCode,
797-
responseSubStatusCode,
798-
errorMessage,
799-
responseHeaders,
800-
cosmosDiagnostics);
801-
}
802-
803-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
804-
public static void addTransactionBatchResultInResponse(
805-
TransactionalBatchResponse transactionalBatchResponse,
806-
List<TransactionalBatchOperationResult> transactionalBatchOperationResults) {
807-
808-
transactionalBatchResponse.addAll(transactionalBatchOperationResults);
809-
}
810-
811-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
812-
public static List<PatchOperation> getPatchOperationsFromCosmosPatch(CosmosPatchOperations cosmosPatchOperations) {
813-
return cosmosPatchOperations.getPatchOperations();
814-
}
815-
816-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
817-
public static int getPayloadLength(TransactionalBatchResponse transactionalBatchResponse) {
818-
return transactionalBatchResponse.getResponseLength();
819-
}
820-
821713
@Warning(value = INTERNAL_USE_ONLY_WARNING)
822714
public static SqlQuerySpec getOfferQuerySpecFromResourceId(CosmosAsyncContainer container, String resourceId) {
823715
return container.getDatabase().getOfferQuerySpecFromResourceId(resourceId);
@@ -836,88 +728,4 @@ public static RetryContext getRetryContext(CosmosDiagnostics cosmosDiagnostics)
836728
return null;
837729
}
838730
}
839-
840-
// This is only temporary, and will be removed once we delete BulkExecutionOptions
841-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
842-
public static CosmosBulkExecutionOptions createCosmosBulkExecutionOptions(BulkExecutionOptions bulkExecutionOptions) {
843-
return bulkExecutionOptions.toCosmosBulkExecutionOptions();
844-
}
845-
846-
// This is only temporary, and will be removed once we delete CosmosItemOperationType
847-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
848-
public static CosmosItemOperationType toDeprecatedCosmosItemOperationType(com.azure.cosmos.models.CosmosItemOperationType cosmosItemOperationType) {
849-
switch (cosmosItemOperationType) {
850-
case CREATE:
851-
return CosmosItemOperationType.CREATE;
852-
case DELETE:
853-
return CosmosItemOperationType.DELETE;
854-
case PATCH:
855-
return CosmosItemOperationType.PATCH;
856-
case READ:
857-
return CosmosItemOperationType.READ;
858-
case UPSERT:
859-
return CosmosItemOperationType.UPSERT;
860-
case REPLACE:
861-
return CosmosItemOperationType.REPLACE;
862-
default:
863-
throw new UnsupportedOperationException("CosmosOperationType : " + cosmosItemOperationType + " is not supported");
864-
}
865-
}
866-
867-
// This is only temporary, and will be removed once we delete CosmosItemOperation
868-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
869-
public static CosmosItemOperation toDeprecatedCosmosItemOperation(com.azure.cosmos.models.CosmosItemOperation cosmosItemOperation) {
870-
return new CosmosItemOperation() {
871-
@Override
872-
public String getId() {
873-
return cosmosItemOperation.getId();
874-
}
875-
876-
@Override
877-
public PartitionKey getPartitionKeyValue() {
878-
return cosmosItemOperation.getPartitionKeyValue();
879-
}
880-
881-
@Override
882-
public com.azure.cosmos.CosmosItemOperationType getOperationType() {
883-
return toDeprecatedCosmosItemOperationType(cosmosItemOperation.getOperationType());
884-
}
885-
886-
@Override
887-
public <T> T getItem() {
888-
return cosmosItemOperation.getItem();
889-
}
890-
891-
@Override
892-
public <T> T getContext() {
893-
return cosmosItemOperation.getContext();
894-
}
895-
};
896-
}
897-
898-
899-
// This is only temporary, and will be removed once we delete CosmosBulkItemResponse
900-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
901-
public static CosmosBulkItemResponse toDeprecatedCosmosBulkItemResponse(com.azure.cosmos.models.CosmosBulkItemResponse cosmosBulkItemResponse) {
902-
return new CosmosBulkItemResponse(cosmosBulkItemResponse.getETag(),
903-
cosmosBulkItemResponse.getRequestCharge(),
904-
ImplementationBridgeHelpers
905-
.CosmosBulkItemResponseHelper
906-
.getCosmosBulkItemResponseAccessor()
907-
.getResourceObject(cosmosBulkItemResponse),
908-
cosmosBulkItemResponse.getStatusCode(),
909-
cosmosBulkItemResponse.getRetryAfterDuration(),
910-
cosmosBulkItemResponse.getSubStatusCode(),
911-
cosmosBulkItemResponse.getResponseHeaders(),
912-
cosmosBulkItemResponse.getCosmosDiagnostics());
913-
}
914-
915-
// This is only temporary, and will be removed once we delete CosmosBulkOperationResponse
916-
@Warning(value = INTERNAL_USE_ONLY_WARNING)
917-
public static <TContext> CosmosBulkOperationResponse<TContext> toDeprecatedCosmosBulkOperationResponse(com.azure.cosmos.models.CosmosBulkOperationResponse<TContext> cosmosBulkOperationResponse) {
918-
return new CosmosBulkOperationResponse<TContext>(toDeprecatedCosmosItemOperation(cosmosBulkOperationResponse.getOperation()),
919-
toDeprecatedCosmosBulkItemResponse(cosmosBulkOperationResponse.getResponse()),
920-
cosmosBulkOperationResponse.getException(),
921-
cosmosBulkOperationResponse.getBatchContext());
922-
}
923731
}

0 commit comments

Comments
 (0)