final class ChangeStreamIterableImpl<TResult> extends MongoIterableImpl<ChangeStreamDocument<TResult>> implements ChangeStreamIterable<TResult>
Modifier and Type | Field and Description |
---|---|
private Codec<ChangeStreamDocument<TResult>> |
codec |
private CodecRegistry |
codecRegistry |
private Collation |
collation |
private FullDocument |
fullDocument |
private long |
maxAwaitTimeMS |
private MongoNamespace |
namespace |
private java.util.List<? extends Bson> |
pipeline |
private BsonDocument |
resumeToken |
Constructor and Description |
---|
ChangeStreamIterableImpl(ClientSession clientSession,
MongoNamespace namespace,
CodecRegistry codecRegistry,
ReadPreference readPreference,
ReadConcern readConcern,
OperationExecutor executor,
java.util.List<? extends Bson> pipeline,
java.lang.Class<TResult> resultClass) |
Modifier and Type | Method and Description |
---|---|
(package private) ReadOperation<BatchCursor<ChangeStreamDocument<TResult>>> |
asReadOperation() |
ChangeStreamIterable<TResult> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
ChangeStreamIterable<TResult> |
collation(Collation collation)
Sets the collation options
|
private java.util.List<BsonDocument> |
createBsonDocumentList(java.util.List<? extends Bson> pipeline) |
private <S> ReadOperation<BatchCursor<S>> |
createChangeStreamOperation(Codec<S> codec) |
ChangeStreamIterable<TResult> |
fullDocument(FullDocument fullDocument)
Sets the fullDocument value.
|
ChangeStreamIterable<TResult> |
maxAwaitTime(long maxAwaitTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum await execution time on the server for this operation.
|
ChangeStreamIterable<TResult> |
resumeAfter(BsonDocument resumeAfter)
Sets the logical starting point for the new change stream.
|
<TDocument> |
withDocumentClass(java.lang.Class<TDocument> clazz)
Returns a
MongoIterable containing the results of the change stream based on the document class provided. |
first, forEach, getBatchSize, getClientSession, getExecutor, getReadConcern, getReadPreference, into, iterator, map, toBsonDocumentOrNull, toBsonDocumentOrNull
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private final MongoNamespace namespace
private final CodecRegistry codecRegistry
private final java.util.List<? extends Bson> pipeline
private final Codec<ChangeStreamDocument<TResult>> codec
private FullDocument fullDocument
private BsonDocument resumeToken
private long maxAwaitTimeMS
private Collation collation
ChangeStreamIterableImpl(ClientSession clientSession, MongoNamespace namespace, CodecRegistry codecRegistry, ReadPreference readPreference, ReadConcern readConcern, OperationExecutor executor, java.util.List<? extends Bson> pipeline, java.lang.Class<TResult> resultClass)
public ChangeStreamIterable<TResult> fullDocument(FullDocument fullDocument)
ChangeStreamIterable
fullDocument
in interface ChangeStreamIterable<TResult>
fullDocument
- the fullDocumentpublic ChangeStreamIterable<TResult> resumeAfter(BsonDocument resumeAfter)
ChangeStreamIterable
resumeAfter
in interface ChangeStreamIterable<TResult>
resumeAfter
- the resume tokenpublic ChangeStreamIterable<TResult> batchSize(int batchSize)
MongoIterable
batchSize
in interface ChangeStreamIterable<TResult>
batchSize
in interface MongoIterable<ChangeStreamDocument<TResult>>
batchSize
in class MongoIterableImpl<ChangeStreamDocument<TResult>>
batchSize
- the batch sizepublic ChangeStreamIterable<TResult> maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
ChangeStreamIterable
maxAwaitTime
in interface ChangeStreamIterable<TResult>
maxAwaitTime
- the max await time. A zero value will be ignored, and indicates that the driver should respect the server's
default valuetimeUnit
- the time unit, which may not be nullpublic ChangeStreamIterable<TResult> collation(Collation collation)
ChangeStreamIterable
A null value represents the server default.
collation
in interface ChangeStreamIterable<TResult>
collation
- the collation options to usepublic <TDocument> MongoIterable<TDocument> withDocumentClass(java.lang.Class<TDocument> clazz)
ChangeStreamIterable
MongoIterable
containing the results of the change stream based on the document class provided.withDocumentClass
in interface ChangeStreamIterable<TResult>
TDocument
- the result typeclazz
- the class to use for the raw result.ReadOperation<BatchCursor<ChangeStreamDocument<TResult>>> asReadOperation()
asReadOperation
in class MongoIterableImpl<ChangeStreamDocument<TResult>>
private <S> ReadOperation<BatchCursor<S>> createChangeStreamOperation(Codec<S> codec)
private java.util.List<BsonDocument> createBsonDocumentList(java.util.List<? extends Bson> pipeline)