Class GetMongo
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.AbstractMongoQueryProcessor
org.apache.nifi.processors.mongodb.GetMongo
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@Tags({"mongodb","read","get"})
@InputRequirement(INPUT_ALLOWED)
@CapabilityDescription("Creates FlowFiles from documents in MongoDB loaded by a user-specified query.")
@WritesAttribute(attribute="mongo.database.name",description="The database where the results came from.") @WritesAttribute(attribute="mongo.collection.name",description="The collection where the results came from.")
public class GetMongo
extends AbstractMongoQueryProcessor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.nifi.processors.mongodb.AbstractMongoProcessor
AbstractMongoProcessor.UpdateMethod -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.nifi.logging.ComponentLog(package private) static final org.apache.nifi.components.AllowableValueprivate static final List<org.apache.nifi.components.PropertyDescriptor> private static final Set<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptorprivate boolean(package private) static final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.AllowableValueFields inherited from class org.apache.nifi.processors.mongodb.AbstractMongoQueryProcessor
BATCH_SIZE, COL_NAME, DB_NAME, LIMIT, PROJECTION, QUERY, REL_FAILURE, REL_ORIGINAL, REL_SUCCESS, RESULTS_PER_FLOWFILE, SORTFields inherited from class org.apache.nifi.processors.mongodb.AbstractMongoProcessor
ATTRIBUTE_MONGODB_UPDATE_MODE, 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringbuildBatch(List<org.bson.Document> documents, String jsonTypeSetting, String prettyPrintSetting) private com.fasterxml.jackson.databind.ObjectWritergetObjectWriter(com.fasterxml.jackson.databind.ObjectMapper mapper, String ppSetting) Set<org.apache.nifi.processor.Relationship> final List<org.apache.nifi.components.PropertyDescriptor> voidonScheduled(org.apache.nifi.context.PropertyContext context) voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processors.mongodb.AbstractMongoQueryProcessor
getAttributes, getQueryMethods 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
-
SEND_EMPTY_RESULTS
public static final org.apache.nifi.components.PropertyDescriptor SEND_EMPTY_RESULTS -
YES_PP
static final org.apache.nifi.components.AllowableValue YES_PP -
NO_PP
static final org.apache.nifi.components.AllowableValue NO_PP -
USE_PRETTY_PRINTING
static final org.apache.nifi.components.PropertyDescriptor USE_PRETTY_PRINTING -
RELATIONSHIPS
-
PROPERTY_DESCRIPTORS
-
logger
private org.apache.nifi.logging.ComponentLog logger -
sendEmpty
private boolean sendEmpty
-
-
Constructor Details
-
GetMongo
public GetMongo()
-
-
Method Details
-
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.context.PropertyContext context) -
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
buildBatch
private String buildBatch(List<org.bson.Document> documents, String jsonTypeSetting, String prettyPrintSetting) throws IOException - Throws:
IOException
-
getObjectWriter
private com.fasterxml.jackson.databind.ObjectWriter getObjectWriter(com.fasterxml.jackson.databind.ObjectMapper mapper, String ppSetting) -
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
-