Skip to content

Conversation

@xiaoyuyao
Copy link
Contributor

…fo are not formatted.

What changes were proposed in this pull request?

Format JSON output of volume/bucket/key info properly in a readable format.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-2629

How was this patch tested?

unit test and run ozone CLI in docker-compose and validate the output like below

`bash-4.2$ ozone sh vol info /vol1
{
"metadata" : { },
"name" : "vol1",
"admin" : "hadoop",
"owner" : "hadoop",
"creationTime" : "2019-11-27T06:08:15.546Z",
"acls" : [ {
"type" : "USER",
"name" : "hadoop",
"aclScope" : "ACCESS",
"aclList" : [ "ALL" ]
}, {
"type" : "GROUP",
"name" : "users",
"aclScope" : "ACCESS",
"aclList" : [ "ALL" ]
} ],
"quota" : 1152921504606846976
}

bash-4.2$ ozone sh bucket info /vol1/bucket1
{
"metadata" : { },
"volumeName" : "vol1",
"name" : "bucket1",
"storageType" : "DISK",
"versioning" : false,
"creationTime" : "2019-11-27T06:08:21.148Z",
"encryptionKeyName" : null
}

bash-4.2$ ozone sh key info /vol1/bucket1/key1
{
"volumeName" : "vol1",
"bucketName" : "bucket1",
"name" : "key1",
"dataSize" : 3813,
"creationTime" : "2019-11-27T06:08:33.206Z",
"modificationTime" : "2019-11-27T06:08:35.558Z",
"replicationType" : "RATIS",
"replicationFactor" : 3,
"ozoneKeyLocations" : [ {
"containerID" : 1,
"localID" : 103208380870754304,
"length" : 3813,
"offset" : 0
} ],
"metadata" : { },
"fileEncryptionInfo" : null
}
`

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xiaoyuyao for working on this. I have a few minor code comments below.

@adoroszlai
Copy link
Contributor

Thanks @xiaoyuyao for updating the patch.

@anuengineer anuengineer merged commit d18aa99 into apache:master Dec 5, 2019
@anuengineer
Copy link
Contributor

@adoroszlai Thanks for the review. @xiaoyuyao Thanks for the contribution. I have committed this patch to the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants