简体   繁体   English

如何在NiFi UI中为ExecuteScript处理器启用“查看状态”选项?

[英]How to enable “View State” option for ExecuteScript processor in NiFi UI?

I am using NiFi ExecuteScript with python. 我正在使用带有python的NiFi ExecuteScript In the python script I add/modify state of the processor 在python脚本中,我添加/修改处理器的状态

stateManager = context.getStateManager()
stateManager.setState(newmap, Scope.LOCAL)

Is there anyway I can view/clear the processor state in NiFi web ui? 无论如何我可以在NiFi web ui中查看/清除处理器状态吗?

Some other processors like TailFile give you this option via "view state" when you right click on the processor but ExecuteScript right click does not give you this option 当您右键单击处理器时,其他一些处理器(如TailFile)会通过“查看状态”为您提供此选项,但右键单击ExecuteScript不会为您提供此选项

Most processors that store state have an annotation on them @Stateful which indicates to the framework that they store state, and is used to enabled features such as the "View State". 大多数存储状态的处理器都有一个注释@Stateful,它向框架指示它们存储状态,并用于启用诸如“视图状态”之类的功能。

Since ExecuteScript doesn't store state itself it doesn't currently have this annotation, but since scripts can access the state manager and store state we should add the annotation so that View State works. 由于ExecuteScript本身不存储状态,因此它当前没有此注释,但由于脚本可以访问状态管理器和存储状态,因此我们应该添加注释以便View State工作。 I created this JIRA: 我创建了这个JIRA:

https://issues.apache.org/jira/browse/NIFI-2885 https://issues.apache.org/jira/browse/NIFI-2885

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM