Skip to content

Conversation

@sarvekshayr
Copy link
Contributor

What changes were proposed in this pull request?

  • ContainerToKeyMapping now handles both FSO and OBS keys as a container may contain both types of keys.

  • Introduced a flag --onlyFileNames that allows listing only file names without rebuilding the full FSO tree in case of FSO keys. This significantly reduces processing time when we only need to quickly check whether any keys are affected.

bash-5.1$ ozone debug om container-key-mapping --containers "1,2" --db /data/metadata/om.db                
{
  "containers" : {
    "1" : {
      "keys" : [ "vol1/bucket1/OaStVjldJA/ahVKu3nYob/HVYBiF62s9", "vol1/bucket1/OaStVjldJA/ahVKu3nYob/YGpvx930Of", "vol1/bucket1/Y8EAzAebSj/caqb3oJxb2/eyLxOUPwZj", "vol1/bucket1/Y8EAzAebSj/caqb3oJxb2/tyRwN9pnGa", "vol1/bucket1/OaStVjldJA/Po7wJsEmQV", "vol1/bucket1/OaStVjldJA/QTFkKKPla5", "vol1/bucket1/Y8EAzAebSj/a5LvlLLrLs", "vol1/bucket1/Y8EAzAebSj/sDd02ngnXL" ],
      "numOfKeys" : 8
    },
    "2" : {
      "keys" : [ "/vol1/obsbuck/key1" ],
      "numOfKeys" : 1
    }
  }
}
bash-5.1$ ozone debug om container-key-mapping --containers "1,2" --db /data/metadata/om.db --onlyFileNames
{
  "containers" : {
    "1" : {
      "keys" : [ "HVYBiF62s9", "YGpvx930Of", "eyLxOUPwZj", "tyRwN9pnGa", "Po7wJsEmQV", "QTFkKKPla5", "a5LvlLLrLs", "sDd02ngnXL" ],
      "numOfKeys" : 8
    },
    "2" : {
      "keys" : [ "key1" ],
      "numOfKeys" : 1
    }
  }
}

What is the link to the Apache JIRA

HDDS-14118

How was this patch tested?

Added tests in TestContainerToKeyMapping.

@sarvekshayr sarvekshayr added the tools Tools that helps with debugging label Jan 7, 2026
@sarvekshayr sarvekshayr requested a review from errose28 January 9, 2026 07:34
@rich7420
Copy link
Contributor

rich7420 commented Jan 15, 2026

thanks for the patch @sarvekshayr !
overall LGTM
I think the comment in ContainerToKeyMapping.java line 60 only processes FSO layout buckets should be changed to Supports both FSO (File System Optimized) and OBS (Object Store) bucket layouts.

@sarvekshayr
Copy link
Contributor Author

thanks for the patch @sarvekshayr ! overall LGTM I think the comment in ContainerToKeyMapping.java line 60 only processes FSO layout buckets should be changed to Supports both FSO (File System Optimized) and OBS (Object Store) bucket layouts.

Thanks for pointing it out @rich7420. Fixed it.

Copy link
Contributor

@sreejasahithi sreejasahithi left a comment

Choose a reason for hiding this comment

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

Thanks @sarvekshayr for working on this.

// Build dir tree for FSO keys
Map<Long, Pair<Long, String>> bucketVolMap = new HashMap<>();
try {
prepareDirIdTree(bucketVolMap);
Copy link
Contributor

Choose a reason for hiding this comment

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

The prepareDirIdTree() method is always called which constructs both bucketVolMap and dirTreeTable even when --onlyFileNames=true
but when --onlyFileNames=true, these are never used since processFSOKeys() directly uses keyInfo.getKeyName().

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

Labels

tools Tools that helps with debugging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants