Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

Refactoring cosmos client, options and adding user #139

Closed mbhaskar closed 5 years ago

mbhaskar commented 5 years ago

Refactored CosmosClient to use builder pattern and removed CosmosConfiguration CosmosDatabase, Container and Item Requestoptions use composition now Adding CosmosUser API to database


This change is Reviewable

mbhaskar commented 5 years ago

Reviewed 19 of 19 files at r1. Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @christopheranderson, @kushagraThapar, and @mbhaskar)

sdk/src/main/java/com/microsoft/azure/cosmos/CosmosClient.java, line 71 at r1 (raw file):

········

nit: spaces

sdk/src/main/java/com/microsoft/azure/cosmos/CosmosClient.java, line 194 at r1 (raw file):

Quoted 11 lines of code… why some of the getters here are pubic and some other getters are not public?

_sdk/src/main/java/com/microsoft/azure/cosmos/CosmosContainer.java, line 538 at r1 (raw file):_

public CosmosTrigger getTrigger(String id){

I thought we will be exposing stored proc only as public API in v3 and not triggers. no?

sdk/src/test/java/com/microsoft/azure/cosmos/CosmosTestSuiteBase.java, line 108 at r1 (raw file):

········

nit: empty spaces

sdk/src/test/java/com/microsoft/azure/cosmosdb/rx/internal/TestSuiteBase.java, line 241 at r1 (raw file):

requestOptions.partitionKey(new PartitionKey(propertyValue));

In this PR you changed APIs of v3 sdk, v2 API remained unchanged. no need to change anything in v2 files. undo changes in this file.

Done

moderakh commented 5 years ago

There are javadoc warnings:

[WARNING] Javadoc Warnings
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosClient.java:281: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosClientBuilder.java:96: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosClientBuilder.java:105: warning: no description for @param
[WARNING] * @param connectionPolicy
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosClientBuilder.java:106: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainer.java:71: warning: no @param for options
[WARNING] public Mono<CosmosContainerResponse> read(CosmosContainerRequestOptions options) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainer.java:299: warning: no @param for partitionKey
[WARNING] public CosmosItem getItem(String id, Object partitionKey){
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainer.java:500: warning: no @param for settings
[WARNING] public Mono<CosmosTriggerResponse> createTrigger(CosmosTriggerSettings settings,
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainerRequestOptions.java:51: warning: no @return
[WARNING] public CosmosContainerRequestOptions offerThroughput(Integer offerThroughput) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainerRequestOptions.java:74: warning: no @return
[WARNING] public CosmosContainerRequestOptions populateQuotaInfo(boolean populateQuotaInfo) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainerRequestOptions.java:93: warning: no @return
[WARNING] public CosmosContainerRequestOptions consistencyLevel(ConsistencyLevel consistencyLevel) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainerRequestOptions.java:112: warning: no @return
[WARNING] public CosmosContainerRequestOptions sessionToken(String sessionToken) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosRequestOptions.java:49: warning: no @return
[WARNING] public CosmosRequestOptions accessCondition(AccessCondition accessCondition) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosContainerSettings.java:107: warning: no description for @param
[WARNING] * @param indexingPolicy
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosDatabase.java:103: warning: no @param for options
[WARNING] public Mono<CosmosDatabaseResponse> delete(CosmosRequestOptions options) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosDatabase.java:175: warning: no @param for containerSettings
[WARNING] public Mono<CosmosContainerResponse> createContainerIfNotExists(CosmosContainerSettings containerSettings) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosDatabaseRequestOptions.java:47: warning: no @return
[WARNING] public CosmosDatabaseRequestOptions offerThroughput(Integer offerThroughput) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosDatabaseResponse.java:43: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosItemRequestOptions.java:77: warning: no @return
[WARNING] public CosmosItemRequestOptions consistencyLevel(ConsistencyLevel consistencyLevel) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosItemRequestOptions.java:96: warning: no @return
[WARNING] public CosmosItemRequestOptions indexingDirective(IndexingDirective indexingDirective) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosItemRequestOptions.java:115: warning: no @return
[WARNING] public CosmosItemRequestOptions preTriggerInclude(List<String> preTriggerInclude) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosItemRequestOptions.java:134: warning: no @return
[WARNING] public CosmosItemRequestOptions postTriggerInclude(List<String> postTriggerInclude) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosItemRequestOptions.java:153: warning: no @return
[WARNING] public CosmosItemRequestOptions sessionToken(String sessionToken) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosItemRequestOptions.java:162: warning: no @return
[WARNING] public CosmosItemRequestOptions partitionKey(PartitionKey partitionKey) {
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosTriggerResponse.java:43: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosTriggerResponse.java:51: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUser.java:18: warning: no description for @param
[WARNING] * @param options
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUser.java:19: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUser.java:29: warning: no description for @param
[WARNING] * @param userSettings
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUser.java:30: warning: no description for @param
[WARNING] * @param options
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUser.java:31: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUser.java:41: warning: no description for @param
[WARNING] * @param options
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUser.java:42: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUserResponse.java:21: warning: no description for @return
[WARNING] * @return
[WARNING] ^
[WARNING] D:\a\1\s\sdk\src\main\java\com\microsoft\azure\cosmos\CosmosUserResponse.java:29: warning: no description for @return
[WARNING] * @return
[WARNING] ^