Modifier and Type | Class and Description |
---|---|
static class |
MongoSourceBuilder.Batch<T>
|
static class |
MongoSourceBuilder.Stream<T>
|
Modifier and Type | Method and Description |
---|---|
static MongoSourceBuilder.Batch<org.bson.Document> |
batch(String name,
DataLinkRef dataLinkRef)
Returns a builder object that offers a step-by-step fluent API to build
a custom MongoDB
BatchSource for the Pipeline API. |
static MongoSourceBuilder.Batch<org.bson.Document> |
batch(String name,
SupplierEx<? extends com.mongodb.client.MongoClient> clientSupplier)
Returns a builder object that offers a step-by-step fluent API to build
a custom MongoDB
BatchSource for the Pipeline API. |
static MongoSourceBuilder.Stream<org.bson.Document> |
stream(String name,
DataLinkRef dataLinkRef)
Returns a builder object that offers a step-by-step fluent API to build
a custom MongoDB
StreamSource for the Pipeline API. |
static MongoSourceBuilder.Stream<org.bson.Document> |
stream(String name,
SupplierEx<? extends com.mongodb.client.MongoClient> clientSupplier)
Returns a builder object that offers a step-by-step fluent API to build
a custom MongoDB
StreamSource for the Pipeline API. |
@Nonnull public static MongoSourceBuilder.Batch<org.bson.Document> batch(@Nonnull String name, @Nonnull SupplierEx<? extends com.mongodb.client.MongoClient> clientSupplier)
BatchSource
for the Pipeline API.
Here's an example that builds a simple source which queries all the documents in a collection and emits the items as a string by transforming each item to json.
name
- a descriptive name for the source (diagnostic purposes)clientSupplier
- a function that creates MongoDB client@Nonnull public static MongoSourceBuilder.Batch<org.bson.Document> batch(@Nonnull String name, @Nonnull DataLinkRef dataLinkRef)
BatchSource
for the Pipeline API.
Here's an example that builds a simple source which queries all the documents in a collection and emits the items as a string by transforming each item to json.
name
- a descriptive name for the source (diagnostic purposes)dataLinkRef
- a link to some mongo data link@Nonnull public static MongoSourceBuilder.Stream<org.bson.Document> stream(@Nonnull String name, @Nonnull SupplierEx<? extends com.mongodb.client.MongoClient> clientSupplier)
StreamSource
for the Pipeline API.
The created source will not be distributed, a single processor instance
will be created on an arbitrary member. The source provides native
timestamps using ChangeStreamDocument.getClusterTime()
and fault
tolerance using ChangeStreamDocument.getResumeToken()
.
name
- a descriptive name for the source (diagnostic purposes)clientSupplier
- a function that creates MongoDB client@Nonnull public static MongoSourceBuilder.Stream<org.bson.Document> stream(@Nonnull String name, @Nonnull DataLinkRef dataLinkRef)
StreamSource
for the Pipeline API.
The source provides native timestamps using ChangeStreamDocument.getWallTime()
and fault
tolerance using ChangeStreamDocument.getResumeToken()
.
name
- a descriptive name for the source (diagnostic purposes)dataLinkRef
- a link to some mongo data linkCopyright © 2023 Hazelcast, Inc.. All rights reserved.