I use libhdfs in my c++ program, when I use hdfsRename to mv a file from old path to new path. the new path is not exist, and the old path is exist.
But when I run the program, I get an error, the function hdfsRename just return -1 without any tips or exception.
I use gdb to debug the program, but I can't step into the jvm thread to know what happened.
So anyone can tell me, When the hdfsRename will return -1, and is there a way to debug into jvm?
Asked
Active
Viewed 31 times
0

zawdd
- 311
- 1
- 3
- 12
-
I use hadoop client in shell, try to mv the file, but also failed with a java.io.IOException: at org.apache.hadoop.fs.FsShell.rename(FsShell.java:1060) – zawdd Apr 26 '19 at 07:05
-
1I'd suspect the reason for the error is that the new directory doesn't exist. You have to create it before moving a file there. – πάντα ῥεῖ Apr 26 '19 at 07:08
-
@πάνταῥεῖ you are right, thank you! – zawdd Apr 26 '19 at 07:26
-
I'm not familiar with libhdfs, but after receiving an error result you might call `perror()` to get more information of what went wrong. – πάντα ῥεῖ Apr 26 '19 at 07:28