diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java index 723e9de73ced..8b7cdd720988 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java @@ -244,17 +244,17 @@ public CosmosContainerProperties setDefaultTimeToLiveInSeconds(Integer timeToLiv } /** - * Sets the analytical storage time to live in seconds for items in a container from the Azure Cosmos DB service. + * Sets the analytical store time to live in seconds for items in a container from the Azure Cosmos DB service. * * It is an optional property. A valid value must be either a nonzero positive integer, '-1', or 0. - * By default, AnalyticalStorageTimeToLive is set to 0 meaning the analytical store is turned off for the container; + * By default, AnalyticalStoreTimeToLive is set to 0 meaning the analytical store is turned off for the container; * -1 means documents in analytical store never expire. * The unit of measurement is seconds. The maximum allowed value is 2147483647. * - * @param timeToLive the analytical storage time to live in seconds. + * @param timeToLive the analytical store time to live in seconds. * @return the CosmosContainerProperties. */ - public CosmosContainerProperties setAnalyticalStorageTimeToLiveInSeconds(Integer timeToLive) { + public CosmosContainerProperties setAnalyticalStoreTimeToLiveInSeconds(Integer timeToLive) { // a "null" value is represented as a missing element on the wire. // setting timeToLive to null should remove the property from the property bag. if (timeToLive != null) { @@ -267,16 +267,16 @@ public CosmosContainerProperties setAnalyticalStorageTimeToLiveInSeconds(Integer } /** - * Gets the analytical storage time to live in seconds for items in a container from the Azure Cosmos DB service. + * Gets the analytical store time to live in seconds for items in a container from the Azure Cosmos DB service. * * It is an optional property. A valid value must be either a nonzero positive integer, '-1', or 0. - * By default, AnalyticalStorageTimeToLive is set to 0 meaning the analytical store is turned off for the container; + * By default, AnalyticalStoreTimeToLive is set to 0 meaning the analytical store is turned off for the container; * -1 means documents in analytical store never expire. * The unit of measurement is seconds. The maximum allowed value is 2147483647. * * @return analytical ttl */ - public Integer getAnalyticalStorageTimeToLiveInSeconds() { + public Integer getAnalyticalStoreTimeToLiveInSeconds() { if (super.has(Constants.Properties.ANALYTICAL_STORAGE_TTL)) { return super.getInt(Constants.Properties.ANALYTICAL_STORAGE_TTL); } diff --git a/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/AnalyticalStorageCodeSnippet.java b/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/AnalyticalStorageCodeSnippet.java index 5317d24b719a..6d95fca46413 100644 --- a/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/AnalyticalStorageCodeSnippet.java +++ b/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/AnalyticalStorageCodeSnippet.java @@ -7,8 +7,6 @@ import com.azure.cosmos.models.CosmosAsyncDatabaseResponse; import com.azure.cosmos.models.CosmosContainerProperties; -import java.time.Instant; - public class AnalyticalStorageCodeSnippet { public static void main(String[] args) throws Exception { @@ -20,7 +18,7 @@ public static void main(String[] args) throws Exception { CosmosAsyncDatabaseResponse database = client.createDatabaseIfNotExists("testDB").block(); CosmosContainerProperties cosmosContainerProperties = new CosmosContainerProperties("testContainer", "/id"); - cosmosContainerProperties.setAnalyticalStorageTimeToLiveInSeconds(-1); + cosmosContainerProperties.setAnalyticalStoreTimeToLiveInSeconds(-1); database.getDatabase().createContainer(cosmosContainerProperties).block(); diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java index 90bddb077306..698d0538d02f 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java @@ -92,7 +92,7 @@ public void createContainer_withAnalyticalTTL(Integer analyticalTTL) throws Exce String collectionName = UUID.randomUUID().toString(); CosmosContainerProperties containerProperties = new CosmosContainerProperties(collectionName, "/id"); - containerProperties.setAnalyticalStorageTimeToLiveInSeconds(analyticalTTL); + containerProperties.setAnalyticalStoreTimeToLiveInSeconds(analyticalTTL); if (analyticalTTL != null && analyticalTTL > 0) { containerProperties.setDefaultTimeToLiveInSeconds(analyticalTTL - 1); } @@ -101,7 +101,7 @@ public void createContainer_withAnalyticalTTL(Integer analyticalTTL) throws Exce assertThat(containerResponse.getRequestCharge()).isGreaterThan(0); validateContainerResponse(containerProperties, containerResponse); - assertThat(containerResponse.getProperties().getAnalyticalStorageTimeToLiveInSeconds()).isEqualTo(analyticalTTL); + assertThat(containerResponse.getProperties().getAnalyticalStoreTimeToLiveInSeconds()).isEqualTo(analyticalTTL); } @Test(groups = {"emulator"}, timeOut = TIMEOUT)