ApacheNifi处理器无效是由哪个属性引起的反馈(一个通用的问题)。
创始人
2024-09-06 06:30:30
0
  1. 首先,您可以通过检查Apache Nifi的日志来查找详细信息。在Nifi UI中,转到'安全”选项卡并单击'查看日志”链接。此链接将带您进入Nifi的日志视图。您可以搜索'ERROR”关键字以及与无效处理器相关的任何其他关键字以查找详细信息。

  2. 您还可以尝试删除最近更改的处理器属性。首先转到无效处理器的配置页面,然后单击'更改历史记录”。在此页面上,您可以查看处理器属性的更改历史记录。您可以选择删除最近更改的属性,然后重试运行处理器。

以下是一个示例更新Nifi的处理器代码,以实现更好的属性验证和错误处理。这个示例展示了在一些常见用例中如何验证并处理属性错误。

    @Override
    public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) {
        super.onPropertyModified(descriptor, oldValue, newValue);

        if (descriptor.equals(MY_PROPERTY)) {
            try {
                // Attempt to parse the new property value to ensure it is valid
                final Integer value = Integer.parseInt(newValue);
                // Handle any other validation criteria based on the new property value here

            } catch (NumberFormatException nfe) {
                // If the new property value is not a valid integer, set the processor to invalid state 
                getLogger().error("New property value is not a valid integer: " + newValue, nfe);
                setErrorState("New property value is not a valid integer: " + newValue, nfe);
            }
        }
    }

    @Override
    protected Collection customValidate(final ValidationContext context) {
        final List results = new ArrayList<>();

        // Verify that the processor properties are valid here based on any additional validation criteria

        if (context.getProperty(MY_PROPERTY).isSet()) {
            try {
                // Attempt to parse the configured property value to ensure it is valid
                final Integer value = context.getProperty(MY_PROPERTY).asInteger();
                // Handle any other validation criteria based on the configured property value here

            } catch (NumberFormatException nfe) {
                // If the configured property value is not a valid integer, add a validation error
                results.add(new ValidationResult.Builder()
                        .subject(MY_PROPERTY.getName())
                        .valid(false)
                        .explanation("Configured property value

相关内容

热门资讯

记者揭秘!智星菠萝辅助(透视辅... 记者揭秘!智星菠萝辅助(透视辅助)拱趴大菠萝辅助神器,扑克教程(有挂细节);模式供您选择,了解更新找...
一分钟揭秘!约局吧能能开挂(透... 一分钟揭秘!约局吧能能开挂(透视辅助)hhpoker辅助靠谱,2024新版教程(有挂教学);约局吧能...
透视辅助!wepoker模拟器... 透视辅助!wepoker模拟器哪个好用(脚本)hhpoker辅助挂是真的,科技教程(有挂技巧);囊括...
透视代打!hhpkoer辅助器... 透视代打!hhpkoer辅助器视频(辅助挂)pokemmo脚本辅助,2024新版教程(有挂教程);风...
透视了解!约局吧德州真的有透视... 透视了解!约局吧德州真的有透视挂(透视脚本)德州局HHpoker透视脚本,必胜教程(有挂分析);亲,...
六分钟了解!wepoker挂底... 六分钟了解!wepoker挂底牌(透视)德普之星开辅助,详细教程(有挂解密);德普之星开辅助是一种具...
9分钟了解!wpk私人辅助(透... 9分钟了解!wpk私人辅助(透视)hhpoker德州透视,插件教程(有挂教学);风靡全球的特色经典游...
推荐一款!wepoker究竟有... 推荐一款!wepoker究竟有透视(脚本)哈糖大菠萝开挂,介绍教程(有挂技术);囊括全国各种wepo...
每日必备!wepoker有人用... 每日必备!wepoker有人用过(脚本)wpk有那种辅助,线上教程(有挂规律);wepoker有人用...
玩家必备教程!wejoker私... 玩家必备教程!wejoker私人辅助软件(脚本)哈糖大菠萝可以开挂,可靠技巧(有挂神器)申哈糖大菠萝...