Member since
11-16-2015
902
Posts
664
Kudos Received
249
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
148 | 09-30-2025 05:23 AM | |
618 | 06-26-2025 01:21 PM | |
452 | 06-19-2025 02:48 PM | |
698 | 05-30-2025 01:53 PM | |
9715 | 02-22-2024 12:38 PM |
01-12-2017
03:12 PM
2 Kudos
In an upcoming release you will be able to keep stateful variables using UpdateAttribute (NIFI-1582), the author envisions it being able to support running averages. Also I started an AggregateValues processor under NIFI-2735, but haven't been able to finish it yet, and it works on micro-batches (such as files created from a split processor like SplitJson) rather than rolling windows. In the meantime if you are familiar with a scripting language such as Groovy, Jython, Javascript, or JRuby you could use ExecuteScript or InvokeScriptedProcessor, they have access (via the ProcessContext) to the StateManager, where you could keep state, averages, etc, across flow files over time.
... View more
01-12-2017
02:52 PM
Specifically, in your processor POM (which you list above), Bryan is saying that under that dependency you should have a <scope>provided</scope> line, and in your NAR POM you should include: <dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-standard-services-api-nar</artifactId>
<type>nar</type>
</dependency>
... View more
01-11-2017
06:24 PM
1 Kudo
I see that "Keep Source File" is set to false, if this processor has executed successfully once, then the file will be removed, and when it runs again, the file will no longer be there. Also since the File Filter is a regular expression, you may want to specify sample\.txt (note the backslash) to match the filename exactly (otherwise the period matches any character so a file called sample1txt would be found as well).
... View more
01-09-2017
02:24 PM
Can you explain a bit more about what is to be done with both files? So far it looks like your flow is finding the non-control files and adding an attribute for its corresponding control file. How do you intend to use the contents of the control file, and what would be the content for the file written to HDFS?
... View more
01-09-2017
01:44 PM
1 Kudo
Can you check the logs (in logs/nifi-app.log) to see what the error was? Also, what is the content of the first flow file to go into PutSQL (that is being routed to failure)? Does that SQL statement work when executed from something like SQL Developer?
... View more
01-04-2017
07:57 PM
Is that NiFi secured? If so, did you attempt to access it via HTTP (vs HTTPS), or vice versa (HTTPS to an unsecured NiFi)? Alternatively, were you running a flow at the time? If so, what were the processors involved? The version of Jetty was upgraded in NiFi 1.0.0, but I'm not sure what (if anything) is different between 1.0.0 and 1.1.0 with respect to Jetty.
... View more
01-04-2017
02:02 PM
2 Kudos
Groovy syntax is very similar to Java, and using the Module Directory property of ExecuteScript or InvokeScriptedProcessor, you could include your Java code / JARs and use Groovy only to pass on data/objects to your Java code (i.e. you wouldn't need to write everything in Groovy, just enough to call your Java class(es)). ExecuteStreamCommand is akin to calling something from the command line, so if you can run your code from the command line using the "java" program, you can do the same from ExecuteStreamCommand. If you can describe your code/project and its entry points, I can help get you going with ExecuteScript and Groovy if you like.
... View more
01-04-2017
02:33 AM
ExecuteScript uses the name provided by the script engine to display to the user. The Jython script engine chose "python" as the language name, so that is the correct choice. One major difference is that with Jython you can only include pure Python (.py) modules, not natively-compiled modules like numpy/scipy.
... View more
01-03-2017
05:43 PM
1 Kudo
When using the Jython script engine in ExecuteScript, the Module Directory property works somewhat like the standard Python module system. I believe you'll want to have the location(s) specified as the directories containing the scripts, not the scripts themselves. Each entry in Module Directory is added to the script engine via a "sys.path.append()" call, so if you can get the modules to load for a regular python script (using sys.path.append() with full path names), then you can use that same list for Module Directory. I'd try: C:\Users\pjalla\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\requests,C:\Users\pjalla\AppData\Local\Programs\Python\Python35-32\Lib\json,C:\Users\pjalla\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\requests_oauthlib or whichever variations to avoid the drive letter, backslashes, etc. In this unit test you can see the Module Directory set to a test resources folder, the test uses "from callbacks import ReadFirstLine", and there are .py files in the "callbacks" folder under the test resources folder specified as Module Directory. Hopefully you can use a similar approach to have the script engine find the folders/locations and import the corresponding code.
... View more
01-03-2017
02:51 PM
What error are you getting and what approach are you using (and what version of NiFi/HDF)? I recommend setting up a DBCPConnectionPool controller service. Your settings for the controller service will depend on your MySQL instance, here is an example of one I use to connect to a local MySQL running on Docker, using test_schema as the database: The "Database Driver Location(s)" property is set to a URL pointing at my mysql-connector-java-5.1.38-bin.jar. As of NiFi 1.0.0 (via NIFI-2604), this property can include a comma-separated list of folders and/or JARs, and need not be URLs (i.e. you can use relative path names, although according to this post I don't think having the Windows drive letter at the front will work).
... View more