Skip to content

HDDS-14118. Support OBS keys and additional flags in ContainerToKeyMapping tool#9599

Merged
sumitagrawl merged 3 commits intoapache:masterfrom
sarvekshayr:HDDS-14118
Jan 28, 2026
Merged

HDDS-14118. Support OBS keys and additional flags in ContainerToKeyMapping tool#9599
sumitagrawl merged 3 commits intoapache:masterfrom
sarvekshayr:HDDS-14118

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.

Copy link
Contributor

@priyeshkaratha priyeshkaratha left a comment

Choose a reason for hiding this comment

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

@sarvekshayr Thanks for working on this. Please see some minor comments.

Comment on lines +191 to +198
// Process FSO keys (fileTable)
processFSOKeys(containerIds, containerToKeysMap, unreferencedCountMap, bucketVolMap);

// Process OBS keys (keyTable)
processOBSKeys(containerIds, containerToKeysMap);

jsonOutput(writer, containerToKeysMap, unreferencedCountMap);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - please remove unnecessary new lines in the code. I can see after calling every method a new line is added.

public Void call() throws Exception {
err().println("Note: A container can have both FSO and OBS keys. Currently this tool processes only FSO keys");


Copy link
Contributor

Choose a reason for hiding this comment

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

nit - avoid this new line

Copy link
Contributor

@sumitagrawl sumitagrawl left a comment

Choose a reason for hiding this comment

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

LGTM

@sumitagrawl sumitagrawl merged commit c386644 into apache:master Jan 28, 2026
44 checks passed
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.

5 participants