Class PutMongoRecord
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.mongodb.AbstractMongoProcessor
org.apache.nifi.processors.mongodb.PutMongoRecord
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@Tags({"mongodb","insert","update","upsert","record","put"})
@InputRequirement(INPUT_REQUIRED)
@CapabilityDescription("This processor is a record-aware processor for inserting/upserting data into MongoDB. It uses a configured record reader and schema to read an incoming record set from the body of a flowfile and then inserts/upserts batches of those records into a configured MongoDB collection. This processor does not support deletes. The number of documents to insert/upsert at a time is controlled by the \"Batch Size\" configuration property. This value should be set to a reasonable size to ensure that MongoDB is not overloaded with too many operations at once.")
@ReadsAttribute(attribute="mongodb.update.mode",
description="Configurable parameter for controlling update mode on a per-flowfile basis. Acceptable values are \'one\' and \'many\' and controls whether a single incoming record should update a single or multiple Mongo documents.")
public class PutMongoRecord
extends AbstractMongoProcessor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.nifi.processors.mongodb.AbstractMongoProcessor
AbstractMongoProcessor.UpdateMethod -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.PropertyDescriptorprivate static final List<org.apache.nifi.components.PropertyDescriptor> (package private) static final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.processor.Relationship(package private) static final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> (package private) static final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.PropertyDescriptorFields inherited from class org.apache.nifi.processors.mongodb.AbstractMongoProcessor
ATTRIBUTE_MONGODB_UPDATE_MODE, BATCH_SIZE, CHARSET, CLIENT_SERVICE, clientService, COLLECTION_NAME, DATABASE_NAME, DATE_FORMAT, JSON_EXTENDED, JSON_STANDARD, JSON_TYPE, JSON_TYPE_EXTENDED, JSON_TYPE_STANDARD, mongoClient, objectMapper, QUERY_ATTRIBUTE, RESULTS_PER_FLOWFILE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.bson.conversions.Bson[]buildFilters(Map<String, List<String>> updateKeyFieldPathToFieldChain, org.bson.Document readyToUpsert) convertArrays(Object[] input) private org.bson.DocumentconvertArrays(org.bson.Document doc) Set<org.apache.nifi.processor.Relationship> List<org.apache.nifi.components.PropertyDescriptor> voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processors.mongodb.AbstractMongoProcessor
closeClient, configureMapper, createClient, getClientSettings, getCollection, getCommonPropertyDescriptors, getDatabase, getURI, updateModeMatches, writeBatchMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
REL_SUCCESS
static final org.apache.nifi.processor.Relationship REL_SUCCESS -
REL_FAILURE
static final org.apache.nifi.processor.Relationship REL_FAILURE -
RECORD_READER_FACTORY
static final org.apache.nifi.components.PropertyDescriptor RECORD_READER_FACTORY -
INSERT_COUNT
static final org.apache.nifi.components.PropertyDescriptor INSERT_COUNT -
ORDERED
static final org.apache.nifi.components.PropertyDescriptor ORDERED -
BYPASS_VALIDATION
static final org.apache.nifi.components.PropertyDescriptor BYPASS_VALIDATION -
UPDATE_KEY_FIELDS
static final org.apache.nifi.components.PropertyDescriptor UPDATE_KEY_FIELDS -
UPDATE_MODE
static final org.apache.nifi.components.PropertyDescriptor UPDATE_MODE -
RELATIONSHIPS
-
PROPERTY_DESCRIPTORS
-
-
Constructor Details
-
PutMongoRecord
public PutMongoRecord()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
convertArrays
private org.bson.Document convertArrays(org.bson.Document doc) -
convertArrays
-
buildFilters
-