Skip to content

Instantly share code, notes, and snippets.

View pvillard31's full-sized avatar

Pierre Villard pvillard31

View GitHub Profile
@pvillard31
pvillard31 / alluxioV2.xml
Created February 15, 2017 22:13
alluxio_template.xml
<?xml version="1.0" ?>
<template encoding-version="1.0">
<description></description>
<groupId>23e5393e-015a-1000-9be8-df55d535750c</groupId>
<name>alluxioV2</name>
<snippet>
<connections>
<id>015a1001-51f2-13a1-0000-000000000000</id>
<parentGroupId>23e5393e-015a-1000-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<?xml version="1.0" ?>
<template encoding-version="1.0">
<description></description>
<groupId>d9025594-015a-1000-5d0d-c845d3f5a438</groupId>
<name>routeOnFirstLine</name>
<snippet>
<connections>
<id>d902a3f9-015a-1000-0000-000000000000</id>
<parentGroupId>d9025594-015a-1000-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<?xml version="1.0" ?>
<template encoding-version="1.1">
<description></description>
<groupId>aefa0f78-015d-1000-d4c9-279516666f10</groupId>
<name>ListenTCPRecord</name>
<snippet>
<connections>
<id>fb63d048-590a-37c5-0000-000000000000</id>
<parentGroupId>b7bd14b5-3f34-3cb5-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.io.IOUtils
import java.nio.charset.*
import org.json.JSONObject;
import org.json.XML;
def flowFile = session.get()
if (!flowFile) return
flowFile = session.write(flowFile,
{ inputStream, outputStream ->
<?xml version="1.0" ?>
<template encoding-version="1.1">
<description></description>
<groupId>aa246331-015a-1000-fac3-b72f7046408b</groupId>
<name>druid</name>
<snippet>
<processGroups>
<id>0452a6a9-3b2d-3d8c-0000-000000000000</id>
<parentGroupId>6d748a93-8d2f-37d2-0000-000000000000</parentGroupId>
<position>
{
"type" : "record",
"name" : "bulletin",
"namespace" : "bulletin",
"fields" : [
{ "name" : "objectId", "type" : "string"},
{ "name" : "platform", "type" : "string"},
{ "name" : "bulletinId", "type" : "long"},
{ "name" : "bulletinCategory", "type" : "string"},
{ "name" : "bulletinGroupId", "type" : "string"},
{
"type" : "record",
"name" : "status",
"namespace" : "status",
"fields" : [
// common fields
{ "name" : "statusId", "type" : "string"},
{ "name" : "timestampMillis", "type" : "long"},
{ "name" : "timestamp", "type" : "string"},
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description></description>
<groupId>2e083aef-0162-1000-80bc-8c6bbfc00ca8</groupId>
<name>wait-notify</name>
<snippet>
<processGroups>
<id>582ee2ef-8a17-3830-0000-000000000000</id>
<parentGroupId>16e377d4-8369-3464-0000-000000000000</parentGroupId>
<position>
<customers>
<customer customer_id="1" name="John Doe">
<addresses>
<address type="home" value="1 Apache NiFi street, Nifiville" />
<address type="work" value="10 MiNiFi avenue, Nifiville" />
</addresses>
<accounts>
<account account_id="1" shortname="perso" balance="1234.56" />
<account account_id="2" shortname="joint" balance="2345.67">
<transactions>