[
https://issues.apache.org/jira/browse/HDDS-10608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17834667#comment-17834667
]
Mohammad Arafat Khan commented on HDDS-10608:
---------------------------------------------
The Recon API's *{{container->keyMapping}}* feature is designed to track the
complete path of a key. This information is stored in the *{{OmKeyInfo}}*
object, from which the details in the JSON response are derived.
For legacy buckets enabled with *{{fileSystemEnabled}} meaning it supports* a
hierarchical file system structure, the full path is visible.
[http://localhost:9888/api/v1/containers/3/keys] :-
{code:java}
{
"totalCount": 3,
"keys": [
{
"Volume": "s3v",
"Bucket": "legacy-bucket",
"Key": "dir1/dir2/dir3/d7ggupbtdl/1",
"DataSize": 1000000,
"Versions": [
0
],
"Blocks": {
"0": [
{
"containerID": 3,
"localID": 113750153625600009
}
]
},
"CreationTime": "2024-04-07T11:09:30.534Z",
"ModificationTime": "2024-04-07T11:09:32.549Z"
},
]
}{code}
However, with *FSO* buckets, as referenced in the Jira example, the
*{{OmKeyInfo}}* only contains the file name, not the full path. To determine
the full path in FSO buckets, it is necessary to manually reconstruct it by
analyzing the data provided.
> Recon can't get full key when using Recon API
> ---------------------------------------------
>
> Key: HDDS-10608
> URL: https://issues.apache.org/jira/browse/HDDS-10608
> Project: Apache Ozone
> Issue Type: Bug
> Components: Ozone Recon
> Reporter: Conway Zhang
> Assignee: Mohammad Arafat Khan
> Priority: Blocker
>
> When I use the Recon API to retrieve Ozone key information, there is a
> problem. The information obtained is not the same as when using the Ozone
> client; the full key name is not retrieved via the Recon API.
> This issue exists across all Recon APIs.
> *such as :*
> *use ozone client:*
> ozone sh key info s3v/bkt3/zhang/kang/wei/hosts
> ```
> {
> "volumeName" : "s3v",
> "bucketName" : "bkt3",
> "name" : "zhang/kang/wei/hosts",
> "dataSize" : 305,
> "creationTime" : "2024-03-26T11:36:00.021Z",
> "modificationTime" : "2024-03-26T11:36:03.874Z",
> "replicationConfig" : {
> "replicationFactor" : "THREE",
> "requiredNodes" : 3,
> "replicationType" : "RATIS"
> },
> "metadata" : { },
> "ozoneKeyLocations" : [ {
> "containerID" : 4,
> "localID" : 113750153625607001,
> "length" : 305,
> "offset" : 0,
> "keyOffset" : 0
> } ],
> "file" : true
> }
> ```
> *use recon api:*
> curl http://ozoneReconAddress:9888/api/v1/containers/4/keys | grep hosts
> ```
> {
> "Volume": "s3v",
> "Bucket": "bkt3",
> "Key": "hosts",
> "DataSize": 305,
> "Versions": [
> 0
> ],
> "Blocks": {
> "0": [
> {
> "containerID": 4,
> "localID": 113750153625607001
> }
> ]
> },
> "CreationTime": "2024-03-26T11:36:00.021Z",
> "ModificationTime": "2024-03-26T11:36:03.874Z"
> }
> ```
> In the above example ,recon api should show "Key": "zhang/kang/wei/hosts"
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]