Skip to content
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 @@ -805,7 +805,7 @@
<Match>
<Or>
<Class name="com.azure.cosmos.ClientSideRequestStatistics"/>
<Class name="com.azure.cosmos.models.CosmosAsyncItemResponse"/>
<Class name="com.azure.cosmos.models.CosmosItemResponse"/>
</Or>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
Expand Down Expand Up @@ -884,40 +884,6 @@
<Bug pattern="DM_BOXED_PRIMITIVE_FOR_PARSING"/>
</Match>

<!-- When setting the value which this method returns, it is ensured that value is of CosmosContainerProperties -->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncContainerResponse"/>
<Method name="getProperties"/>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
</Match>

<!-- When setting the value which this method returns, it is ensured that value is of CosmosDatabaseProperties -->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncDatabaseResponse"/>
<Method name="getProperties"/>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
</Match>

<!-- When setting the value which this method returns, it is ensured that value is of CosmosPermissionProperties -->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncPermissionResponse"/>
<Method name="getProperties"/>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
</Match>

<!-- When setting the value which this method returns, it is ensured that value is of CosmosStoredProcedureProperties -->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncStoredProcedureResponse"/>
<Method name="getProperties"/>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
</Match>

<!-- When setting the value which this method returns, it is ensured that value is of CosmosUserProperties -->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncUserResponse"/>
<Method name="getProperties"/>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
</Match>

<!-- Extra null check is for assertion -->
<Match>
Expand All @@ -937,7 +903,7 @@
Issue: https://github.com/Azure/azure-sdk-for-java/issues/9054
-->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncItemResponse"/>
<Class name="com.azure.cosmos.models.CosmosItemResponse"/>
<Method name="getItem"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"/>
</Match>
Expand Down Expand Up @@ -1188,7 +1154,7 @@

<!-- Bug: https://github.com/Azure/azure-sdk-for-java/issues/9054 -->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncItemResponse"/>
<Class name="com.azure.cosmos.models.CosmosItemResponse"/>
<Field name="item"/>
<Bug pattern="DC_DOUBLECHECK"/>
</Match>
Expand Down Expand Up @@ -1588,13 +1554,6 @@
<Bug pattern="UUF_UNUSED_FIELD"/>
</Match>

<!-- Bug: https://github.com/Azure/azure-sdk-for-java/issues/9096 -->
<Match>
<Class name="com.azure.cosmos.models.CosmosAsyncConflictResponse"/>
<Method name="getProperties"/>
<Bug pattern="IL_INFINITE_RECURSIVE_LOOP"/>
</Match>

<!-- Bug: https://github.com/Azure/azure-sdk-for-java/issues/9096 -->
<Match>
<Class name="com.azure.cosmos.models.SqlParameterList"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.azure.cosmos.DirectConnectionConfig;
import com.azure.cosmos.GatewayConnectionConfig;
import com.azure.cosmos.implementation.HttpConstants;
import com.azure.cosmos.models.CosmosAsyncItemResponse;
import com.azure.cosmos.models.CosmosItemResponse;
import com.azure.cosmos.models.PartitionKey;
import com.azure.cosmos.models.ThroughputProperties;
import com.codahale.metrics.ConsoleReporter;
Expand Down Expand Up @@ -331,7 +331,7 @@ private void performWorkload(BaseSubscriber<PojoizedJson> baseSubscriber, long i
String partitionKeyValue = doc.getId();
result = client.getDatabase(configuration.getDatabaseId()).getContainer(configuration.getCollectionId()).readItem(doc.getId(),
new PartitionKey(partitionKeyValue),
PojoizedJson.class).map(CosmosAsyncItemResponse::getItem);
PojoizedJson.class).map(CosmosItemResponse::getItem);
concurrencyControlSemaphore.acquire();
AsyncReadBenchmark.LatencySubscriber<PojoizedJson> latencySubscriber = new AsyncReadBenchmark.LatencySubscriber<>(baseSubscriber);
latencySubscriber.context = latency.time();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package com.azure.cosmos.benchmark;

import com.azure.cosmos.models.CosmosAsyncItemResponse;
import com.azure.cosmos.models.CosmosItemResponse;
import com.azure.cosmos.models.PartitionKey;
import com.codahale.metrics.Timer;
import org.reactivestreams.Subscription;
Expand Down Expand Up @@ -56,7 +56,7 @@ protected void performWorkload(BaseSubscriber<PojoizedJson> baseSubscriber, long
String partitionKeyValue = doc.getId();
Mono<PojoizedJson> result = cosmosAsyncContainer.readItem(doc.getId(),
new PartitionKey(partitionKeyValue),
PojoizedJson.class).map(CosmosAsyncItemResponse::getItem);
PojoizedJson.class).map(CosmosItemResponse::getItem);

concurrencyControlSemaphore.acquire();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package com.azure.cosmos.benchmark;

import com.azure.cosmos.models.CosmosAsyncItemResponse;
import com.azure.cosmos.models.CosmosItemResponse;
import com.azure.cosmos.models.CosmosItemRequestOptions;
import com.azure.cosmos.models.PartitionKey;
import com.codahale.metrics.Timer;
Expand All @@ -15,17 +15,17 @@

import java.util.UUID;

class AsyncWriteBenchmark extends AsyncBenchmark<CosmosAsyncItemResponse> {
class AsyncWriteBenchmark extends AsyncBenchmark<CosmosItemResponse> {

private final String uuid;
private final String dataFieldValue;

class LatencySubscriber<T> extends BaseSubscriber<T> {

Timer.Context context;
BaseSubscriber<CosmosAsyncItemResponse> baseSubscriber;
BaseSubscriber<CosmosItemResponse> baseSubscriber;

LatencySubscriber(BaseSubscriber<CosmosAsyncItemResponse> baseSubscriber) {
LatencySubscriber(BaseSubscriber<CosmosItemResponse> baseSubscriber) {
this.baseSubscriber = baseSubscriber;
}

Expand Down Expand Up @@ -59,9 +59,9 @@ protected void hookOnError(Throwable throwable) {
}

@Override
protected void performWorkload(BaseSubscriber<CosmosAsyncItemResponse> baseSubscriber, long i) throws InterruptedException {
protected void performWorkload(BaseSubscriber<CosmosItemResponse> baseSubscriber, long i) throws InterruptedException {
String partitionKey = uuid + i;
Mono<CosmosAsyncItemResponse<PojoizedJson>> obs;
Mono<CosmosItemResponse<PojoizedJson>> obs;
if (configuration.isDisablePassingPartitionKeyAsOptionOnWrite()) {
// require parsing partition key from the doc
obs = cosmosAsyncContainer.createItem(generateDocument(partitionKey, dataFieldValue));
Expand All @@ -77,7 +77,7 @@ protected void performWorkload(BaseSubscriber<CosmosAsyncItemResponse> baseSubsc
if (configuration.getOperationType() == Configuration.Operation.WriteThroughput) {
obs.subscribeOn(Schedulers.parallel()).subscribe(baseSubscriber);
} else {
LatencySubscriber<CosmosAsyncItemResponse> latencySubscriber = new LatencySubscriber<>(baseSubscriber);
LatencySubscriber<CosmosItemResponse> latencySubscriber = new LatencySubscriber<>(baseSubscriber);
latencySubscriber.context = latency.time();
obs.subscribeOn(Schedulers.parallel()).subscribe(latencySubscriber);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.azure.cosmos.CosmosAsyncClient;
import com.azure.cosmos.CosmosAsyncContainer;
import com.azure.cosmos.CosmosAsyncDatabase;
import com.azure.cosmos.models.CosmosAsyncItemResponse;
import com.azure.cosmos.models.CosmosItemResponse;
import com.azure.cosmos.CosmosClientBuilder;
import com.azure.cosmos.CosmosException;
import com.azure.cosmos.models.CosmosContainerProperties;
Expand Down Expand Up @@ -48,9 +48,9 @@ private void start() {

//CREATE an Item async

Mono<CosmosAsyncItemResponse<TestObject>> itemResponseMono = container.createItem(testObject);
Mono<CosmosItemResponse<TestObject>> itemResponseMono = container.createItem(testObject);
//CREATE another Item async
Mono<CosmosAsyncItemResponse<TestObject>> itemResponseMono1 = container.createItem(testObject2);
Mono<CosmosItemResponse<TestObject>> itemResponseMono1 = container.createItem(testObject2);

//Wait for completion
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.azure.cosmos.implementation.directconnectivity.Uri;
import com.azure.cosmos.implementation.query.metrics.ClientSideMetrics;
import com.azure.cosmos.implementation.routing.PartitionKeyInternal;
import com.azure.cosmos.models.CosmosAsyncItemResponse;
import com.azure.cosmos.models.CosmosItemResponse;
import com.azure.cosmos.models.CosmosStoredProcedureProperties;
import com.azure.cosmos.models.FeedResponse;
Expand Down Expand Up @@ -432,11 +431,6 @@ public static PartitionKeyInternal getPartitionKeyInternal(PartitionKey partitio
return ModelBridgeInternal.getPartitionKeyInternal(partitionKey);
}

@Warning(value = INTERNAL_USE_ONLY_WARNING)
public static <T> CosmosItemProperties getProperties(CosmosAsyncItemResponse<T> cosmosItemResponse) {
return ModelBridgeInternal.getCosmosItemProperties(cosmosItemResponse);
}

@Warning(value = INTERNAL_USE_ONLY_WARNING)
public static <T> CosmosItemProperties getProperties(CosmosItemResponse<T> cosmosItemResponse) {
return ModelBridgeInternal.getCosmosItemProperties(cosmosItemResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.azure.cosmos.implementation.Utils;
import com.azure.cosmos.implementation.query.QueryInfo;
import com.azure.cosmos.models.CosmosContainerResponse;
import com.azure.cosmos.models.CosmosAsyncItemResponse;
import com.azure.cosmos.models.CosmosItemResponse;
import com.azure.cosmos.models.CosmosConflictProperties;
import com.azure.cosmos.models.CosmosContainerProperties;
import com.azure.cosmos.models.CosmosContainerRequestOptions;
Expand Down Expand Up @@ -180,7 +180,7 @@ public Mono<CosmosContainerResponse> replace(
* @return an {@link Mono} containing the single resource response with the
* created Cosmos item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> createItem(T item) {
public <T> Mono<CosmosItemResponse<T>> createItem(T item) {
return createItem(item, new CosmosItemRequestOptions());
}

Expand All @@ -197,7 +197,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> createItem(T item) {
* @param options the request options.
* @return an {@link Mono} containing the single resource response with the created Cosmos item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> createItem(
public <T> Mono<CosmosItemResponse<T>> createItem(
T item,
PartitionKey partitionKey,
CosmosItemRequestOptions options) {
Expand All @@ -217,7 +217,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> createItem(
* @param options the item request options.
* @return an {@link Mono} containing the single resource response with the created Cosmos item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> createItem(T item, CosmosItemRequestOptions options) {
public <T> Mono<CosmosItemResponse<T>> createItem(T item, CosmosItemRequestOptions options) {
if (options == null) {
options = new CosmosItemRequestOptions();
}
Expand All @@ -244,7 +244,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> createItem(T item, CosmosItemRequest
* @param item the item represented as a POJO or Item object to upsert.
* @return an {@link Mono} containing the single resource response with the upserted item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> upsertItem(T item) {
public <T> Mono<CosmosItemResponse<T>> upsertItem(T item) {
return upsertItem(item, new CosmosItemRequestOptions());
}

Expand All @@ -260,7 +260,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> upsertItem(T item) {
* @param options the request options.
* @return an {@link Mono} containing the single resource response with the upserted item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> upsertItem(T item, CosmosItemRequestOptions options) {
public <T> Mono<CosmosItemResponse<T>> upsertItem(T item, CosmosItemRequestOptions options) {
if (options == null) {
options = new CosmosItemRequestOptions();
}
Expand Down Expand Up @@ -429,7 +429,7 @@ private <T> T transform(Object object, Class<T> classType) {
* @param itemType the item type.
* @return an {@link Mono} containing the Cosmos item response with the read item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> readItem(String itemId, PartitionKey partitionKey, Class<T> itemType) {
public <T> Mono<CosmosItemResponse<T>> readItem(String itemId, PartitionKey partitionKey, Class<T> itemType) {
return readItem(itemId, partitionKey, ModelBridgeInternal.createCosmosItemRequestOptions(partitionKey), itemType);
}

Expand All @@ -446,7 +446,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> readItem(String itemId, PartitionKey
* @param itemType the item type.
* @return an {@link Mono} containing the Cosmos item response with the read item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> readItem(
public <T> Mono<CosmosItemResponse<T>> readItem(
String itemId, PartitionKey partitionKey,
CosmosItemRequestOptions options, Class<T> itemType) {
if (options == null) {
Expand All @@ -472,7 +472,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> readItem(
* @param partitionKey the partition key.
* @return an {@link Mono} containing the Cosmos item resource response with the replaced item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> replaceItem(T item, String itemId, PartitionKey partitionKey) {
public <T> Mono<CosmosItemResponse<T>> replaceItem(T item, String itemId, PartitionKey partitionKey) {
return replaceItem(item, itemId, partitionKey, new CosmosItemRequestOptions());
}

Expand All @@ -489,7 +489,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> replaceItem(T item, String itemId, P
* @param options the request comosItemRequestOptions.
* @return an {@link Mono} containing the Cosmos item resource response with the replaced item or an error.
*/
public <T> Mono<CosmosAsyncItemResponse<T>> replaceItem(
public <T> Mono<CosmosItemResponse<T>> replaceItem(
T item, String itemId, PartitionKey partitionKey,
CosmosItemRequestOptions options) {
Document doc = CosmosItemProperties.fromObject(item);
Expand All @@ -516,7 +516,7 @@ public <T> Mono<CosmosAsyncItemResponse<T>> replaceItem(
* @param partitionKey the partition key.
* @return an {@link Mono} containing the Cosmos item resource response.
*/
public Mono<CosmosAsyncItemResponse<Object>> deleteItem(String itemId, PartitionKey partitionKey) {
public Mono<CosmosItemResponse<Object>> deleteItem(String itemId, PartitionKey partitionKey) {
return deleteItem(itemId, partitionKey, new CosmosItemRequestOptions());
}

Expand All @@ -531,7 +531,7 @@ public Mono<CosmosAsyncItemResponse<Object>> deleteItem(String itemId, Partition
* @param options the request options.
* @return an {@link Mono} containing the Cosmos item resource response.
*/
public Mono<CosmosAsyncItemResponse<Object>> deleteItem(
public Mono<CosmosItemResponse<Object>> deleteItem(
String itemId, PartitionKey partitionKey,
CosmosItemRequestOptions options) {
if (options == null) {
Expand Down
Loading