如何检查我的hadoop是否以伪分布式模式运行?(How to check if my hadoop is running in pseudo distributed mode?)
我不久前安装了hadoop,但不知何故我忘记了是否安装了伪分布式模式。我该如何检查它? 而我的hadoop正在运行
I installed hadoop quite a while ago but I somehow have forgotten if I installed in pseudo distributed mode or not.How can I check it? while my hadoop is running
原文:https://stackoverflow.com/questions/18294207
最满意答案
else if
这样的话,可以拆分else if
,你可以在if
之前完成赋值。if (!strcmp(filename, "-")) cpio_list = stdin; else { cpio_list = fopen(filename,"r") if (!cpio_list) { ... ... } }
但是您可能需要重构一个函数,以便您可以在
else
之前return
。就个人而言,只要加了括号(这意味着程序员的意思是它,它非常明显,并且抑制了编译器警告),偶尔的if-condition条件并不是什么大不了的事情。
Split the
else if
so you can do the assignment before theif
.if (!strcmp(filename, "-")) cpio_list = stdin; else { cpio_list = fopen(filename,"r") if (!cpio_list) { ... ... } }
But you might want to refactor out a function so that you can just
return
before theelse
.Personally, I don't think it's a big deal to have an occasional assignment-in-if-condition as long as it is parenthesized (which means the programmer meant it, it stands out as obvious, and suppresses compiler warnings).