@Override protected List<PropertyDescriptor> getSupportedPropertyDescriptors() { AllowableValue[] strategies = new AllowableValue[] { SCHEMA_NAME_PROPERTY, SCHEMA_TEXT_PROPERTY, INFER_SCHEMA }; List<PropertyDescriptor> _temp = new ArrayList<>(); _temp.add(new PropertyDescriptor.Builder() .fromPropertyDescriptor(SCHEMA_ACCESS_STRATEGY) .allowableValues(strategies) .defaultValue(getDefaultSchemaAccessStrategy().getValue()) .build()); _temp.add(SCHEMA_REGISTRY); _temp.add(SCHEMA_NAME); _temp.add(SCHEMA_VERSION); _temp.add(SCHEMA_BRANCH_NAME); _temp.add(SCHEMA_TEXT); _temp.add(CONTROLLER_SERVICE); _temp.add(DATABASE_NAME); _temp.add(COLLECTION_NAME); _temp.add(LOOKUP_VALUE_FIELD); _temp.add(PROJECTION); return Collections.unmodifiableList(_temp); }
@Override protected final void init(final ProcessorInitializationContext context) { super.init(context); final Set<Relationship> rels = new HashSet<>(); rels.add(REL_SUCCESS); rels.add(REL_RETRY); rels.add(REL_FAILURE); this.putHdfsRecordRelationships = Collections.unmodifiableSet(rels); final List<PropertyDescriptor> props = new ArrayList<>(properties); props.add(RECORD_READER); props.add(new PropertyDescriptor.Builder() .fromPropertyDescriptor(DIRECTORY) .description("The parent directory to which files should be written. Will be created if it doesn't exist.") .build()); final AllowableValue[] compressionTypes = getCompressionTypes(context).toArray(new AllowableValue[0]); props.add(new PropertyDescriptor.Builder() .fromPropertyDescriptor(COMPRESSION_TYPE) .allowableValues(compressionTypes) .defaultValue(getDefaultCompressionType(context)) .build()); props.add(OVERWRITE); props.add(UMASK); props.add(REMOTE_GROUP); props.add(REMOTE_OWNER); props.addAll(getAdditionalProperties()); this.putHdfsRecordProperties = Collections.unmodifiableList(props); }
@Override protected List<PropertyDescriptor> getSupportedPropertyDescriptors() { final List<PropertyDescriptor> properties = new ArrayList<>(); final AllowableValue[] strategies = getSchemaWriteStrategyValues().toArray(new AllowableValue[0]); properties.add(new PropertyDescriptor.Builder() .fromPropertyDescriptor(SCHEMA_WRITE_STRATEGY) .defaultValue(getDefaultSchemaWriteStrategy().getValue()) .allowableValues(strategies) .build()); properties.addAll(super.getSupportedPropertyDescriptors()); return properties; }
.required(true) .description("The engine to execute scripts") .allowableValues(engines) .defaultValue(engines[0].getValue()) .required(true)
@Override protected void init(ProcessorInitializationContext context) { super.init(context); synchronized (ALL_FIELD_NAMES) { if (ALL_FIELD_NAMES.isEmpty()) { ALL_FIELD_NAMES.addAll(UserAgentAnalyzer .newBuilder() .hideMatcherLoadStats() .delayInitialization() .dropTests() .build() .getAllPossibleFieldNamesSorted()); } } final Set<Relationship> relationshipsSet = new HashSet<>(); relationshipsSet.add(SUCCESS); relationshipsSet.add(MISSING); this.relationships = Collections.unmodifiableSet(relationshipsSet); for (String fieldName: ALL_FIELD_NAMES) { PropertyDescriptor propertyDescriptor = new PropertyDescriptor.Builder() .name(PROPERTY_PREFIX + fieldName) .description("If enabled will extract the " + fieldName + " field") .required(true) .allowableValues("true", "false") .defaultValue("false") .addValidator(StandardValidators.BOOLEAN_VALIDATOR) .build(); supportedPropertyDescriptors.add(propertyDescriptor); } }
@Override public final List<PropertyDescriptor> getSupportedPropertyDescriptors() { List<PropertyDescriptor> descriptorsNew = new ArrayList<>(); descriptorsNew.add(TESS_DATA_PATH); descriptorsNew.add(TESSERACT_PAGE_SEG_MODE); descriptorsNew.add(TESSERACT_CONFIGS); descriptorsNew.add(new PropertyDescriptor.Builder() .fromPropertyDescriptor(TESSERACT_LANGUAGE) .allowableValues(SUPPORTED_LANGUAGES) .build()); return descriptorsNew; }
protected PropertyDescriptor buildStrategyProperty(AllowableValue[] values) { return new PropertyDescriptor.Builder() .fromPropertyDescriptor(SCHEMA_ACCESS_STRATEGY) .allowableValues(values) .defaultValue(getDefaultSchemaAccessStrategy().getValue()) .build(); }
.description("The protocol for communication.") .required(true) .allowableValues(TCP_VALUE, UDP_VALUE) .defaultValue(TCP_VALUE.getValue()) .build(); .required(true) .defaultValue("false") .allowableValues("true", "false") .build();
.description("Whether to retain the client's Last Will. If the Last Will topic and message are not set then a Last Will will not be sent.") .required(false) .allowableValues("true","false") .build(); .description("QoS level to be used when publishing the Last Will Message") .required(false) .allowableValues( ALLOWABLE_VALUE_QOS_0, ALLOWABLE_VALUE_QOS_1, .description("Whether to start afresh or resume previous flows. See the allowable value descriptions for more details.") .required(true) .allowableValues( ALLOWABLE_VALUE_CLEAN_SESSION_TRUE, ALLOWABLE_VALUE_CLEAN_SESSION_FALSE .name("MQTT Specification Version") .description("The MQTT specification version when connecting with the broker. See the allowable value descriptions for more details.") .allowableValues( ALLOWABLE_VALUE_MQTT_VERSION_AUTO, ALLOWABLE_VALUE_MQTT_VERSION_311,
.required(true) .description("The engine to execute scripts") .allowableValues(engines) .defaultValue(engines[0].getValue()) .required(true)
public static PropertyDescriptor createRollbackOnFailureProperty(String additionalDescription) { return new PropertyDescriptor.Builder() .name("rollback-on-failure") .displayName("Rollback On Failure") .description("Specify how to handle error." + " By default (false), if an error occurs while processing a FlowFile, the FlowFile will be routed to" + " 'failure' or 'retry' relationship based on error type, and processor can continue with next FlowFile." + " Instead, you may want to rollback currently processed FlowFiles and stop further processing immediately." + " In that case, you can do so by enabling this 'Rollback On Failure' property. " + " If enabled, failed FlowFiles will stay in the input relationship without penalizing it and being processed repeatedly" + " until it gets processed successfully or removed by other means." + " It is important to set adequate 'Yield Duration' to avoid retrying too frequently." + additionalDescription) .allowableValues("true", "false") .addValidator(StandardValidators.BOOLEAN_VALIDATOR) .defaultValue("false") .required(true) .build(); }
protected PropertyDescriptor buildStrategyProperty(AllowableValue[] values) { return new PropertyDescriptor.Builder() .fromPropertyDescriptor(SCHEMA_ACCESS_STRATEGY) .allowableValues(values) .defaultValue(getDefaultSchemaAccessStrategy().getValue()) .build(); }