HDFS-16704. Datanode return empty response instead of NPE for GetVolumeInfo during restarting (#4661). Contributed by ZanderXu.
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org> Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
parent
86cc96c493
commit
b1d4af2492
@ -3628,7 +3628,10 @@ public String getBPServiceActorInfo() {
|
|||||||
*/
|
*/
|
||||||
@Override // DataNodeMXBean
|
@Override // DataNodeMXBean
|
||||||
public String getVolumeInfo() {
|
public String getVolumeInfo() {
|
||||||
Preconditions.checkNotNull(data, "Storage not yet initialized");
|
if (data == null) {
|
||||||
|
LOG.debug("Storage not yet initialized.");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return JSON.toString(data.getVolumeInfoMap());
|
return JSON.toString(data.getVolumeInfoMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user