如题,按照官方例子
env9.registerCachedFile("hdfs://xxx/key", "key");
...
.map(
new RichMapFunction<String, String>() {
@Override
public String map(String value) throws Exception {
return value;
}
@Override
public void open(Configuration parameters) {
DistributedCache distributedCache =
getRuntimeContext().getDistributedCache().getFile("key");
System.out.println(distributedCache);
}
});
...
之前1.5版本没有任何问题,相同的代码更换到1.7.1版本之后报如下错误:
java.lang.IllegalArgumentException: File with name 'key' is not available. Did
you forget to register the file?
有谁遇到相同的问题或对这块代码有研究的吗?