Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Nifi:can';是否在customProcessor中导入getFileSystem?_Java_Hadoop_Apache Nifi - Fatal编程技术网

Java Nifi:can';是否在customProcessor中导入getFileSystem?

Java Nifi:can';是否在customProcessor中导入getFileSystem?,java,hadoop,apache-nifi,Java,Hadoop,Apache Nifi,我想使用getfilesystemm()拉入任何比我们拥有的时间戳更新的文件,但我无法导入它(我的意思是getfilesystemm()),我有以下代码: final FileSystem hdfs = getFileSystem(); final boolean recursive = context.getProperty(RECURSE_SUBDIRS).asBoolean(); final Set<FileStatus> statuses; try { final

我想使用
getfilesystemm()
拉入任何比我们拥有的时间戳更新的文件,但我无法导入它(我的意思是
getfilesystemm()
),我有以下代码:

final FileSystem hdfs = getFileSystem();
final boolean recursive = context.getProperty(RECURSE_SUBDIRS).asBoolean();

final Set<FileStatus> statuses;
try {
    final Path rootPath = new Path(directory);
    statuses = getStatuses(rootPath, recursive, hdfs,
            createPathFilter(context));
    getLogger().debug("Found a total of {} files in HDFS", new Object[]
            {statuses.size()});
} catch (final IOException | IllegalArgumentException e) {
    getLogger().error("Failed to perform listing of HDFS due to {}", new
            Object[]{e});
    return;
}
final FileSystem hdfs=getFileSystem();
final boolean recursive=context.getProperty(RECURSE_SUBDIRS).asBoolean();
最终设定状态;
试一试{
最终路径rootPath=新路径(目录);
Status=GetStatus(根路径、递归、hdfs、,
createPathFilter(上下文));
getLogger().debug(“在HDFS中总共找到了{}个文件”,新对象[]
{statuses.size()});
}捕获(最终IOException | IllegalArgumentException e){
getLogger().error(“由于{}而无法执行HDF列表”,新建
对象[]{e});
返回;
}
以下是我的pom文件依赖项:

 <dependencies>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-utils</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-mock</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.5</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/log4j/log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-hdfs-processors</artifactId>
        <version>0.0.2-incubating</version>
    </dependency>

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-common</artifactId>
        <version>3.0.0-beta1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-properties</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-distributed-cache-client-service-api</artifactId>
    </dependency>

      <dependency>
            <groupId>org.apache.nifi</groupId>
            <artifactId>nifi-standard-nar</artifactId>
            <type>nar</type>
        </dependency>

</dependencies>

org.apache.nifi
nifi api
org.apache.nifi
nifi-utils
org.apache.nifi
nifi模拟
测试
org.slf4j
slf4j简单
测试
朱尼特
朱尼特
测试
org.apache.commons
commons-lang3
3.5
log4j
log4j
1.2.17
org.apache.nifi
nifi hdfs处理器
0.0.2-孵化
org.apache.hadoop
hadoop通用
3.0.0-beta1
org.apache.nifi
nifi特性
org.apache.nifi
nifi分布式缓存客户端服务api
org.apache.nifi
nifi标准nar
纳尔

另外,我想知道是否可以使用正则表达式来帮助我计算以相同字符串开头的文件数量?

您不希望在自定义处理器中包含nifi hdfs处理器作为依赖项。相反,您可能希望将nifi hadoop库nar设置为自定义处理器nar的父nar。以检查为例。

您不希望将nifi hdfs处理器作为依赖项包含在自定义处理器中。相反,您可能希望将nifi hadoop库nar设置为自定义处理器nar的父nar。以检查为例。

我已经有了父NAR。在这种情况下,我应该做什么?您使用的是哪种父NAR?您只能有一个父NAR,因此可能需要将逻辑拆分为单独的NAR,或者尽可能使用现有处理器。me sde 1.0-SNAPSHOT将逻辑拆分为单独的NAR是什么意思?您有自己的自定义NAR作为父级?那个孩子有父母吗?如果没有,您可以添加Hadoop库NAR作为其父级。我已经有了父级NAR。在这种情况下,我应该做什么?您使用的是哪一个父级NAR?您只能有一个父NAR,因此可能需要将逻辑拆分为单独的NAR,或者尽可能使用现有处理器。me sde 1.0-SNAPSHOT将逻辑拆分为单独的NAR是什么意思?您有自己的自定义NAR作为父级?那个孩子有父母吗?如果没有,您可以添加Hadoop库作为其父库