xBis7 commented on code in PR #3746:
URL: https://github.com/apache/ozone/pull/3746#discussion_r999380802
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/BucketHandler.java:
##########
@@ -183,8 +185,22 @@ public static BucketHandler getBucketHandler(
OzoneStorageContainerManager reconSCM,
OmBucketInfo bucketInfo) throws IOException {
- return new FSOBucketHandler(reconNamespaceSummaryManager,
- omMetadataManager, reconSCM, bucketInfo);
+ // If bucketInfo is null then entity type is UNKNOWN
+ if (Objects.isNull(bucketInfo)) {
+ return null;
+ } else {
+ if (bucketInfo.getBucketLayout()
+ .equals(BucketLayout.FILE_SYSTEM_OPTIMIZED)) {
+ return new FSOBucketHandler(reconNamespaceSummaryManager,
+ omMetadataManager, reconSCM, bucketInfo);
+ } else if (bucketInfo.getBucketLayout()
+ .equals(BucketLayout.LEGACY)) {
+ return new LegacyBucketHandler(reconNamespaceSummaryManager,
+ omMetadataManager, reconSCM, bucketInfo);
+ } else {
+ throw new RuntimeException("Unsupported bucket layout.");
Review Comment:
> Could it crash the Recon thread / Recon process?
Probably... This exception will come from hitting an endpoint in
`NSSummaryEndpoint`. We could wrap it with a try catch and return a
`Response.serverError()` in the catch block. What do you think?
--
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]