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

Questions relates to migration from Java sync v2 to V4 #15037

Closed
xinlian12 opened this issue Sep 10, 2020 · 4 comments
Closed

Questions relates to migration from Java sync v2 to V4 #15037

xinlian12 opened this issue Sep 10, 2020 · 4 comments
Assignees
Labels
cosmos:v4-item Indicates this feature will be shipped as part of V4 release train Cosmos question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@xinlian12
Copy link
Member

xinlian12 commented Sep 10, 2020

Use this to keep tracking the migration questions from customer relates to sync v2 to v4.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 10, 2020
@xinlian12 xinlian12 self-assigned this Sep 10, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 10, 2020
@xinlian12 xinlian12 changed the title Migrate from Java sync v2 to V4 Migration from Java sync v2 to V4 Sep 10, 2020
@xinlian12 xinlian12 changed the title Migration from Java sync v2 to V4 Questions relates to migration from Java sync v2 to V4 Sep 10, 2020
@xinlian12
Copy link
Member Author

xinlian12 commented Sep 10, 2020

Missing Class

  1. SqlParameterCollection (com.microsoft.azure.documentdb.SqlParameterCollection has been removed)

This class has been removed from v4, can directly pass a list of sqlParameters:
https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/src/main/java/com/azure/cosmos/examples/queries/sync/QueriesQuickstart.java#L403

Missing Methods

  1. getQueryIterable (missing from FeedResponse class)

Removed from v4.
https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/src/main/java/com/azure/cosmos/examples/queries/sync/QueriesQuickstart.java#L237

  1. getRUPerMinuteUsed (missing from FeedResponse class)

Moved to response headers -> "x-ms-documentdb-is-ru-per-minute-used"

  1. Changes in IncludePath and ExcludePath (require path in argument and type to be list)

IncludedPath: https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/src/main/java/com/azure/cosmos/examples/indexmanagement/async/SampleIndexManagementAsync.java#L157

ExcludedPath: https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/src/main/java/com/azure/cosmos/examples/indexmanagement/async/SampleIndexManagementAsync.java#L162

  1. getRequestLatency (missing from ResourceResponse class)

https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/src/main/java/com/azure/cosmos/examples/indexmanagement/async/SampleIndexManagementAsync.java#L282

  1. getResponseContinuation (missing from FeedResponse class)

https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/src/main/java/com/azure/cosmos/examples/queries/sync/QueriesQuickstart.java#L259

  1. getReadEndpoint (missing from CosmosClient class)

Removed in V4.

  1. getWriteEndpoint (missing from CosmosClient class)

Removed in v4

  1. getConnectionPolicy (missing from CosmosClient class)

Removed in v4

  1. getPageSize (missing from CosmosQueryRequestOptions class)

Removed in v4

@arun2803
Copy link

arun2803 commented Sep 16, 2020

You mentioned that getReadEndpoint, getWriteEndpoint, getConnectionPolicy, getPageSize has been removed v4. I don't get it, functionality that all these methods provides has this been moved under some other class/method or these functionality has been complete removed?
How will I get these informations in v4?

Also I using Sync DB connection and using "CosmosClient dbclient = new CosmosClientBuilder().endpoint(accountUrl).key(key).consistencyLevel(consistency).buildClient();"

now how can I do crud operations in this. In v2 we used "dbclient.deleteCollection()", "dbclient.readDocument", "dbclient.queryDocuments", "dbclient.createDocument", "dbclient.deleteDocument", "dbclient.replaceDocument" etc. Now how can I do these functionalities with CosmosClient ? All these methods are only available in Async mode

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-java that referenced this issue Jul 1, 2021
fix in readme file for latest sdk generation (Azure#15037)
@xinlian12 xinlian12 added cosmos:v4-item Indicates this feature will be shipped as part of V4 release train question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 13, 2022
@xinlian12
Copy link
Member Author

getReadEndpoint, getWriteEndpoint, getConnectionPolicy, getPageSize has been removed completely in V4.

In V4, we support sync and async. Please find the sync examples here:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-api-java-sdk-samples

@xinlian12
Copy link
Member Author

Close of no activity

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cosmos:v4-item Indicates this feature will be shipped as part of V4 release train Cosmos question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

2 participants