【发布时间】:2016-07-01 06:12:14
【问题描述】:
我必须拥有来自 Clojure 的子目录的 HDFS 文件夹大小。如何在 Clojure 中使用 getContentSummary 和 getSpaceConsumed。我知道如何在 Java 中做到这一点。
FileSystem fs = FileSystem.get(config);
Path current = new Path(path);
double size= fs.getContentSummary(current).getSpaceConsumed();
已经设置了配置并且路径被传递到这个函数中。所以 size 现在有作为路径提到的目录的大小。这是在 Java 中。我想知道如何在 Clojure 中做到这一点。
谢谢。
【问题讨论】:
-
请添加更多信息和一些代码。向我们展示您已经尝试过的内容
-
完成。我想知道如何在 Clojure 中实现我的第三行代码。
-
你的意思是:
(-> (.getContentSummary current) .getSpaceConsumed)
标签: java clojure hdfs clojurescript clojure-java-interop