-
Notifications
You must be signed in to change notification settings - Fork 589
HDDS-5541. Namespace summary endpoint can carry basic information on the entity as well. #4042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…the entity as well.
|
@smengcl @dombizita , pls review |
…the entity as well.
|
@swamirishi @aswinshakil can you please take a look? |
| Assert.assertSame(entity.getEntityType(), EntityType.DIRECTORY); | ||
| Assert.assertEquals(1, entity.getNumTotalKey()); | ||
| Assert.assertEquals(0, entity.getNumTotalDir()); | ||
| Assert.assertEquals(1, entity.getCountStats().getNumTotalKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't we asserting getNumVolume() and getNumBucket() here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review. This was existing case, I added those missing as you mentioned.
| CountStats countStats = new CountStats( | ||
| -1, -1, | ||
| getTotalDirCount(bucketObjectId), getTotalKeyCount(bucketObjectId)); | ||
| NamespaceSummaryResponse namespaceSummaryResponse = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| NamespaceSummaryResponse namespaceSummaryResponse = | |
| return NamespaceSummaryResponse.newBuilder() | |
| .setEntityType(EntityType.BUCKET) | |
| .setCountStats(countStats) | |
| .setObjectDBInfo(getBucketObjDbInfo(names)) | |
| .setStatus(ResponseStatus.OK) | |
| .build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review.
| getBucketKey(volName, bucketName); | ||
| OmBucketInfo omBucketInfo = | ||
| getOmMetadataManager().getBucketTable().getSkipCache(bucketKey); | ||
| BucketObjectDBInfo bucketObjectDBInfo = new BucketObjectDBInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a constructor or a builder which takes OmBucketInfo in BucketObjectDBInfo. Something like this. This way encapsulation will be preserved.
public BucketObjectDBInfo(OmBucketInfo omBucketInfo) {
this.metadata = omBucketInfo.getMetadata();
this.volumeName = omBucketInfo.getVolumeName();
this.name = omBucketInfo.getBucketName();
this.quotaInBytes = omBucketInfo.getQuotaInBytes();
this.quotaInNamespace = omBucketInfo.getQuotaInNamespace();
this.usedNamespace = omBucketInfo.getUsedNamespace();
this.creationTime = omBucketInfo.getCreationTime();
this.modificationTime = omBucketInfo.getModificationTime();
this.acls = omBucketInfo.getAcls();
this.sourceBucket = omBucketInfo.getSourceBucket();
this.sourceVolume = omBucketInfo.getSourceVolume();
this.encryptionKeyInfo = omBucketInfo.getEncryptionKeyInfo();
this.versioningEnabled = omBucketInfo.getIsVersionEnabled();
this.storageType = omBucketInfo.getStorageType();
this.defaultReplicationConfig = omBucketInfo.getDefaultReplicationConfig();
this.bucketLayout = omBucketInfo.getBucketLayout();
this.owner = omBucketInfo.getOwner();
}
Builder would be preferred tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review.
| private ObjectDBInfo getDirectoryObjDbInfo(String[] names) | ||
| throws IOException { | ||
| OmDirectoryInfo dirInfo = getBucketHandler().getDirInfo(names); | ||
| ObjectDBInfo objectDBInfo = new ObjectDBInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as BucketObjectDBInfo, create constructor or builder which takes OmDirectoryInfo and create ObjectDBInfo object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review.
| private ObjectDBInfo getKeyDbObjectInfo(String[] names) | ||
| throws IOException { | ||
| OmKeyInfo keyInfo = getBucketHandler().getKeyInfo(names); | ||
| KeyObjectDBInfo keyObjectDBInfo = new KeyObjectDBInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as BucketObjectDBInfo, create constructor or builder which takes OmKeyInfo and create KeyObjectDBInfo object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review.
| OmPrefixInfo omPrefixInfo = | ||
| getOmMetadataManager().getPrefixTable(). | ||
| getSkipCache(OzoneConsts.OM_KEY_PREFIX); | ||
| ObjectDBInfo objectDBInfo = new ObjectDBInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as BucketObjectDBInfo, create constructor or builder which takes OmPrefixInfo and create ObjectDBInfo object.
| String dbVolumeKey = getOmMetadataManager().getVolumeKey(names[0]); | ||
| OmVolumeArgs volumeArgs = | ||
| getOmMetadataManager().getVolumeTable().getSkipCache(dbVolumeKey); | ||
| VolumeObjectDBInfo objectDBInfo = new VolumeObjectDBInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as BucketObjectDBInfo, create constructor or builder which takes OmVolumeArgs and create VolumeObjectDBInfo object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review.
| Assert.assertEquals(2, rootResponseObj.getCountStats().getNumVolume()); | ||
| Assert.assertEquals(4, rootResponseObj.getCountStats().getNumBucket()); | ||
| Assert.assertEquals(5, rootResponseObj.getCountStats().getNumTotalDir()); | ||
| Assert.assertEquals(10, rootResponseObj.getCountStats().getNumTotalKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a repetitive code. I think moving this to a function would be nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, it has been fixed.
| @JsonProperty("replicationConfigInfo") | ||
| private DefaultReplicationConfig defaultReplicationConfig; | ||
|
|
||
| /** source volume. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java doc comments, like this, don't provide any information as such. I would recommend to remove obvious comments like this everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. Changes done. Pls re-review.
…the entity as well.
| if (!isInitializationComplete()) { | ||
| namespaceSummaryResponse = | ||
| new NamespaceSummaryResponse(EntityType.UNKNOWN); | ||
| NamespaceSummaryResponse.newBuilder(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| NamespaceSummaryResponse.newBuilder(). | |
| NamespaceSummaryResponse.newBuilder() | |
| .setEntityType(EntityType.UNKNOWN) | |
| .setStatus(ResponseStatus.INITIALIZING) | |
| .build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - this is fixed. pls re-review.
| return | ||
| NamespaceSummaryResponse.newBuilder() | ||
| .setEntityType(EntityType.BUCKET) | ||
| .setCountStats(countStats) | ||
| .setObjectDBInfo(getBucketObjDbInfo(names)) | ||
| .setStatus(ResponseStatus.OK) | ||
| .build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be in one line. Please change it everywhere.
| return | |
| NamespaceSummaryResponse.newBuilder() | |
| .setEntityType(EntityType.BUCKET) | |
| .setCountStats(countStats) | |
| .setObjectDBInfo(getBucketObjDbInfo(names)) | |
| .setStatus(ResponseStatus.OK) | |
| .build(); | |
| return NamespaceSummaryResponse.newBuilder() | |
| .setEntityType(EntityType.VOLUME) | |
| .setCountStats(countStats) | |
| .setObjectDBInfo(getVolumeObjDbInfo(names)) | |
| .setStatus(ResponseStatus.OK) | |
| .build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - this is fixed. pls re-review.
|
|
||
| } | ||
|
|
||
| public BucketObjectDBInfo(Builder b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not how builder pattern works. Please change all the builder to this way.
| public BucketObjectDBInfo(Builder b) { | |
| public BucketObjectDBInfo(Map<String, String> metadata, | |
| String name, | |
| String volumeName, | |
| StorageType storageType, | |
| boolean isVersioningEnabled, | |
| BucketEncryptionKeyInfo bekInfo, | |
| DefaultReplicationConfig defaultReplicationConfig, | |
| String sourceVolume, | |
| String sourceBucket, | |
| BucketLayout bucketLayout, | |
| String owner, | |
| long quotaInBytes, | |
| long quotaInNamespace, | |
| long usedNamespace, | |
| long creationTime, | |
| long modificationTime, | |
| List<OzoneAcl> acls) { | |
| super.setMetadata(metadata); | |
| super.setName(name); | |
| super.setQuotaInBytes(quotaInBytes); | |
| super.setQuotaInNamespace(quotaInNamespace); | |
| super.setUsedNamespace(usedNamespace); | |
| super.setCreationTime(creationTime); | |
| super.setModificationTime(modificationTime); | |
| super.setAcls(acls); | |
| this.volumeName = volumeName; | |
| this.sourceBucket = sourceVolume; | |
| this.sourceVolume = sourceBucket; | |
| this.isVersioningEnabled = isVersioningEnabled; | |
| this.storageType = storageType; | |
| this.defaultReplicationConfig = defaultReplicationConfig; | |
| this.bucketLayout = bucketLayout; | |
| this.owner = owner; | |
| this.bekInfo = bekInfo; | |
| } |
More: https://www.baeldung.com/java-builder-pattern-freebuilder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - there can be multiple ways to implement builder pattern. We should just make sure that OOPS principles being followed. You may want to look below link as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - As discussed, implemented with plain constructor Pls re-review.
| * Builder for BucketObjectDBInfo. | ||
| */ | ||
| @SuppressWarnings("checkstyle:hiddenfield") | ||
| public static final class Builder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public static final class Builder { | |
| public static class Builder { | |
| private final OmBucketInfo omBucketInfo; | |
| public Builder(OmBucketInfo omBucketInfo) { | |
| this.omBucketInfo = omBucketInfo; | |
| } | |
| public BucketObjectDBInfo build() { | |
| if (this.omBucketInfo == null) { | |
| return new BucketObjectDBInfo(); | |
| } | |
| return new BucketObjectDBInfo(omBucketInfo.getMetadata(), | |
| omBucketInfo.getBucketName(), | |
| omBucketInfo.getVolumeName(), | |
| omBucketInfo.getStorageType(), | |
| omBucketInfo.getIsVersionEnabled(), | |
| omBucketInfo.getEncryptionKeyInfo(), | |
| omBucketInfo.getDefaultReplicationConfig(), | |
| omBucketInfo.getSourceVolume(), | |
| omBucketInfo.getSourceBucket(), | |
| omBucketInfo.getBucketLayout(), | |
| omBucketInfo.getOwner(), | |
| omBucketInfo.getQuotaInBytes(), | |
| omBucketInfo.getQuotaInNamespace(), | |
| omBucketInfo.getUsedNamespace(), | |
| omBucketInfo.getCreationTime(), | |
| omBucketInfo.getModificationTime(), | |
| omBucketInfo.getAcls()); | |
| } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - This is just a specific pattern you mentioned. Builder pattern can be written in many ways. We can discuss over this in Slack channel. I have pinged you. You can let me know when you are free to discuss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - As discussed, implemented with plain constructor Pls re-review.
| return volumeName; | ||
| } | ||
|
|
||
| public void setVolumeName(String volumeName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need setter? Is it for jackson serialization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - yes it is needed for JSON serialization
| /** | ||
| * Encapsulates the low level volume/bucket/dir info. | ||
| */ | ||
| public class ObjectDBInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just call it ObjectInfo? Why DB in the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - It is because these attributes are very specific to what we save in RocksDB. Pls also you can go through JIRA details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - As discussed, we have kept the name same as ObjectDBInfo. Pls re-review.
| /** | ||
| * Encapsulates the low level bucket info. | ||
| */ | ||
| public class BucketObjectDBInfo extends ObjectDBInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really a subclass of ObjectDBInfo? Or you just did it because they share some common properties?
It also doesn't follow the correct hierarchy model.
Java doc comment says VolumeObjectDBInfo encapsulates the low level volume info, BucketObjectDBInfo encapsulates the low level bucket info and ObjectDBInfoEncapsulates the low level volume/bucket/dir info.
So hierarchy should be Volume -> Bucket -> Dir -> Key but according to your implementation Dir -> Volume, Bucket and Key. Which is wrong to me.
Please correct it. If you want to extract out common properties, create another class something CommonPropertyClass (Please come up with better name).
VolumeObjectDBInfo extands CommonPropertyClass
BucketObjectDBInfo extands CommonPropertyClass
ObjectDBInfo extands CommonPropertyClass
KeyObjectDBInfo extands CommonPropertyClass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 , thanks for your review. Here we don't have to follow that Volume -> Bucket -> Dir -> Key
Because this ObjectDBInfo is a parent class with common properties.
Because this is RocksDB object level info properties and I feel giving name as ObjectDBInfo is justifying name... as this is no specific objectDB info and attributes can be related to any object which is common... So either we can give name as CommonPropertyClass or ObjectDBInfo, how does it matter. It is just an implementation specific I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really a subclass of
ObjectDBInfo? Or you just did it because they share some common properties?It also doesn't follow the correct hierarchy model. Java doc comment says
VolumeObjectDBInfoencapsulates the low level volume info,BucketObjectDBInfoencapsulates the low level bucket info andObjectDBInfoEncapsulates the low level volume/bucket/dir info.So hierarchy should be Volume -> Bucket -> Dir -> Key but according to your implementation Dir -> Volume, Bucket and Key. Which is wrong to me.
Please correct it. If you want to extract out common properties, create another class something
CommonPropertyClass(Please come up with better name).VolumeObjectDBInfo extands CommonPropertyClass BucketObjectDBInfo extands CommonPropertyClass ObjectDBInfo extands CommonPropertyClass KeyObjectDBInfo extands CommonPropertyClass
@hemantk-12 - As discussed, we have kept the name same as ObjectDBInfo. Pls re-review.
| @JsonProperty("owner") | ||
| private String owner; | ||
|
|
||
| public static BucketObjectDBInfo.Builder newBuilder() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - I couldn't understand this. Pls elaborate why unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because new BucketObjectDBInfo.Builder(); can be used instead of BucketObjectDBInfo.newBuilder() . It is not providing any benefit.
If it is general pattern followed in the code base, please go ahead with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 - As discussed, I have implemented without builder and with plain constructor. Pls re-review.
| Assert.assertEquals(2, rootResponseObj.getCountStats().getNumVolume()); | ||
| Assert.assertEquals(4, rootResponseObj.getCountStats().getNumBucket()); | ||
| Assert.assertEquals(5, rootResponseObj.getCountStats().getNumTotalDir()); | ||
| Assert.assertEquals(10, rootResponseObj.getCountStats().getNumTotalKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is addressed.
…the entity as well.
hemantk-12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
| @Override | ||
| public OmDirectoryInfo getDirInfo(String[] names) throws IOException { | ||
| return OmDirectoryInfo.newBuilder() | ||
| .setName(names[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If names has less than 3 elements, iirc it throws ArrayIndexOutOfBoundsException which is a RuntimeException and won't be caught by IOException.
Add a Preconditions.checkArgument check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smengcl - this check is not needed here as above code flow hits only when the path will be directory else not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain more, what guarantees that we can't call this getDirInfo method only when the path is a directory? this is inside BucketHandler and a legacy bucket doesn't necessarily have a directory inside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devmadhuu I get that the only caller (at the moment) calling this method won't cause issues. I'm fine with either adding or not adding the check but I would prefer the former.
Same goes for the method in FSOBucketHandler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dombizita - getDirInfo method has caller only through DirectoryEntityHandler and call stack for DirectoryEntityHandler will be determined after validating the path , if path is directory, then only DirectoryEntityHandler will be returned by EntityHandler.getEntityHandler , so there is no way the current code flow will hit getDirInfo method if path is not directory. First two indexes will be taken by Volume and Bucket in path and 3rd index will be surely a directory. Please check the caller hierarchy of this method. We can have zoom call to explain by sharing my screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that currently this is only called when it is guaranteed that the path is a directory. but if someone later adds something and doesn't know how this method works the scenario can happen which @smengcl wrote above. all the classes that are extending the EntityHandler abstract class can do a OmDirectoryInfo omDirectoryInfo = getBucketHandler().getDirInfo(names), even if the names length is less than 3. I am also fine with either way, just wanted to clarify what I meant.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/CountStats.java
Outdated
Show resolved
Hide resolved
smengcl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @devmadhuu for working on this. Overall looks fine.
…the entity as well.
…tion on the entity as well." This reverts commit 4b07e59.
…the entity as well.
dombizita
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this useful improvement @devmadhuu, I added few comment inline, beside that it looks good to me.
| @Override | ||
| public OmDirectoryInfo getDirInfo(String[] names) throws IOException { | ||
| return OmDirectoryInfo.newBuilder() | ||
| .setName(names[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain more, what guarantees that we can't call this getDirInfo method only when the path is a directory? this is inside BucketHandler and a legacy bucket doesn't necessarily have a directory inside.
| * Encapsulates the low level bucket info. | ||
| */ | ||
| public class BucketObjectDBInfo extends ObjectDBInfo { | ||
| @JsonProperty("volumeName") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between volumeName and sourceVolume (in line 52)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourceVolume is used for bucket link iirc.
ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Line 4306 in 85e7cd1
| Pair.of(info.getSourceVolume(), info.getSourceBucket()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between
volumeNameandsourceVolume(in line 52)?
@dombizita - SourceVolume is used if bucket is a symbolic link.
…the entity as well.
|
thanks for updating your patch @devmadhuu, it looks good to me! |
|
@devmadhuu Thanks for the contribution. Thanks everyone for reviewing. Merging this now that we have approvals. |
Currently, the /namsepace/summary endpoint carries only count data. Since it is a summary endpoint at the path level, we could make it more useful with other information as well.
Sample volume and bucket summary API responses
For volumes, we can add fields in OzoneVolume:
For buckets, we can add fields in OzoneBucket:
Some refactoring of existing code also been done to improve the structuring of API response. All counts related information has been grouped under "CountStats" and "dbInfo" information is added extra for detailed object information picked up from RocksDB for the path for which name space summary is generated.
https://issues.apache.org/jira/browse/HDDS-5541
Patch is tested with writing and executing Junit test cases inside "TestNSSummaryEndpointWithLegacy" and "TestNSSummaryEndpointWithFSO"