HDDS-971. ContainerDataConstructor throws exception on QUASI_CLOSED and UNHEALTHY container state. Contributed by Lokesh Jain.
This commit is contained in:
parent
54b11de2c0
commit
96ea464aaa
@ -256,21 +256,8 @@ public Object construct(Node node) {
|
||||
kvData.setMetadata(meta);
|
||||
kvData.setChecksum((String) nodes.get(OzoneConsts.CHECKSUM));
|
||||
String state = (String) nodes.get(OzoneConsts.STATE);
|
||||
switch (state) {
|
||||
case "OPEN":
|
||||
kvData.setState(ContainerProtos.ContainerDataProto.State.OPEN);
|
||||
break;
|
||||
case "CLOSING":
|
||||
kvData.setState(ContainerProtos.ContainerDataProto.State.CLOSING);
|
||||
break;
|
||||
case "CLOSED":
|
||||
kvData.setState(ContainerProtos.ContainerDataProto.State.CLOSED);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected " +
|
||||
"ContainerLifeCycleState " + state + " for the containerId " +
|
||||
nodes.get(OzoneConsts.CONTAINER_ID));
|
||||
}
|
||||
kvData
|
||||
.setState(ContainerProtos.ContainerDataProto.State.valueOf(state));
|
||||
return kvData;
|
||||
}
|
||||
}
|
||||
|
@ -96,8 +96,8 @@ public void run() {
|
||||
try {
|
||||
readVolume(hddsVolumeDir);
|
||||
} catch (RuntimeException ex) {
|
||||
LOG.info("Caught an Run time exception during reading container files" +
|
||||
" from Volume {}", hddsVolumeDir);
|
||||
LOG.error("Caught a Run time exception during reading container files" +
|
||||
" from Volume {} {}", hddsVolumeDir, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user