Skip to content

Instantly share code, notes, and snippets.

View ijokarumawak's full-sized avatar
🎯
Focusing

Koji Kawamura ijokarumawak

🎯
Focusing
View GitHub Profile
@ijokarumawak
ijokarumawak / NIFI-5826_Fix_backslash_escaping.xml
Created December 5, 2018 06:04
NiFi flow template to test NIFI-5826 changes
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description></description>
<groupId>7bf539f4-0167-1000-97f1-3a91b5de75c4</groupId>
<name>NIFI-5826 Fix backslash escaping</name>
<snippet>
<processGroups>
<id>cf87c2e1-c49b-303b-0000-000000000000</id>
<parentGroupId>1e08db49-ce5e-30c7-0000-000000000000</parentGroupId>
<position>
@ijokarumawak
ijokarumawak / ListFile.java
Created November 30, 2018 03:34
Simple Java code to list files using NIO while waiting user input to proceed. This can be useful to see how it makes OS/native API calls with strace command.
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Files;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ijokarumawak
ijokarumawak / Merge_XML_Records.xml
Created November 29, 2018 01:27
A NiFi example template to illustrate how to merge multiple XML files.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description></description>
<groupId>39379f66-0167-1000-9951-3cf7c004e310</groupId>
<name>Merge XML Records</name>
<snippet>
<controllerServices>
<id>36c4d83a-ff47-38e2-0000-000000000000</id>
<parentGroupId>376efa9a-48fc-3e3d-0000-000000000000</parentGroupId>
<bundle>
@ijokarumawak
ijokarumawak / AddTimestamp.xml
Created November 19, 2018 06:13
Example NiFi template to add new CSV timestamp column by UpdateRecord
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description></description>
<groupId>29cd7683-0167-1000-0886-c9dc91c022a5</groupId>
<name>AddTimestamp</name>
<snippet>
<connections>
<id>09785868-682a-3058-0000-000000000000</id>
<parentGroupId>818236f9-e91f-324b-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
@ijokarumawak
ijokarumawak / 0.InvokeHTTP_Attributes.md
Last active February 15, 2022 11:00
This NiFi flow template illustrates how incoming FlowFile attributes are carried to the InvokeHTTP output FlowFile.

This NiFi flow template illustrates how incoming FlowFile attributes are carried to the InvokeHTTP output FlowFile.

@ijokarumawak
ijokarumawak / 00_README.md
Last active February 13, 2019 03:18
NiFi example to ingest a set of files only when a complete set of files is ready.

This example flow can be used to process files with following requirements:

  • A group of files can only be processed when every files for a specific group is ready

  • Each filename has groupId (e.g. 123_456) and a type name (e.g. ab/cd/ef)

  • Example set of files for group '123_456'

    • file_123_456_ab.ex1
    • file_123_456_cd.ex1
    • file_123_456_ef.ex1
  • file_123_456.ex2

@ijokarumawak
ijokarumawak / 0.README.md
Created May 17, 2018 02:23
Docker example to run Dante SOCKS proxy server.

How to use Dante SOCKS proxy server

Create sockd.conf file locally on the docker host machine and map it with -v option of docker run.

Run socks server

docker run -d -p 1080:1080 -v /etc/sockd.conf:/etc/sockd.conf --name socks-server vimagick/dante

Add user

@ijokarumawak
ijokarumawak / 0.README.md
Last active May 11, 2018 07:23
NiFi Template to test NIFI-4637: Add support for HBase visibility labels to HBase processors and controller services

Execute following commands from hbase shell to setup a test table and visibility labels. HBase needs to be configured to enable visibility label, too.

create 't1', {NAME => 'f1'}
add_labels [ 'admin', 'service', 'developer', 'test' ]
grant 'nifi', 'RW', 't1'
@ijokarumawak
ijokarumawak / NIFI-5090.xml
Created April 18, 2018 07:14
A NiFi flow template to test NIFI-5090 FetchFTP and FetchSFTP should be able to dynamically create the target directory to move files to if not found
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description></description>
<groupId>d1fdab79-0162-1000-ac9f-bef682631714</groupId>
<name>NIFI-5090</name>
<snippet>
<processGroups>
<id>096d130c-0d82-3e30-0000-000000000000</id>
<parentGroupId>8f9ca121-e577-3715-0000-000000000000</parentGroupId>
<position>
@ijokarumawak
ijokarumawak / 01-flow-image.png
Last active August 15, 2021 15:52
NiFi, A workaround if sending large data via S2S does not work due to taking more than the default 'idle connection expiration' (30s)
01-flow-image.png