Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrcsparker/nifi-r-bundle
R Processor for NIFI
https://github.com/mrcsparker/nifi-r-bundle
Last synced: about 1 month ago
JSON representation
R Processor for NIFI
- Host: GitHub
- URL: https://github.com/mrcsparker/nifi-r-bundle
- Owner: mrcsparker
- Created: 2016-09-14T04:45:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-20T02:27:56.000Z (over 6 years ago)
- Last Synced: 2024-02-12T23:15:01.246Z (5 months ago)
- Language: Java
- Size: 11.7 KB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Lists
- awesome-nifi - mrcsparker/nifi-r-bundle - R Processor for NIFI (Processors and Bundles / Mailing List Best Of)
- awesome-nifi - mrcsparker/nifi-r-bundle - R Processor for NIFI (Processors and Bundles / Mailing List Best Of)
- awesome-nifi - mrcsparker/nifi-r-bundle - R Processor for NIFI (Processors and Bundles / Mailing List Best Of)
README
# nifi-r-bundle
**Work in progress**
R integration for [Apache NIFI](https://nifi.apache.org).
This library uses the [rJava/JRI](https://cran.r-project.org/web/packages/rJava/index.html) interface for fast access to R from NIFI. It allows you to use R to write your NIFI processing code.
## Sample code
In order to get it to work, this can't act like a standard NIFI processor. It implements a callback that gives you access to 3 interfaces:
1. inputStream
2. outputStream
3. logThis actually works out quite well. You only have to care about reading, writing, and (optionally) logging.
```
ioutils <- .jnew("org.apache.commons.io.IOUtils")input <- ioutils$toString(inputStream)
ioutils$write("[{\"name\":\"foo\"},{\"value\":\"bar\"}]", outputStream)
```## Installing
This document is a work in progress, so this is just to get you started.
You are going to need NIFI, R, Java, and rJava installed.
To run the code, you are going to have to set:
1. R_HOME as an environment variable to point to your R install
2. -Djava.library.path or your CLASSPATH to point to the rJava jar files.
3. Install rJava from CRAN## Status
I just wrote this code and it works here, on my machine, at my home. Still lots of work to do, but it works for me right now at this moment.