[
https://issues.apache.org/jira/browse/HDDS-17464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HDDS-17464:
----------------------------------
Labels: pull-request-available (was: )
> Parse open key DB key into a structured OpenKeyDBKey
> ----------------------------------------------------
>
> Key: HDDS-17464
> URL: https://issues.apache.org/jira/browse/HDDS-17464
> Project: Apache Ozone
> Issue Type: Improvement
> Components: OM
> Reporter: Hung-Jui Lin
> Assignee: Hung-Jui Lin
> Priority: Minor
> Labels: pull-request-available
>
> The DB key of openKeyTable / openFileTable ends with a suffix after the last
> "/":
> the client ID, or the upload ID for the open key of a multipart upload.
> {{OmMetadataManagerImpl}} parses this suffix by hand in three places, each a
> bit differently:
> - {{listOpenFiles}} calls {{OMMultipartUploadUtils.getUploadIdFromDbKey}},
> then {{OMMetadataManager.getClientIDFromOpenKeyDBKey}}
> - {{isOpenMultipartKey}} calls {{getUploadIdFromDbKey}}
> - {{getExpiredOpenKeys}} uses its own {{lastIndexOf(OM_KEY_PREFIX)}} to get
> the keyTable DB key and the client ID string
> As suggested in the review of HDDS-17251
> (https://github.com/apache/ozone/pull/11739),
> add a class that parses the DB key once and exposes the parts:
> {code:java}
> OpenKeyDBKey openKey = new OpenKeyDBKey(dbKey);
> openKey.isUpload();
> openKey.getClientId();
> openKey.getUploadId();
> openKey.getKeyDBKey();
> {code}
> Use it at the three call sites above, and remove
> {{getClientIDFromOpenKeyDBKey}} and
> {{getUploadIdFromDbKey}}, which have no other callers.
> This is a refactor only: no change to the RocksDB layout or RPC.
> {{isUpload()}} only reads the key format, so {{isOpenMultipartKey}} still
> checks the
> isMultipartKey flag and multipartInfoTable for open keys written before
> HDDS-9017.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]