이것은 가장 이상한 일입니다.cat은 사용할 수 있지만 Hadoop DFS 파일은 사용할 수 없습니다.
[[email protected] hadoop-0.20.2]$ bin/hadoop fs -ls /users/jchen/20100714T192949^AS311.data | head
ls: Cannot access /users/jchen/20100714T192949^AS311.data: No such file or directory
가 frack 지금 무슨 일이 벌어지고있는 거지 : 내가 특별히 파일입니다 아닙니다
[[email protected] hadoop-0.20.2]$ bin/hadoop fs -ls /users/jchen/
Found 3 items
-rw-r--r-- 1 jchen supergroup 26553445 2010-07-14 21:10 /users/jchen/20100714T192827^AS17.data
-rw-r--r-- 1 jchen supergroup 461957962 2010-07-14 21:10 /users/jchen/20100714T192857^AS1.data
-rw-r--r-- 1 jchen supergroup 14026972 2010-07-14 21:10 /users/jchen/20100714T192949^AS311.data
[[email protected] hadoop-0.20.2]$ bin/hadoop fs -cat /users/jchen/20100714T192949^AS311.data | head
SOME DATA
: 그래서 이러한 파일과 고양이를 볼 수 있습니까? 내가 생각할 수있는 유일한 것은 내가 이러한 파일을 게시 할 수 org.apache.hadoop.fs.FileSystem에서 사용자 지정 방법을 사용한다는 것입니다 :
public boolean writeStreamToFile(boolean overwrite,
InputStream src, Path dst)
throws IOException {
Configuration conf = getConf();
return FileUtil.writeStream(src, this, dst, overwrite, conf);
}
//which calls this static method in org.apache.hadoop.fs.FileUtil:
public static boolean writeStream(InputStream src,
FileSystem dstFS, Path dst,
boolean overwrite,
Configuration conf) throws IOException {
dst = checkDest(dst.getName(), dstFS, dst, overwrite);
OutputStream out=null;
try{
System.out.println("Started file creation");
out = dstFS.create(dst, overwrite);
System.out.println("completed file creation. starting stream copy");
IOUtils.copyBytes(src, out, conf, true);
System.out.println("completed stream copy.");
} catch (IOException e) {
IOUtils.closeStream(out);
IOUtils.closeStream(src);
throw e;
}
return true;
}
내가 여기에 총 손실 가지입니다.
파일 이름에서'^'를 이스케이프 처리해야합니까? –
Grrrr ... 예. 좋은 전화입니다. 나는 지금 분명히 근처의 컴퓨터에 있지 않아야한다. 내가 할 수있는 더 이상의 피해를 누가 알 겠어? 내가 어떻게 도망 갈 수 있는지 아세요? 나는 시도했지만 \ 작동하지 않았다. 답변으로 게시하면 위로 올라가 받아 들일 것입니다. 감사합니다. 지엔 – Jieren