- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to dynamically supply directory attribute value from a external file for GETFILE ?
- Labels:
-
Apache NiFi
Created ‎08-15-2016 02:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a need to supply directory path for GETFILE processor from a file, which would be maintained as property file based on environment.. like landing,staging etc., Please help me if it is achievable and how? Can we use distributedCache ?
Also, Please provide DistributedMapCache examples.
Thanks
Created ‎08-15-2016 02:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Input Directory property of GetFile supports Expression Language so you can reference a system property like ${my.directory} and define my.directory in bootstrap.conf by adding another java arg like:
java.arg.15=-Dmy.directory=/foo
Then you can have different bootstrap files per environment.
Created ‎08-15-2016 02:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Input Directory property of GetFile supports Expression Language so you can reference a system property like ${my.directory} and define my.directory in bootstrap.conf by adding another java arg like:
java.arg.15=-Dmy.directory=/foo
Then you can have different bootstrap files per environment.
Created ‎08-15-2016 03:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @Bryan Bende for quick reply!
In addition to the above question, how can we pass the file name if a template is created and needs to be used by different users and they want to pass their own path?
The idea here is to get file from local path and put it in HDFS. I have created a template, which should be used by different users based on their need by passing the required path for both GetFile, PutFile. As bootstrap is common config, how can we handle this scenario? Users might not be using the UI.. we will be supplying the RET call to start/stop the process group.
Created ‎08-15-2016 03:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is each user importing the template into a separate NiFi instance? or is there one NiFi instance with multiple users who all import the same template and want to retrieve files from different directories?
Created ‎08-15-2016 04:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it is same NiFi instance with multiple users.
Created ‎08-15-2016 05:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In that scenario there is always going to be something you have to set that is specific to the user. I think the best approach might be to use the REST API to change the value of GetFile's directory after the user imported the template and set it to the user's input directory.
