Member since
04-05-2016
130
Posts
93
Kudos Received
29
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
3571 | 06-05-2018 01:00 AM | |
4915 | 04-10-2018 08:23 AM | |
5450 | 07-18-2017 02:16 AM | |
2729 | 07-11-2017 01:02 PM | |
3186 | 07-10-2017 02:10 AM |
07-10-2017
11:47 PM
1 Kudo
Hi @Gabriel Queiroz In order to submit a JIRA, please go to the login page and sign-up your account. Then you'll see a red 'Create' button. https://issues.apache.org/jira/login.jsp
... View more
07-10-2017
02:10 AM
Hello @Rohit Ravishankar ListFile uses last modified timestamp of files. It tracks the latest last modified timestamp to pick newly modified files since it ran before. So, if a file is added with older last modified timestamp than the one which ListFile already picked, then the file won't be picked with ListFile logic. There is an existing JIRA to discuss about the behavior [1]. Min/Max filter is used to filter-out files that is too-young (min) or too-old (max) files. Even if a file passed these condition if its last modified timestamp is older than the latest on already listed, it won't be picked. If your use-case requires processing input files in 'descending last modified timestamp ' order, then I'd recommend using GetFile (keepSourceFile = false) and PriorityAttributePrioritizer [2] combination. [1] https://issues.apache.org/jira/browse/NIFI-2383 [2] https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#prioritization I hope this helps.
... View more
07-10-2017
01:47 AM
3 Kudos
Hello @Gabriel Queiroz I'm surprised to know that there's no existing processor that removes a key from distributed map cache. Would you submit a JIRA issue to request that functionality if possible? In the mean while, if you encounter such shortcomings, you can address it by writing a custom processor with ExecuteScript or InvokeScriptedProcessor in most cases. Those processors let you write custom processor using your favorite scripting engine. I've written an example, using Groovy to remove a key from distributed map cache. It will work with your use-case I think. https://gist.github.com/ijokarumawak/14d560fec5a052b3a157b38a11955772
... View more
07-07-2017
08:43 AM
1 Kudo
Hello @M R I was able to reproduce this behavior. The reason is timestamp-millis logicalType is not used as expected. When PutDatabaseRecord executes SQL, 'UPDATED_DATE' was set as it is as Long representation, so Oracle complains about it. Oracle expects Date type. Debugging further, I found that Avro doesn't read logicalType information if the type is defined as a String JSON node. Your schema text is defined as follows: {
"name": "UPDATED_DATE",
"type": "long",
"logicalType": "timestamp-millis"
} This way, 'logicalType' exists in the Field object, not for the 'type'. Since the 'type' element is textual, Avro parser don't decorate it. It has to be: {
"name": "UPDATED_DATE",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
}
} To correctly annotate type with logicalType. Now, the 'type' element is an JSON object, and Avro parser uses 'logicalType' definition. Then it works as expected.
... View more
07-05-2017
12:45 AM
2 Kudos
Hi @Gabriel Queiroz Glad to hear that works! The reason I put EvaluateJsonPath before ExecuteSQL is, ExecuteSQL can user FlowFile attributes with NiFi Expression Language (EL). If you haven't done yet, I recommend you to read Apache NiFi User Guide 'Terminology' [1] section. A FlowFile has two different data, Attributes and Content. Content is a opaque binary data, and Attributes is something like a hash map having string keys and values (META data). Processor properties like ExecuteSQL 'SQL select query' support EL. By using EL, you can construct a string value (e.g. SQL) using FlowFile Attributes. I also recommend reading EL Guide [2]. On the other hand, usually the data itself such as JSON or Avro serialized data is stored as FlowFile content, which is not accessible from EL directly. So, I used EvaluateJsonPath to extract values from FlowFile content to FlowFile Attribute, so that ExecuteSQL can use it. The user-defined properties at EvaluateJsonPath (in the red rectangle) are JSON paths. Both NiFi EL and JSON path use '$' so look similar but those are different techniques. Does it answer to your question? [1] https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#terminology [2] https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html
... View more
07-04-2017
12:16 AM
4 Kudos
Hello @Gabriel Queiroz I hope I understood your use-case properly. How about using EvaluateJsonPath to extract each values into attributes so that ExecuteSQL can refer? A template file for above example flow is available here: https://gist.github.com/ijokarumawak/6d2bbfe48809e036008153f15113ab80
... View more
07-03-2017
01:45 AM
Hello @Ilya Li NiFi stores states as binary representation starting with encoding version. That's why you see invisible characters I believe, and copy-paste will not work [1]. Theoretically, but zk-migrator.sh would be able to copy zookeeper state which is available in NiFi Toolkit [2]. I did a simple experimentation using zk-migrator.sh. I was able to copy state from a processor to another by following steps: 1. Export state from Zk to a JSON file: ./bin/zk-migrator.sh -z localhost:2181 -f /tmp/zk.json -r 2. Copy exported zk.json to a different file, and edit: Changed connectString and servers to 'localhost:2181' as the tool doesn't allow loading data to the same destination. Also removed other paths. So that the file only contains two objects, one containing 'connectString' and the other containing exported state that you want to copy. Change the path with target processor UUID, so that it will be loaded into the target processor: [
{
"connectString": "localhost:2182",
"servers": [
"localhost:2182"
],
"path": "/"
},
{
"path": "/nifi/components/05f810b2-015d-1000-ffff-ffff80b2e488",
"data": [1, 0, ...], "stat": {
"czxid": 552,
"mzxid": 553,
"ctime": 1499042915091,
"mtime": 1499042915154,
"version": 1,
"cversion": 0,
"aversion": 0,
"ephemeralOwner": 0,
"dataLength": 79,
"numChildren": 0,
"pzxid": 552
},
"acls": [
{
"perms": 31,
"id": {
"scheme": "world",
"id": "anyone"
}
}
],
"ephemeralOwner": 0
}
] 3. Load modified zk json: ./bin/zk-migrator.sh -z localhost:2181 -f /tmp/zk-copy.dat -s This way, you can copy state from a processor to another. It may work if those processors use the same structure of state (same keys ... etc). Alternative way is to write a simple Zk client app referring ZookeeperStateProvider's serialize and deserialize methods [1]. [1] https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/zookeeper/ZooKeeperStateProvider.java#L254 [2] https://nifi.apache.org/download.html Hope this helps, Koji
... View more
06-15-2017
12:57 AM
Thanks for trying. I haven't been able to reproduce the Read timed out issue. ListFTP/SFTP, GetFTP ... etc just work fine in my environment. I confirmed that it can download large file about 1GB. There's another user facing the same issue, though.. https://community.hortonworks.com/questions/107715/nifi-130-getftp-read-timed-out.html Did you try other FTP servers, just to confirm if the issue is FTP server specific. For example, a public FTP server such as the one to be used to download apache binaries, http://www.apache.org/dyn/closer.cgi/httpd/binaries/ If those processors work with other FTP servers, then I'd suggest looking at the FTP server's log as well.
... View more
06-14-2017
12:21 AM
Thanks for sharing updates. I didn't find anything suspicious in bootstrap log. The error message indicates there are some network issue between NiFi node and FTP server. filename /edb4tel/data/DMP/TIAGPRSVMPT063246 on remote host 172.30.129.1:21 due to java.net.SocketTimeoutException: Read timed out Can you confirm NiFi node can access to the FTP server port 21? Using telnet command, you can check connectivity: $ telnet 172.30.129.1 21
(If successfully connected, the response from FTP server will be shown)
... View more
06-13-2017
01:35 AM
Hello @Oleksandr Solomko Sorry to hear that you had an issue with FTP processors. Would you elaborate the symptoms so that we can diagnose better? When you said "ftp/sftp processors don't work", do you see a number (usually 1 or 2) at the right top corner of the processor keeps being shown? If so, the processor may be stuck at some point while NiFi scheduler executes it. In this case, NiFi thread dump will be informative to nail down what the processor is doing or where it gets stuck. To take thread dump, please execute following command: ${NIFI_HOME}/bin/nifi.sh dump Then Java stack trace will be logged into logs/nifi-bootstrap.log. It seems the logs you shared previously are ones that were logged when you stopped ListFTP processor (excuse me if I'm wrong). I found this log particularly interesting, this message looks like ListFTP was in the middle of doing something when it's told to stop. 2017-06-12 13:50:46,803 ERROR [Timer-Driven Process Thread-17] o.a.nifi.processors.standard.LisFTP ListFTP[id=0b26dd50-015c-1000-ab83-c3df49136530] ListFTP[id=0b26dd50-015c-1000-ab83-c3df49136530] failed to process due to java.lang.IllegalStateException: Partition is closed; rolling back session: java.lang.IllegalStateException: Partition is closed Thread dump would be helpful to know what is happening. Please run nifi.sh dump while ListFTP is running (and seems not working, before shutting NiFi process down), and share nifi-bootstrap.log with us if possible. Thanks, Koji
... View more