Hadoop Filesystem shell returning -1 following successful execution

时间:2015-07-29 00:28:06

标签: java hadoop ssh hdfs

I'm trying to create a directory using the "hdfs dfs -mkdir /user/19491/testfolder" with the following code:

formattedSeconds =(double) miliseconds / 1000;

After running this code, the folder is created but the exit status returned is -1. Which according to this link suggests a error. Why is this so? The folder is created so shouldn't it return 0?

1 个答案:

答案 0 :(得分:0)

(假设您正在使用jsch)getExitStatus在命令尚未完成时返回-1。

http://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/Channel.html#getExitStatus()

我认为在hdfs命令完成之前会稍微调用该函数。此example会一直等到频道关闭。