org.apache.nifi.processor.ProcessorInitializationContext Java Examples

The following examples show how to use org.apache.nifi.processor.ProcessorInitializationContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PostHTTP.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);

    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(URL);
    properties.add(MAX_BATCH_SIZE);
    properties.add(MAX_DATA_RATE);
    properties.add(SSL_CONTEXT_SERVICE);
    properties.add(USERNAME);
    properties.add(PASSWORD);
    properties.add(SEND_AS_FLOWFILE);
    properties.add(CHUNKED_ENCODING);
    properties.add(COMPRESSION_LEVEL);
    properties.add(CONNECTION_TIMEOUT);
    properties.add(DATA_TIMEOUT);
    properties.add(ATTRIBUTES_AS_HEADERS_REGEX);
    properties.add(USER_AGENT);
    properties.add(PROXY_HOST);
    properties.add(PROXY_PORT);
    properties.add(CONTENT_TYPE);
    this.properties = Collections.unmodifiableList(properties);
}
 
Example #2
Source File: GetSplunk.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(SCHEME);
    descriptors.add(HOSTNAME);
    descriptors.add(PORT);
    descriptors.add(QUERY);
    descriptors.add(TIME_FIELD_STRATEGY);
    descriptors.add(TIME_RANGE_STRATEGY);
    descriptors.add(EARLIEST_TIME);
    descriptors.add(LATEST_TIME);
    descriptors.add(TIME_ZONE);
    descriptors.add(APP);
    descriptors.add(OWNER);
    descriptors.add(TOKEN);
    descriptors.add(USERNAME);
    descriptors.add(PASSWORD);
    descriptors.add(SECURITY_PROTOCOL);
    descriptors.add(OUTPUT_MODE);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #3
Source File: LogAttribute.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> procRels = new HashSet<>();
    procRels.add(REL_SUCCESS);
    relationships = Collections.unmodifiableSet(procRels);

    // descriptors
    final List<PropertyDescriptor> supDescriptors = new ArrayList<>();
    supDescriptors.add(LOG_LEVEL);
    supDescriptors.add(LOG_PAYLOAD);
    supDescriptors.add(ATTRIBUTES_TO_LOG_CSV);
    supDescriptors.add(ATTRIBUTES_TO_LOG_REGEX);
    supDescriptors.add(ATTRIBUTES_TO_IGNORE_CSV);
    supDescriptors.add(ATTRIBUTES_TO_IGNORE_REGEX);
    supDescriptors.add(LOG_PREFIX);
    supDescriptors.add(CHARSET);
    supportedDescriptors = Collections.unmodifiableList(supDescriptors);
}
 
Example #4
Source File: GetTwitter.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(ENDPOINT);
    descriptors.add(CONSUMER_KEY);
    descriptors.add(CONSUMER_SECRET);
    descriptors.add(ACCESS_TOKEN);
    descriptors.add(ACCESS_TOKEN_SECRET);
    descriptors.add(LANGUAGES);
    descriptors.add(TERMS);
    descriptors.add(FOLLOWING);
    descriptors.add(LOCATIONS);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #5
Source File: AbstractPutEventProcessor.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(HOSTNAME);
    descriptors.add(PORT);
    descriptors.add(MAX_SOCKET_SEND_BUFFER_SIZE);
    descriptors.add(IDLE_EXPIRATION);
    descriptors.addAll(getAdditionalProperties());
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    relationships.addAll(getAdditionalRelationships());
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #6
Source File: EvaluateXQuery.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_MATCH);
    relationships.add(REL_NO_MATCH);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);

    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(DESTINATION);
    properties.add(XML_OUTPUT_METHOD);
    properties.add(XML_OUTPUT_OMIT_XML_DECLARATION);
    properties.add(XML_OUTPUT_INDENT);
    properties.add(VALIDATE_DTD);
    this.properties = Collections.unmodifiableList(properties);
}
 
Example #7
Source File: PutHiveStreaming.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(ProcessorInitializationContext context) {
    List<PropertyDescriptor> props = new ArrayList<>();
    props.add(METASTORE_URI);
    props.add(HIVE_CONFIGURATION_RESOURCES);
    props.add(DB_NAME);
    props.add(TABLE_NAME);
    props.add(PARTITION_COLUMNS);
    props.add(AUTOCREATE_PARTITIONS);
    props.add(MAX_OPEN_CONNECTIONS);
    props.add(HEARTBEAT_INTERVAL);
    props.add(TXNS_PER_BATCH);
    props.add(RECORDS_PER_TXN);

    kerberosConfigFile = context.getKerberosConfigurationFile();
    kerberosProperties = new KerberosProperties(kerberosConfigFile);
    props.add(kerberosProperties.getKerberosPrincipal());
    props.add(kerberosProperties.getKerberosKeytab());
    propertyDescriptors = Collections.unmodifiableList(props);

    Set<Relationship> _relationships = new HashSet<>();
    _relationships.add(REL_SUCCESS);
    _relationships.add(REL_FAILURE);
    _relationships.add(REL_RETRY);
    relationships = Collections.unmodifiableSet(_relationships);
}
 
Example #8
Source File: ExtractText.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> rels = new HashSet<>();
    rels.add(REL_MATCH);
    rels.add(REL_NO_MATCH);
    this.relationships = Collections.unmodifiableSet(rels);

    final List<PropertyDescriptor> props = new ArrayList<>();
    props.add(CHARACTER_SET);
    props.add(MAX_BUFFER_SIZE);
    props.add(MAX_CAPTURE_GROUP_LENGTH);
    props.add(CANON_EQ);
    props.add(CASE_INSENSITIVE);
    props.add(COMMENTS);
    props.add(DOTALL);
    props.add(LITERAL);
    props.add(MULTILINE);
    props.add(UNICODE_CASE);
    props.add(UNICODE_CHARACTER_CLASS);
    props.add(UNIX_LINES);
    props.add(INCLUDE_CAPTURE_GROUP_ZERO);
    props.add(ENABLE_REPEATING_CAPTURE_GROUP);
    this.properties = Collections.unmodifiableList(props);
}
 
Example #9
Source File: PutHTMLElement.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
    descriptors.add(CSS_SELECTOR);
    descriptors.add(HTML_CHARSET);
    descriptors.add(PUT_LOCATION_TYPE);
    descriptors.add(PUT_VALUE);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<Relationship>();
    relationships.add(REL_ORIGINAL);
    relationships.add(REL_SUCCESS);
    relationships.add(REL_INVALID_HTML);
    relationships.add(REL_NOT_FOUND);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #10
Source File: ListenSyslog.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(PROTOCOL);
    descriptors.add(PORT);
    descriptors.add(NETWORK_INTF_NAME);
    descriptors.add(SSL_CONTEXT_SERVICE);
    descriptors.add(CLIENT_AUTH);
    descriptors.add(RECV_BUFFER_SIZE);
    descriptors.add(MAX_MESSAGE_QUEUE_SIZE);
    descriptors.add(MAX_SOCKET_BUFFER_SIZE);
    descriptors.add(MAX_CONNECTIONS);
    descriptors.add(MAX_BATCH_SIZE);
    descriptors.add(MESSAGE_DELIMITER);
    descriptors.add(PARSE_MESSAGES);
    descriptors.add(CHARSET);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_INVALID);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #11
Source File: ListenHTTP.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(RELATIONSHIP_SUCCESS);
    this.relationships = Collections.unmodifiableSet(relationships);

    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(BASE_PATH);
    descriptors.add(PORT);
    descriptors.add(MAX_DATA_RATE);
    descriptors.add(SSL_CONTEXT_SERVICE);
    descriptors.add(AUTHORIZED_DN_PATTERN);
    descriptors.add(MAX_UNCONFIRMED_TIME);
    descriptors.add(HEADERS_AS_ATTRIBUTES_REGEX);
    descriptors.add(RETURN_CODE);
    descriptors.add(MULTIPART_REQUEST_MAX_SIZE);
    descriptors.add(MULTIPART_READ_BUFFER_SIZE);
    this.properties = Collections.unmodifiableList(descriptors);
}
 
Example #12
Source File: CompressContent.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(MODE);
    properties.add(COMPRESSION_FORMAT);
    properties.add(COMPRESSION_LEVEL);
    properties.add(UPDATE_FILENAME);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);

    final Map<String, String> mimeTypeMap = new HashMap<>();
    mimeTypeMap.put("application/gzip", COMPRESSION_FORMAT_GZIP);
    mimeTypeMap.put("application/x-gzip", COMPRESSION_FORMAT_GZIP);
    mimeTypeMap.put("application/bzip2", COMPRESSION_FORMAT_BZIP2);
    mimeTypeMap.put("application/x-bzip2", COMPRESSION_FORMAT_BZIP2);
    mimeTypeMap.put("application/x-lzma", COMPRESSION_FORMAT_LZMA);
    mimeTypeMap.put("application/x-snappy", COMPRESSION_FORMAT_SNAPPY);
    mimeTypeMap.put("application/x-snappy-framed", COMPRESSION_FORMAT_SNAPPY_FRAMED);
    this.compressionFormatMimeTypeMap = Collections.unmodifiableMap(mimeTypeMap);
}
 
Example #13
Source File: AttributesToCSV.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(ATTRIBUTES_LIST);
    properties.add(ATTRIBUTES_REGEX);
    properties.add(DESTINATION);
    properties.add(INCLUDE_CORE_ATTRIBUTES);
    properties.add(NULL_VALUE_FOR_EMPTY_STRING);
    properties.add(INCLUDE_SCHEMA);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #14
Source File: ReplaceTextWithMapping.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(REGEX);
    properties.add(MATCHING_GROUP_FOR_LOOKUP_KEY);
    properties.add(MAPPING_FILE);
    properties.add(MAPPING_FILE_REFRESH_INTERVAL);
    properties.add(CHARACTER_SET);
    properties.add(MAX_BUFFER_SIZE);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #15
Source File: ReplaceTextWithMapping.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(REGEX);
    properties.add(MATCHING_GROUP_FOR_LOOKUP_KEY);
    properties.add(MAPPING_FILE);
    properties.add(MAPPING_FILE_REFRESH_INTERVAL);
    properties.add(CHARACTER_SET);
    properties.add(MAX_BUFFER_SIZE);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #16
Source File: CompareFuzzyHash.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
    descriptors.add(HASH_LIST_FILE);
    // As mentioned above, add the PropertyDescriptor HASH_ALGORITHM and ATTRIBUTE_NAME from parent class
    descriptors.add(HASH_ALGORITHM);
    descriptors.add(ATTRIBUTE_NAME);
    descriptors.add(MATCH_THRESHOLD);
    descriptors.add(MATCHING_MODE);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<Relationship>();
    relationships.add(REL_FOUND);
    relationships.add(REL_NOT_FOUND);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #17
Source File: GenerateFlowFile.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(FILE_SIZE);
    descriptors.add(BATCH_SIZE);
    descriptors.add(DATA_FORMAT);
    descriptors.add(UNIQUE_FLOWFILES);
    descriptors.add(CUSTOM_TEXT);
    descriptors.add(CHARSET);
    descriptors.add(MIME_TYPE);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(SUCCESS);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #18
Source File: ListFile.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(DIRECTORY);
    properties.add(RECURSE);
    properties.add(DIRECTORY_LOCATION);
    properties.add(FILE_FILTER);
    properties.add(PATH_FILTER);
    properties.add(MIN_AGE);
    properties.add(MAX_AGE);
    properties.add(MIN_SIZE);
    properties.add(MAX_SIZE);
    properties.add(IGNORE_HIDDEN_FILES);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #19
Source File: RetryFlowFile.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(ProcessorInitializationContext context) {
    List<PropertyDescriptor> props = new ArrayList<>();
    props.add(RETRY_ATTRIBUTE);
    props.add(MAXIMUM_RETRIES);
    props.add(PENALIZE_RETRIED);
    props.add(FAIL_ON_OVERWRITE);
    props.add(REUSE_MODE);
    this.properties = Collections.unmodifiableList(props);

    Set<Relationship> rels = new HashSet<>();
    rels.add(RETRY);
    rels.add(RETRIES_EXCEEDED);
    rels.add(FAILURE);
    this.relationships = Collections.unmodifiableSet(rels);
}
 
Example #20
Source File: PutFile.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    // relationships
    final Set<Relationship> procRels = new HashSet<>();
    procRels.add(REL_SUCCESS);
    procRels.add(REL_FAILURE);
    relationships = Collections.unmodifiableSet(procRels);

    // descriptors
    final List<PropertyDescriptor> supDescriptors = new ArrayList<>();
    supDescriptors.add(DIRECTORY);
    supDescriptors.add(CONFLICT_RESOLUTION);
    supDescriptors.add(CREATE_DIRS);
    supDescriptors.add(MAX_DESTINATION_FILES);
    supDescriptors.add(CHANGE_LAST_MODIFIED_TIME);
    supDescriptors.add(CHANGE_PERMISSIONS);
    supDescriptors.add(CHANGE_OWNER);
    supDescriptors.add(CHANGE_GROUP);
    properties = Collections.unmodifiableList(supDescriptors);
}
 
Example #21
Source File: YandexTranslate.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(KEY);
    descriptors.add(SOURCE_LANGUAGE);
    descriptors.add(TARGET_LANGUAGE);
    descriptors.add(TRANSLATE_CONTENT);
    descriptors.add(CHARACTER_SET);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_COMMS_FAILURE);
    relationships.add(REL_TRANSLATION_FAILED);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #22
Source File: GetHTTP.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    this.relationships = Collections.unmodifiableSet(relationships);

    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(URL);
    properties.add(FILENAME);
    properties.add(SSL_CONTEXT_SERVICE);
    properties.add(USERNAME);
    properties.add(PASSWORD);
    properties.add(CONNECTION_TIMEOUT);
    properties.add(DATA_TIMEOUT);
    properties.add(USER_AGENT);
    properties.add(ACCEPT_CONTENT_TYPE);
    properties.add(FOLLOW_REDIRECTS);
    properties.add(REDIRECT_COOKIE_POLICY);
    properties.add(PROXY_HOST);
    properties.add(PROXY_PORT);
    this.properties = Collections.unmodifiableList(properties);
}
 
Example #23
Source File: GetFile.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(DIRECTORY);
    properties.add(FILE_FILTER);
    properties.add(PATH_FILTER);
    properties.add(BATCH_SIZE);
    properties.add(KEEP_SOURCE_FILE);
    properties.add(RECURSE);
    properties.add(POLLING_INTERVAL);
    properties.add(IGNORE_HIDDEN_FILES);
    properties.add(MIN_AGE);
    properties.add(MAX_AGE);
    properties.add(MIN_SIZE);
    properties.add(MAX_SIZE);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #24
Source File: ExtractImageMetadata.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {

    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(MAX_NUMBER_OF_ATTRIBUTES);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(SUCCESS);
    relationships.add(FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #25
Source File: UnpackContent.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_SUCCESS);
    relationships.add(REL_ORIGINAL);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);

    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(PACKAGING_FORMAT);
    properties.add(FILE_FILTER);
    this.properties = Collections.unmodifiableList(properties);
}
 
Example #26
Source File: EvaluateXQuery.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_MATCH);
    relationships.add(REL_NO_MATCH);
    relationships.add(REL_FAILURE);
    this.relationships = Collections.unmodifiableSet(relationships);

    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(DESTINATION);
    properties.add(XML_OUTPUT_METHOD);
    properties.add(XML_OUTPUT_OMIT_XML_DECLARATION);
    properties.add(XML_OUTPUT_INDENT);
    this.properties = Collections.unmodifiableList(properties);
}
 
Example #27
Source File: AbstractPutHDFSRecord.java    From nifi with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #28
Source File: RouteOnContent.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_NO_MATCH);
    this.relationships.set(Collections.unmodifiableSet(relationships));

    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(MATCH_REQUIREMENT);
    properties.add(CHARACTER_SET);
    properties.add(BUFFER_SIZE);
    this.properties = Collections.unmodifiableList(properties);
}
 
Example #29
Source File: ScanAttribute.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> properties = new ArrayList<>();
    properties.add(DICTIONARY_FILE);
    properties.add(ATTRIBUTE_PATTERN);
    properties.add(MATCHING_CRITERIA);
    properties.add(DICTIONARY_FILTER);
    this.properties = Collections.unmodifiableList(properties);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(REL_MATCHED);
    relationships.add(REL_UNMATCHED);
    this.relationships = Collections.unmodifiableSet(relationships);
}
 
Example #30
Source File: AbstractCouchbaseProcessor.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected final void init(final ProcessorInitializationContext context) {

    final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
    descriptors.add(COUCHBASE_CLUSTER_SERVICE);
    descriptors.add(BUCKET_NAME);
    addSupportedProperties(descriptors);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<Relationship>();
    addSupportedRelationships(relationships);
    this.relationships = Collections.unmodifiableSet(relationships);

}