文章分类 -  nifi

nifi分类
摘要:在下载页面会有2种下载分类,一个是Binaries,一个是source,一般开放原代码软件都会有两个版本发布: Source Distribution 和 Binary Distribution ,二者有啥区别?Source 是源代码版,你需要自己编译成可执行软件。 Binaries是可执行版,直接 阅读全文
posted @ 2022-10-21 17:31 木章 阅读(228) 评论(0) 推荐(0) 编辑
摘要:var StreamCallback = Java.type("org.apache.nifi.processor.io.StreamCallback") var IOUtils = Java.type("org.apache.commons.io.IOUtils"); var StandardCh 阅读全文
posted @ 2021-08-13 15:25 木章 阅读(79) 评论(0) 推荐(0) 编辑
摘要:假设属性abc的值为xyz。 1 ${abc} => xyz 2 $${abc} => ${abc} 3 $$${abc} => $xyz 4 $$$${abc} => $${abc} 5 $$$$${abc} => $$xyz 也就是从左往右两个$并一个$且以字符串输出,如果$和{}匹配才解析。 阅读全文
posted @ 2021-07-28 15:25 木章 阅读(226) 评论(0) 推荐(0) 编辑
摘要:创建一个新的FlowFile 1 var flowFile = session.create(); 从父FlowFile创建新的FlowFile 1 var newFlowFile = session.create(flowFile); 向流文件添加属性 1 flowFile = session.p 阅读全文
posted @ 2021-07-28 14:19 木章 阅读(111) 评论(0) 推荐(0) 编辑
摘要:处理数据数据,变成结果文件生成在文件夹下 1 import os 2 import json 3 def writeResult(path,value): 4 path = path + r'/result.json' 5 fp = open(path,'w') 6 fp.write(value) 阅读全文
posted @ 2021-07-22 14:43 木章 阅读(63) 评论(0) 推荐(0) 编辑
摘要:添加一个属性 1 var flowFile = session.get(); 2 if(flowFile != null) { 3 try { 4 var name = flowFile.getAttribute('添加属性名称') 5 var value = flowFile.getAttribu 阅读全文
posted @ 2021-07-22 14:41 木章 阅读(30) 评论(0) 推荐(0) 编辑
摘要:判断gp处理状态 获取内容的jobId 1 var InputStreamCallback = Java.type("org.apache.nifi.processor.io.InputStreamCallback"); 2 var OutputStreamCallback = Java.type( 阅读全文
posted @ 2021-07-22 14:40 木章 阅读(44) 评论(0) 推荐(0) 编辑
摘要:读取文件内容,转换json,判断完成状态 做判断出口,通过走成功,不通过走失败 1 import os 2 import json 3 def readState(path): 4 path = path + r'/runstatus.txt' 5 fp = open(path, 'r') 6 re 阅读全文
posted @ 2021-07-22 14:32 木章 阅读(73) 评论(0) 推荐(0) 编辑
摘要:图表数据输出 1 var InputStreamCallback = Java.type("org.apache.nifi.processor.io.InputStreamCallback"); 2 var OutputStreamCallback = Java.type("org.apache.n 阅读全文
posted @ 2021-07-22 14:31 木章 阅读(68) 评论(0) 推荐(0) 编辑
摘要:遍历属性json的数据 1 var flowFile = session.get(); 2 if(flowFile != null) { 3 try { 4 var attrName = flowFile.getAttribute('循环属性名') 5 var listStr = flowFile. 阅读全文
posted @ 2021-07-22 14:30 木章 阅读(60) 评论(0) 推荐(0) 编辑
摘要:属性数组遍历处理 1 var flowFile = session.get(); 2 if(flowFile != null) { 3 try { 4 var hasStr = flowFile.getAttribute('包含的字符') 5 var noStr = flowFile.getAttr 阅读全文
posted @ 2021-07-22 14:28 木章 阅读(73) 评论(0) 推荐(0) 编辑
摘要:文件夹文件列表 1 import os 2 import json 3 try: 4 flowFile = session.get() 5 filePath = flowFile.getAttribute('文件夹路径'.decode('utf8')) 6 hasStr = flowFile.get 阅读全文
posted @ 2021-07-22 14:27 木章 阅读(53) 评论(0) 推荐(0) 编辑
摘要:创建本地文件目录 1 import os 2 import uuid 3 def mkdir(path): 4 folder = os.path.exists(path) 5 if not folder: 6 os.makedirs(path) 7 try: 8 flowFile = session 阅读全文
posted @ 2021-07-22 14:26 木章 阅读(41) 评论(0) 推荐(0) 编辑
摘要:路径地址转换 1 var flowFile = session.get(); 2 if(flowFile != null) { 3 try { 4 var path = flowFile.getAttribute('要转换路径') 5 var attrName = flowFile.getAttri 阅读全文
posted @ 2021-07-22 14:25 木章 阅读(39) 评论(0) 推荐(0) 编辑
摘要:删除文件夹 1 import os 2 import shutil 3 def rmdir(path): 4 folder = os.path.exists(path) 5 if folder: 6 os.rmdir(path) 7 def shutildir(path): 8 folder = o 阅读全文
posted @ 2021-07-22 14:23 木章 阅读(61) 评论(0) 推荐(0) 编辑
摘要:新建文件夹 1 import os 2 def mkdir(path): 3 folder = os.path.exists(path) 4 if not folder: 5 os.makedirs(path) 6 try: 7 flowFile = session.get() 8 f1 = flo 阅读全文
posted @ 2021-07-22 14:22 木章 阅读(35) 评论(0) 推荐(0) 编辑
摘要:指定属性名,将流内容存储 1 var StreamCallback = Java.type("org.apache.nifi.processor.io.StreamCallback") 2 var IOUtils = Java.type("org.apache.commons.io.IOUtils" 阅读全文
posted @ 2021-07-22 14:21 木章 阅读(47) 评论(0) 推荐(0) 编辑
摘要:指定延时时间执行 1 import time 2 try: 3 flowFile = session.get() 4 delayTime = flowFile.getAttribute('delayTime') 5 time.sleep(int(delayTime)) 6 session.trans 阅读全文
posted @ 2021-07-22 14:20 木章 阅读(40) 评论(0) 推荐(0) 编辑
摘要:把所有属性信息打印到流内容,过滤排除一些默认的服务信息属性 1 var StreamCallback = Java.type("org.apache.nifi.processor.io.StreamCallback") 2 var IOUtils = Java.type("org.apache.co 阅读全文
posted @ 2021-07-22 14:17 木章 阅读(55) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示