class BaseMongoSink[T <: AnyRef] extends RichSinkFunction[T]
Mongo sink
- T
Type of element that goes into the database
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- BaseMongoSink
- RichSinkFunction
- SinkFunction
- AbstractRichFunction
- RichFunction
- Function
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
-
new
BaseMongoSink(userConfig: Map[String, String])(implicit arg0: Manifest[T], arg1: ClassTag[T])
- userConfig
User configuration. Properties [server, database, collection]
Value Members
- var client: MongoClient
-
def
close(): Unit
- Definition Classes
- BaseMongoSink → AbstractRichFunction → RichFunction
- implicit lazy val formats: Formats
-
def
getCollection: MongoCollection[Document]
Get the mongo collection for the configuration.
Get the mongo collection for the configuration.
This is not verified to exist; it will be created upon first use.
- returns
Mongo Collection
-
def
getIterationRuntimeContext(): IterationRuntimeContext
- Definition Classes
- AbstractRichFunction → RichFunction
-
def
getRuntimeContext(): RuntimeContext
- Definition Classes
- AbstractRichFunction → RichFunction
-
def
invoke(value: T, context: Context[_]): Unit
Send a value to mongo
Send a value to mongo
Convert the value to JSON and then to a BSON document. Then insert it into the collection.
- value
Element
- context
Context
- Definition Classes
- BaseMongoSink → SinkFunction
-
def
open(parameters: Configuration): Unit
- Definition Classes
- BaseMongoSink → AbstractRichFunction → RichFunction
-
def
setRuntimeContext(arg0: RuntimeContext): Unit
- Definition Classes
- AbstractRichFunction → RichFunction
- val userConfig: Map[String, String]
Deprecated Value Members
-
def
invoke(arg0: T): Unit
- Definition Classes
- SinkFunction
- Annotations
- @Deprecated @deprecated @throws( classOf[java.lang.Exception] )
- Deprecated
(Since version ) see corresponding Javadoc for more information.