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.setMetadata(meta);
|
||||||
kvData.setChecksum((String) nodes.get(OzoneConsts.CHECKSUM));
|
kvData.setChecksum((String) nodes.get(OzoneConsts.CHECKSUM));
|
||||||
String state = (String) nodes.get(OzoneConsts.STATE);
|
String state = (String) nodes.get(OzoneConsts.STATE);
|
||||||
switch (state) {
|
kvData
|
||||||
case "OPEN":
|
.setState(ContainerProtos.ContainerDataProto.State.valueOf(state));
|
||||||
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));
|
|
||||||
}
|
|
||||||
return kvData;
|
return kvData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,8 +96,8 @@ public void run() {
|
|||||||
try {
|
try {
|
||||||
readVolume(hddsVolumeDir);
|
readVolume(hddsVolumeDir);
|
||||||
} catch (RuntimeException ex) {
|
} catch (RuntimeException ex) {
|
||||||
LOG.info("Caught an Run time exception during reading container files" +
|
LOG.error("Caught a Run time exception during reading container files" +
|
||||||
" from Volume {}", hddsVolumeDir);
|
" from Volume {} {}", hddsVolumeDir, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user