sumitagrawl commented on code in PR #4995:
URL: https://github.com/apache/ozone/pull/4995#discussion_r1245470739
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java:
##########
@@ -87,20 +88,46 @@ public KeyValueContainerCheck(String metadataPath,
ConfigurationSource conf,
*
* @return true : integrity checks pass, false : otherwise.
*/
- public boolean fastCheck() {
+ public ScanResult fastCheck() {
LOG.debug("Running basic checks for container {};", containerID);
- boolean valid = false;
+
+ // Container directory should exist.
+ File containerDir = new File(metadataPath).getParentFile();
+ if (!containerDir.exists()) {
+ return ScanResult.unhealthy(ScanResult.FailureType.MISSING_CONTAINER_DIR,
+ containerDir, new FileNotFoundException("Container directory " +
+ containerDir + " not found."));
+ }
+
+ // Metadata directory should exist.
+ File metadataDir = new File(metadataPath);
+ if (!metadataDir.exists()) {
+ return ScanResult.unhealthy(ScanResult.FailureType.MISSING_METADATA_DIR,
+ metadataDir, new FileNotFoundException("Metadata directory " +
+ metadataDir + " not found."));
+ }
+
+ File containerFile = KeyValueContainer
+ .getContainerFile(metadataPath, containerID);
try {
- loadContainerData();
- checkLayout();
Review Comment:
checkLayout is removed, and check is provided for existence. But this method
used to have directory check and list file check. Do this is required or
removed ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]