Skip to content

Commit

Permalink
Merge pull request Azure#50 from srinathnarayanan/master
Browse files Browse the repository at this point in the history
2.0.0 release
  • Loading branch information
Srinath Narayanan authored Jun 12, 2018
2 parents b7e8864 + a99d713 commit 9c8d5c4
Show file tree
Hide file tree
Showing 61 changed files with 437 additions and 760 deletions.
2 changes: 1 addition & 1 deletion benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmosdb-parent</artifactId>
<version>1.0.2</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>azure-cosmosdb-benchmark</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmosdb-parent</artifactId>
<version>1.0.2</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>azure-cosmosdb-examples</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ public void testUpdateOffer() throws Exception {

// This offer must correspond to the collection we created
Offer offer = offerList.get(0);
int curentThroughput = offer.getContent().getInt("offerThroughput");
int curentThroughput = offer.getThroughput();
assertThat(offer.getString("offerResourceId"), equalTo(createdCollection.getResourceId()));
assertThat(curentThroughput, equalTo(initialThroughput));
System.out.println("initial throughput: " + curentThroughput);

// Update the offer's throughput
offer.getContent().put("offerThroughput", newThroughput);
offer.setThroughput(newThroughput);

// Replace the offer
return asyncClient.replaceOffer(offer);
}).subscribe(offerResourceResponse -> {
Offer offer = offerResourceResponse.getResource();
int curentThroughput = offer.getContent().getInt("offerThroughput");
int curentThroughput = offer.getThroughput();

// The current throughput of the offer must be equal to the new throughput value
assertThat(offer.getString("offerResourceId"), equalTo(createdCollection.getResourceId()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void uniqueIndex() {
DocumentCollection collection = client.createCollection(getDatabaseLink(), collectionDefinition, null).toBlocking().single().getResource();

Document doc1 = new Document("{ 'name':'Alan Turning', 'field': 'Mathematics', 'other' : 'Logic' }");
Document doc2 = new Document("{ 'name':'Al-Khwarizmi', 'field': 'Mathematics' , other' : 'Algebra '}");
Document doc2 = new Document("{ 'name':'Al-Khwarizmi', 'field': 'Mathematics' , 'other' : 'Algebra '}");
Document doc3 = new Document("{ 'name':'Alan Turning', 'field': 'Mathematics', 'other' : 'CS' }");

client.createDocument(getCollectionLink(collection), doc1, null, false).toBlocking().single().getResource();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmosdb-parent</artifactId>
<version>1.0.2</version>
<version>2.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Azure Cosmos DB SQL API</name>
<description>Java Async SDK (with Reactive Extension RX support) for Azure Cosmos DB SQL API</description>
Expand Down
7 changes: 1 addition & 6 deletions sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SOFTWARE.
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmosdb-parent</artifactId>
<version>1.0.2</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>azure-cosmosdb</artifactId>
<name>Async SDK for SQL API of Azure Cosmos DB Service</name>
Expand Down Expand Up @@ -174,11 +174,6 @@ SOFTWARE.
<artifactId>java-uuid-generator</artifactId>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
12 changes: 0 additions & 12 deletions sdk/src/main/java/com/microsoft/azure/cosmosdb/Attachment.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

package com.microsoft.azure.cosmosdb;

import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

/**
Expand All @@ -34,7 +32,6 @@
* These are stored externally in Azure Blob storage. Attachments are automatically deleted when the parent document
* is deleted.
*/
@SuppressWarnings("serial")
public class Attachment extends Resource {
/**
* Initialize an attachment object.
Expand All @@ -52,15 +49,6 @@ public Attachment(String source) {
super(source);
}

/**
* Initialize an attachment object from json object.
*
* @param jsonObject the json object representation of the Attachment.
*/
public Attachment(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Gets the MIME content type of the attachment.
*
Expand Down
12 changes: 0 additions & 12 deletions sdk/src/main/java/com/microsoft/azure/cosmosdb/Conflict.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

package com.microsoft.azure.cosmosdb;

import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

/**
Expand All @@ -33,7 +31,6 @@
* During rare failure scenarios, conflicts are generated for the documents in transit. Clients can inspect the
* respective conflict instances for resources and operations in conflict.
*/
@SuppressWarnings("serial")
public final class Conflict extends Resource {
/**
* Initialize a conflict object.
Expand All @@ -51,15 +48,6 @@ public Conflict(String jsonString) {
super(jsonString);
}

/**
* Initialize a conflict object from json object.
*
* @param jsonObject the json object that represents the conflict.
*/
public Conflict(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Gets the operation kind.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@


import org.apache.commons.lang3.text.WordUtils;
import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

/**
* Encapsulates the settings for consistency policy in the Azure Cosmos DB database service.
*/
@SuppressWarnings("serial")
public final class ConsistencyPolicy extends JsonSerializable {
private static final ConsistencyLevel DEFAULT_DEFAULT_CONSISTENCY_LEVEL =
ConsistencyLevel.Session;
Expand All @@ -56,15 +54,6 @@ public ConsistencyPolicy(String jsonString) {
super(jsonString);
}

/**
* Constructor.
*
* @param jsonObject the json object that represents the consistency policy.
*/
public ConsistencyPolicy(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Get the name of the resource.
*
Expand Down
11 changes: 0 additions & 11 deletions sdk/src/main/java/com/microsoft/azure/cosmosdb/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
package com.microsoft.azure.cosmosdb;

import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

Expand All @@ -36,7 +35,6 @@
* more documents. Since databases are an an administrative resource and the Service Master Key will be required in
* order to access and successfully complete any action using the User APIs.
*/
@SuppressWarnings("serial")
public final class Database extends Resource {

/**
Expand All @@ -55,15 +53,6 @@ public Database(String jsonString) {
super(jsonString);
}

/**
* Initialize a database object from json string.
*
* @param jsonObject the json object.
*/
public Database(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Gets the self-link for collections in the database
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@

package com.microsoft.azure.cosmosdb;

import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

/**
* Represents a database account in the Azure Cosmos DB database service.
*/
@SuppressWarnings("serial")
public class DatabaseAccount extends Resource {
private ConsistencyPolicy consistencyPolicy;

Expand All @@ -54,15 +51,6 @@ public DatabaseAccount(String jsonString) {
super(jsonString);
}

/**
* Initialize a database account object from json object.
*
* @param jsonObject the json object that represents the database account.
*/
public DatabaseAccount(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Get the databases link of the databaseAccount.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@

package com.microsoft.azure.cosmosdb;

import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

/**
* Represents the location of a database account in the Azure Cosmos DB database service.
*/
@SuppressWarnings("serial")
public class DatabaseAccountLocation extends JsonSerializable {

/**
Expand All @@ -51,16 +48,6 @@ public DatabaseAccountLocation(String jsonString) {
super(jsonString);
}

/**
* Creates a new instance of the DatabaseAccountLocation object from a
* JSON object.
*
* @param jsonObject the JSON object that represents the DatabaseAccountLocation object.
*/
public DatabaseAccountLocation(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Gets The name of the database account location.
*
Expand Down
12 changes: 0 additions & 12 deletions sdk/src/main/java/com/microsoft/azure/cosmosdb/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

import java.io.IOException;

import org.json.JSONObject;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.microsoft.azure.cosmosdb.internal.Constants;

Expand All @@ -37,7 +35,6 @@
* any number of custom properties as well as an optional list of attachments. Document is an application resource and
* can be authorized using the master key or resource keys.
*/
@SuppressWarnings("serial")
public class Document extends Resource {

/**
Expand Down Expand Up @@ -66,15 +63,6 @@ public Document(String jsonString) {
super(jsonString);
}

/**
* Initialize a document object from json object.
*
* @param jsonObject the json object that represents the document object.
*/
public Document(JSONObject jsonObject) {
super(jsonObject);
}

static Document FromObject(Object document, ObjectMapper objectMapper) {
Document typedDocument;
if (document instanceof Document) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
package com.microsoft.azure.cosmosdb;

import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

Expand All @@ -36,7 +35,6 @@
* Being schema-free, the documents in a collection do not need to share the same structure or fields. Since collections
* are application resources, they can be authorized using either the master key or resource keys.
*/
@SuppressWarnings("serial")
public final class DocumentCollection extends Resource {
private IndexingPolicy indexingPolicy;
private UniqueKeyPolicy uniqueKeyPolicy;
Expand All @@ -57,15 +55,6 @@ public DocumentCollection(String jsonString) {
super(jsonString);
}

/**
* Initialize a document collection object from json object.
*
* @param jsonObject the json object that represents the document collection.
*/
public DocumentCollection(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Gets the indexing policy.
*
Expand Down
1 change: 0 additions & 1 deletion sdk/src/main/java/com/microsoft/azure/cosmosdb/Error.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
/**
* Encapsulates error related details in the Azure Cosmos DB database service.
*/
@SuppressWarnings("serial")
public class Error extends Resource {
/**
* Initialize a new instance of the Error object.
Expand Down
12 changes: 0 additions & 12 deletions sdk/src/main/java/com/microsoft/azure/cosmosdb/ExcludedPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@

package com.microsoft.azure.cosmosdb;

import org.json.JSONObject;

import com.microsoft.azure.cosmosdb.internal.Constants;

/**
* Represents an excluded path of the IndexingPolicy in the Azure Cosmos DB database service.
*/
@SuppressWarnings("serial")
public class ExcludedPath extends JsonSerializable {

/**
Expand All @@ -49,15 +46,6 @@ public ExcludedPath(String jsonString) {
super(jsonString);
}

/**
* Constructor.
*
* @param jsonObject the json object that represents the excluded path.
*/
public ExcludedPath(JSONObject jsonObject) {
super(jsonObject);
}

/**
* Gets path.
*
Expand Down
Loading

0 comments on commit 9c8d5c4

Please sign in to comment.