@InputRequirement(value=INPUT_FORBIDDEN) @EventDriven @SupportsBatching @Tags(value={"elasticsearch","query","scroll","read","get","http"}) @CapabilityDescription(value="Scrolls through an Elasticsearch query using the specified connection properties. This processor is intended to be run on the primary node, and is designed for scrolling through huge result sets, as in the case of a reindex. The state must be cleared before another query can be run. Each page of results is returned, wrapped in a JSON object like so: { \"hits\" : [ <doc1>, <doc2>, <docn> ] }. Note that the full body of each page of documents will be read into memory before being written to a Flow File for transfer.") @WritesAttribute(attribute="es.index",description="The Elasticsearch index containing the document") @WritesAttribute(attribute="es.type",description="The Elasticsearch document type") @DynamicProperty(name="A URL query parameter", value="The value to set it to", supportsExpressionLanguage=true, description="Adds the specified property name/value as a query parameter in the Elasticsearch URL used for processing") @Stateful(description="After each successful scroll page, the latest scroll_id is persisted in scrollId as input for the next scroll call. Once the entire query is complete, finishedQuery state will be set to true, and the processor will not execute unless this is cleared.", scopes=LOCAL) public class ScrollElasticsearchHttp extends AbstractElasticsearchHttpProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
FIELDS |
static PropertyDescriptor |
INDEX |
static PropertyDescriptor |
PAGE_SIZE |
static PropertyDescriptor |
QUERY |
static Relationship |
REL_FAILURE |
static Relationship |
REL_SUCCESS |
static PropertyDescriptor |
SCROLL_DURATION |
static PropertyDescriptor |
SORT |
static PropertyDescriptor |
TYPE |
CONNECT_TIMEOUT, ES_URL, PROXY_HOST, PROXY_PORT, RESPONSE_TIMEOUT
CHARSET, PASSWORD, PROP_SSL_CONTEXT_SERVICE, USERNAME
Constructor and Description |
---|
ScrollElasticsearchHttp() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<Relationship> |
getRelationships() |
java.util.List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Allows subclasses to register which property descriptor objects are
supported.
|
void |
onTrigger(ProcessContext context,
ProcessSession session) |
void |
setup(ProcessContext context) |
createElasticsearchClient, customValidate, getClient, getSupportedDynamicPropertyDescriptor, isSuccess, parseJsonResponse, sendRequestToElasticsearch
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
public static final PropertyDescriptor QUERY
public static final PropertyDescriptor SCROLL_DURATION
public static final PropertyDescriptor INDEX
public static final PropertyDescriptor TYPE
public static final PropertyDescriptor FIELDS
public static final PropertyDescriptor SORT
public static final PropertyDescriptor PAGE_SIZE
public java.util.Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public final java.util.List<PropertyDescriptor> getSupportedPropertyDescriptors()
AbstractConfigurableComponent
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
@OnScheduled public void setup(ProcessContext context)
setup
in class AbstractElasticsearchProcessor
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException