[GitHub] nifi pull request #3201: NIFI-4621
Github user ijokarumawak commented on a diff in the pull request: https://github.com/apache/nifi/pull/3201#discussion_r239324396 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java --- @@ -35,17 +36,21 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.state.Scope; import org.apache.nifi.context.PropertyContext; +import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.util.list.ListedEntityTracker; import org.apache.nifi.processors.standard.util.FileTransfer; import org.apache.nifi.processors.standard.util.FTPTransfer; @PrimaryNodeOnly @TriggerSerially -@InputRequirement(Requirement.INPUT_FORBIDDEN) +@InputRequirement(Requirement.INPUT_ALLOWED) --- End diff -- Let's design how we improve this processors (or create other processors if necessary) first. I remember there was some discussion on JIRA or ML before. Please check those, too. If PATh can be supplied by incoming FlowFiles, then I personally prefer passing minimum timestamps by FlowFiles, too. ---
[GitHub] nifi pull request #3201: NIFI-4621
Github user kislayom commented on a diff in the pull request: https://github.com/apache/nifi/pull/3201#discussion_r239314794 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java --- @@ -35,17 +36,21 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.state.Scope; import org.apache.nifi.context.PropertyContext; +import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.util.list.ListedEntityTracker; import org.apache.nifi.processors.standard.util.FileTransfer; import org.apache.nifi.processors.standard.util.FTPTransfer; @PrimaryNodeOnly @TriggerSerially -@InputRequirement(Requirement.INPUT_FORBIDDEN) +@InputRequirement(Requirement.INPUT_ALLOWED) @Tags({"list", "ftp", "remote", "ingest", "source", "input", "files"}) @CapabilityDescription("Performs a listing of the files residing on an FTP server. For each file that is found on the remote server, a new FlowFile will be created with the filename attribute " + "set to the name of the file on the remote server. This can then be used in conjunction with FetchFTP in order to fetch those files.") +@DynamicProperty(name = "Relationship Name", value = "Attribute Expression Language", +expressionLanguageScope = ExpressionLanguageScope.FLOWFILE_ATTRIBUTES, description = "Routes FlowFiles whose attributes match the " ++ "Attribute Expression Language specified in the Dynamic Property Value to the Relationship specified in the Dynamic Property Key") --- End diff -- It is used to set the scope of Expression language. More details as under: https://static.javadoc.io/org.apache.nifi/nifi-api/1.7.0/org/apache/nifi/expression/ExpressionLanguageScope.html > Indicates the scope of expression language on a property descriptor. Scope of the expression language is hierarchical. NONE -> VARIABLE_REGISTRY -> FLOWFILE_ATTRIBUTES When scope is set to FlowFiles attributes, variables are evaluated against attributes of each incoming flow file. If no matching attribute is found, variable registry will be checked. NONE - expression language is not supported VARIABLE_REGISTRY is hierarchically constructed as below: | Variables defined at process group level and then, recursively, up | to the higher process group until the root process group. |--- Variables defined in custom properties files through the | nifi.variable.registry.properties property in nifi.properties file. |-- Environment variables defined at JVM level and system properties. FLOWFILE_ATTRIBUTES - will check attributes of each individual flow file > ---
[GitHub] nifi pull request #3201: NIFI-4621
Github user kislayom commented on a diff in the pull request: https://github.com/apache/nifi/pull/3201#discussion_r239314421 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java --- @@ -35,17 +36,21 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.state.Scope; import org.apache.nifi.context.PropertyContext; +import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.util.list.ListedEntityTracker; import org.apache.nifi.processors.standard.util.FileTransfer; import org.apache.nifi.processors.standard.util.FTPTransfer; @PrimaryNodeOnly @TriggerSerially -@InputRequirement(Requirement.INPUT_FORBIDDEN) +@InputRequirement(Requirement.INPUT_ALLOWED) --- End diff -- Sure, based on the input provided i will try to identify required changes. The latest timestamp management part might be tricky are we required to keep latest timestamp per path, hostname, and user wise or just the latest one ? I have so far assumed to manage latest timestamp only for the latest. If we plan to manages all timestamps i will need to rework on a number of things here, and may would like to approach the problem starting with proposed design. ---
[GitHub] nifi pull request #3201: NIFI-4621
Github user ijokarumawak commented on a diff in the pull request: https://github.com/apache/nifi/pull/3201#discussion_r239307533 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java --- @@ -35,17 +36,21 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.state.Scope; import org.apache.nifi.context.PropertyContext; +import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.util.list.ListedEntityTracker; import org.apache.nifi.processors.standard.util.FileTransfer; import org.apache.nifi.processors.standard.util.FTPTransfer; @PrimaryNodeOnly @TriggerSerially -@InputRequirement(Requirement.INPUT_FORBIDDEN) +@InputRequirement(Requirement.INPUT_ALLOWED) @Tags({"list", "ftp", "remote", "ingest", "source", "input", "files"}) @CapabilityDescription("Performs a listing of the files residing on an FTP server. For each file that is found on the remote server, a new FlowFile will be created with the filename attribute " + "set to the name of the file on the remote server. This can then be used in conjunction with FetchFTP in order to fetch those files.") +@DynamicProperty(name = "Relationship Name", value = "Attribute Expression Language", +expressionLanguageScope = ExpressionLanguageScope.FLOWFILE_ATTRIBUTES, description = "Routes FlowFiles whose attributes match the " ++ "Attribute Expression Language specified in the Dynamic Property Value to the Relationship specified in the Dynamic Property Key") --- End diff -- What's this used for? ---
[GitHub] nifi pull request #3201: NIFI-4621
Github user ijokarumawak commented on a diff in the pull request: https://github.com/apache/nifi/pull/3201#discussion_r239310311 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFTP.java --- @@ -35,17 +36,21 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.state.Scope; import org.apache.nifi.context.PropertyContext; +import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.util.list.ListedEntityTracker; import org.apache.nifi.processors.standard.util.FileTransfer; import org.apache.nifi.processors.standard.util.FTPTransfer; @PrimaryNodeOnly @TriggerSerially -@InputRequirement(Requirement.INPUT_FORBIDDEN) +@InputRequirement(Requirement.INPUT_ALLOWED) --- End diff -- Changing input requirement is not enough if we want to support incoming FlowFiles. Processors need to: 1. Take input FlowFiles, LogMessage processor can be the simplest example, please look [here](https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogMessage.java#L125) 2. Evaluate ExpressionLanguages using the FlowFiles, again LogMessage as [an example](https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogMessage.java#L130) Currently [FTPTransfer.getListing()](https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java#L187) doesn't do above things. And we also need to support existing use-cases with no input connection. Also, we need to track listing state such as latest timestamps ... etc. We need to do that efficiently with dynamically changing target paths if it's configured by incoming FlowFiles attribute. There are more things need to be done. ---
[GitHub] nifi pull request #3201: NIFI-4621
GitHub user kislayom reopened a pull request: https://github.com/apache/nifi/pull/3201 NIFI-4621 Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [x] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? - [x] Is your initial contribution a single, squashed commit? ### For code changes: - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [] Have you written or updated unit tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [ ] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/kislayom/nifi NIFI-4621 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/3201.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3201 commit 0512754739cf63785aebfc53a89bb75d37bacbed Author: Kislay Kumar Date: 2018-12-04T12:03:56Z NIFI-4621 Enable ListSFTP and ListFTP processor to accept connection from other processors, also validated the explression language is working for properties of both the processors. commit 9da3a8700244b4fdc06c634805bbc0b25369623a Author: Kislay Kumar Date: 2018-12-04T13:05:34Z NIFI-4621 changes in processor ListSFTP and ListFTP to also have input connection and expression language for properties commit 4319d472a25fecc2bbb66501c98d91828470d15d Author: Kislay Kumar Date: 2018-12-04T12:03:56Z NIFI-4621 Enable ListSFTP and ListFTP processor to accept connection from other processors, also validated the explression language is working for properties of both the processors. NIFI-4621 changes in processor ListSFTP and ListFTP to also have input connection and expression language for properties commit d4321cf72085786f1f0b9453270fc6c7c5d32fe3 Author: kislayom Date: 2018-12-05T09:25:26Z Merge branch 'NIFI-4621' of https://github.com/kislayom/nifi into NIFI-4621 ---
[GitHub] nifi pull request #3201: NIFI-4621
Github user kislayom closed the pull request at: https://github.com/apache/nifi/pull/3201 ---
[GitHub] nifi pull request #3201: NIFI-4621
GitHub user kislayom opened a pull request: https://github.com/apache/nifi/pull/3201 NIFI-4621 Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [x] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? - [x] Is your initial contribution a single, squashed commit? ### For code changes: - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [] Have you written or updated unit tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [ ] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/kislayom/nifi NIFI-4621 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/3201.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3201 commit 0512754739cf63785aebfc53a89bb75d37bacbed Author: Kislay Kumar Date: 2018-12-04T12:03:56Z NIFI-4621 Enable ListSFTP and ListFTP processor to accept connection from other processors, also validated the explression language is working for properties of both the processors. commit 9da3a8700244b4fdc06c634805bbc0b25369623a Author: Kislay Kumar Date: 2018-12-04T13:05:34Z NIFI-4621 changes in processor ListSFTP and ListFTP to also have input connection and expression language for properties commit 4319d472a25fecc2bbb66501c98d91828470d15d Author: Kislay Kumar Date: 2018-12-04T12:03:56Z NIFI-4621 Enable ListSFTP and ListFTP processor to accept connection from other processors, also validated the explression language is working for properties of both the processors. NIFI-4621 changes in processor ListSFTP and ListFTP to also have input connection and expression language for properties commit d4321cf72085786f1f0b9453270fc6c7c5d32fe3 Author: kislayom Date: 2018-12-05T09:25:26Z Merge branch 'NIFI-4621' of https://github.com/kislayom/nifi into NIFI-4621 ---