Skip to content

Commit

Permalink
JAVA-2665: Update links to causal consistency and change stream docum…
Browse files Browse the repository at this point in the history
…entation to use http://dochub.mongodb.org
  • Loading branch information
jyemin committed Nov 20, 2017
1 parent d9abec0 commit fb45ab1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title = "Change Streams"

## Change Streams - Draft

MongoDB 3.6 introduces a new [`$changeStream`](https://docs.mongodb.com/manual/operator/aggregation/changeStream) aggregation pipeline
MongoDB 3.6 introduces a new [`$changeStream`](http://dochub.mongodb.org/core/changestreams) aggregation pipeline
operator.

Change streams provide a way to watch changes to documents in a collection. To improve the usability of this new stage, the
Expand Down Expand Up @@ -86,7 +86,7 @@ collection.watch().forEach(printBlock, callbackWhenFinished);

The `watch` method can also be passed a list of [aggregation stages]({{< docsref "meta/aggregation-quick-reference" >}}), that can modify
the data returned by the `$changeStream` operator. Note: not all aggregation operators are supported. See the
[`$changeStream`](https://docs.mongodb.com/manual/operator/aggregation/changeStream) documentation for more information.
[`$changeStream`](http://dochub.mongodb.org/core/changestreams) documentation for more information.

In the following example the change stream prints out all changes it observes, for `insert`, `update`, `replace` and `delete` operations:

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/content/driver/tutorials/change-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title = "Change Streams"

## Change Streams - Draft

MongoDB 3.6 introduces a new [`$changeStream`](https://docs.mongodb.com/manual/operator/aggregation/changeStream) aggregation pipeline
MongoDB 3.6 introduces a new [`$changeStream`](http://dochub.mongodb.org/core/changestreams) aggregation pipeline
operator.

Change streams provide a way to watch changes to documents in a collection. To improve the usability of this new stage, the
Expand Down Expand Up @@ -74,7 +74,7 @@ collection.watch().forEach(printBlock);

The `watch` method can also be passed a list of [aggregation stages]({{< docsref "meta/aggregation-quick-reference" >}}), that can modify
the data returned by the `$changeStream` operator. Note: not all aggregation operators are supported. See the
[`$changeStream`](https://docs.mongodb.com/manual/operator/aggregation/changeStream) documentation for more information.
[`$changeStream`](http://dochub.mongodb.org/core/changestreams) documentation for more information.

In the following example the change stream prints out all changes it observes, for `insert`, `update`, `replace` and `delete` operations:

Expand Down
7 changes: 4 additions & 3 deletions docs/reference/content/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Key new features of the 3.6 Java driver release:

### Change Stream support

The 3.6 release adds support for [change streams](https://docs.mongodb.com/manual/operator/aggregation/changeStream).
The 3.6 release adds support for [change streams](http://dochub.mongodb.org/core/changestreams).

* [Change Stream Quick Start]({{<ref "driver/tutorials/change-streams.md">}})
* [Change Stream Quick Start (Async)]({{<ref "driver-async/tutorials/change-streams.md">}})
Expand All @@ -31,8 +31,9 @@ The 3.6 release adds support for compression of messages to and from appropriate
* [Compression Tutorial (Async)]({{<ref "driver-async/tutorials/compression.md">}})

### Causal consistency

The 3.6 release adds support for causally consistency.
The 3.6 release adds support for [causally consistency](http://dochub.mongodb.org/core/causal-consistency) via the new
[`ClientSession`]({{<apiref "com/mongodb/session/ClientSession">}}) API.

### Application-configured server selection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public interface MongoCollection<TDocument> {
* Creates a change stream for this collection.
*
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
ChangeStreamIterable<TDocument> watch();
Expand All @@ -273,7 +273,7 @@ public interface MongoCollection<TDocument> {
* @param resultClass the class to decode each document into
* @param <TResult> the target document type of the iterable.
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
<TResult> ChangeStreamIterable<TResult> watch(Class<TResult> resultClass);
Expand All @@ -283,7 +283,7 @@ public interface MongoCollection<TDocument> {
*
* @param pipeline the aggregation pipeline to apply to the change stream
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
ChangeStreamIterable<TDocument> watch(List<? extends Bson> pipeline);
Expand All @@ -295,7 +295,7 @@ public interface MongoCollection<TDocument> {
* @param resultClass the class to decode each document into
* @param <TResult> the target document type of the iterable.
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
<TResult> ChangeStreamIterable<TResult> watch(List<? extends Bson> pipeline, Class<TResult> resultClass);
Expand Down
3 changes: 3 additions & 0 deletions driver-core/src/main/com/mongodb/ClientSessionOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @mongodb.server.release 3.6
* @since 3.6
* @see ClientSession
* @mongodb.driver.dochub core/causal-consistency Causal Consistency
*/
@Immutable
public final class ClientSessionOptions {
Expand All @@ -37,6 +38,7 @@ public final class ClientSessionOptions {
*
* @return whether operations using the session should be causally consistent. A null value indicates to use the the global default,
* which is currently true.
* @mongodb.driver.dochub core/causal-consistency Causal Consistency
*/
public Boolean isCausallyConsistent() {
return causallyConsistent;
Expand All @@ -63,6 +65,7 @@ public static final class Builder {
*
* @param causallyConsistent whether operations using the session should be causally consistent
* @return this
* @mongodb.driver.dochub core/causal-consistency Causal Consistency
*/
public Builder causallyConsistent(final boolean causallyConsistent) {
this.causallyConsistent = causallyConsistent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* An exception indicating that a failure occurred when running a {@code $changeStream}.
*
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
public class MongoChangeStreamException extends MongoException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*
* @mongodb.server.release 3.6
* @since 3.6
* @see ClientSessionOptions
*/
@NotThreadSafe
public interface ClientSession extends Closeable {
Expand Down
18 changes: 9 additions & 9 deletions driver/src/main/com/mongodb/client/MongoCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.mongodb.client;

import com.mongodb.session.ClientSession;
import com.mongodb.MongoNamespace;
import com.mongodb.ReadConcern;
import com.mongodb.ReadPreference;
Expand All @@ -38,6 +37,7 @@
import com.mongodb.client.model.WriteModel;
import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.UpdateResult;
import com.mongodb.session.ClientSession;
import org.bson.Document;
import org.bson.codecs.configuration.CodecRegistry;
import org.bson.conversions.Bson;
Expand Down Expand Up @@ -398,7 +398,7 @@ public interface MongoCollection<TDocument> {
* Creates a change stream for this collection.
*
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
ChangeStreamIterable<TDocument> watch();
Expand All @@ -409,7 +409,7 @@ public interface MongoCollection<TDocument> {
* @param resultClass the class to decode each document into
* @param <TResult> the target document type of the iterable.
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
<TResult> ChangeStreamIterable<TResult> watch(Class<TResult> resultClass);
Expand All @@ -419,7 +419,7 @@ public interface MongoCollection<TDocument> {
*
* @param pipeline the aggregation pipeline to apply to the change stream.
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
ChangeStreamIterable<TDocument> watch(List<? extends Bson> pipeline);
Expand All @@ -431,7 +431,7 @@ public interface MongoCollection<TDocument> {
* @param resultClass the class to decode each document into
* @param <TResult> the target document type of the iterable.
* @return the change stream iterable
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
* @since 3.6
*/
<TResult> ChangeStreamIterable<TResult> watch(List<? extends Bson> pipeline, Class<TResult> resultClass);
Expand All @@ -443,7 +443,7 @@ public interface MongoCollection<TDocument> {
* @return the change stream iterable
* @since 3.6
* @mongodb.server.release 3.6
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
*/
ChangeStreamIterable<TDocument> watch(ClientSession clientSession);

Expand All @@ -456,7 +456,7 @@ public interface MongoCollection<TDocument> {
* @return the change stream iterable
* @since 3.6
* @mongodb.server.release 3.6
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
*/
<TResult> ChangeStreamIterable<TResult> watch(ClientSession clientSession, Class<TResult> resultClass);

Expand All @@ -468,7 +468,7 @@ public interface MongoCollection<TDocument> {
* @return the change stream iterable
* @since 3.6
* @mongodb.server.release 3.6
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
*/
ChangeStreamIterable<TDocument> watch(ClientSession clientSession, List<? extends Bson> pipeline);

Expand All @@ -482,7 +482,7 @@ public interface MongoCollection<TDocument> {
* @return the change stream iterable
* @since 3.6
* @mongodb.server.release 3.6
* @mongodb.driver.manual reference/operator/aggregation/changeStream $changeStream
* @mongodb.driver.dochub core/changestreams Change Streams
*/
<TResult> ChangeStreamIterable<TResult> watch(ClientSession clientSession, List<? extends Bson> pipeline, Class<TResult> resultClass);

Expand Down

0 comments on commit fb45ab1

Please sign in to comment.