Groovy 在代码中使用flowfiles默认属性

Groovy 在代码中使用flowfiles默认属性,groovy,apache-nifi,Groovy,Apache Nifi,我想在groovy代码中使用filesize,因此我在其中添加了updateAttribute,其中包含这样的表达式${filesize:toNumber()},我想在groovy代码中使用此属性,如下所示: def size=flowFile.getAttribute('filesize'); int value = size as Integer; if(value.div(4)<=1) def size=flowFile.getAttribute('filesize'); int值

我想在groovy代码中使用filesize,因此我在其中添加了updateAttribute,其中包含这样的表达式
${filesize:toNumber()}
,我想在groovy代码中使用此属性,如下所示:

def size=flowFile.getAttribute('filesize');
int value = size as Integer;
if(value.div(4)<=1)
def size=flowFile.getAttribute('filesize');
int值=整数大小;

如果(value.div(4)Apache NiFi的内置流文件属性(以字节为单位的内容长度)为
fileSize
(区分大小写)。

Apache NiFi的内置流文件属性(以字节为单位的内容长度)为
fileSize
(区分大小写)。

是,
会话.get(1)
将返回一个流文件,但在
列表中(来自)是,
session.get(1)
将返回单个流文件,但在
列表中(从)我可以检查filesize是否以字节为单位,如果不以字节为单位,则将其转换为字节吗?我如何检查这一点?
filesize
由NiFi框架内部维护。它始终以字节为单位。我可以检查filesize是否以字节为单位,如果不以字节为单位,则将其转换为字节吗?我如何检查这一点?
filesize
是内部维护的通过NiFi框架。它总是以字节为单位。