@InputRequirement(value=INPUT_REQUIRED) @EventDriven @Tags(value={"elasticsearch","insert","update","upsert","delete","write","put","http","record"}) @CapabilityDescription(value="Writes the records from a FlowFile into to Elasticsearch, using the specified parameters such as the index to insert into and the type of the document, as well as the operation type (index, upsert, delete, etc.). Note: The Bulk API is used to send the records. This means that the entire contents of the incoming flow file are read into memory, and each record is transformed into a JSON document which is added to a single HTTP request body. For very large flow files (files with a large number of records, e.g.), this could cause memory usage issues.") @DynamicProperty(name="A URL query parameter", value="The value to set it to", expressionLanguageScope=VARIABLE_REGISTRY, description="Adds the specified property name/value as a query parameter in the Elasticsearch URL used for processing") public class PutElasticsearchHttpRecord extends AbstractElasticsearchHttpProcessor
| Modifier and Type | Field and Description |
|---|---|
(package private) static AllowableValue |
ALWAYS_SUPPRESS |
private com.fasterxml.jackson.core.JsonFactory |
factory |
(package private) static PropertyDescriptor |
ID_RECORD_PATH |
(package private) static PropertyDescriptor |
INDEX |
(package private) static PropertyDescriptor |
INDEX_OP |
(package private) static AllowableValue |
NEVER_SUPPRESS |
private String |
nullSuppression |
private static List<PropertyDescriptor> |
propertyDescriptors |
(package private) static PropertyDescriptor |
RECORD_READER |
private RecordPathCache |
recordPathCache |
static Relationship |
REL_FAILURE |
static Relationship |
REL_RETRY |
static Relationship |
REL_SUCCESS |
private static Set<Relationship> |
relationships |
(package private) static AllowableValue |
SUPPRESS_MISSING |
(package private) static PropertyDescriptor |
SUPPRESS_NULLS |
(package private) static PropertyDescriptor |
TYPE |
COMMON_PROPERTY_DESCRIPTORS, CONNECT_TIMEOUT, ES_URL, FIELD_INCLUDE_QUERY_PARAM, PROXY_CONFIGURATION_SERVICE, PROXY_HOST, PROXY_PASSWORD, PROXY_PORT, PROXY_USERNAME, QUERY_QUERY_PARAM, RESPONSE_TIMEOUT, SIZE_QUERY_PARAM, SORT_QUERY_PARAMCHARSET, PASSWORD, PROP_SSL_CONTEXT_SERVICE, USERNAME| Constructor and Description |
|---|
PutElasticsearchHttpRecord() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
Set<Relationship> |
getRelationships() |
List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
void |
setup(ProcessContext context) |
private void |
writeArray(Object[] values,
String fieldName,
com.fasterxml.jackson.core.JsonGenerator generator,
DataType elementType) |
private void |
writeRecord(Record record,
RecordSchema writeSchema,
com.fasterxml.jackson.core.JsonGenerator generator) |
private void |
writeValue(com.fasterxml.jackson.core.JsonGenerator generator,
Object value,
String fieldName,
DataType dataType) |
buildBulkCommand, createElasticsearchClient, getClient, getSupportedDynamicPropertyDescriptor, isSuccess, parseJsonResponse, sendRequestToElasticsearchonTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
public static final Relationship REL_RETRY
static final PropertyDescriptor RECORD_READER
static final PropertyDescriptor ID_RECORD_PATH
static final PropertyDescriptor INDEX
static final PropertyDescriptor TYPE
static final PropertyDescriptor INDEX_OP
static final AllowableValue ALWAYS_SUPPRESS
static final AllowableValue NEVER_SUPPRESS
static final AllowableValue SUPPRESS_MISSING
static final PropertyDescriptor SUPPRESS_NULLS
private static final Set<Relationship> relationships
private static final List<PropertyDescriptor> propertyDescriptors
private volatile RecordPathCache recordPathCache
private final com.fasterxml.jackson.core.JsonFactory factory
private volatile String nullSuppression
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorpublic final List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentprotected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractElasticsearchHttpProcessor@OnScheduled public void setup(ProcessContext context)
setup in class AbstractElasticsearchProcessorpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionprivate void writeRecord(Record record, RecordSchema writeSchema, com.fasterxml.jackson.core.JsonGenerator generator) throws IOException
IOExceptionprivate void writeValue(com.fasterxml.jackson.core.JsonGenerator generator,
Object value,
String fieldName,
DataType dataType)
throws IOException
IOExceptionprivate void writeArray(Object[] values, String fieldName, com.fasterxml.jackson.core.JsonGenerator generator, DataType elementType) throws IOException
IOExceptionCopyright © 2018 Apache NiFi Project. All rights reserved.