You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2026/01/21 17:50:00 UTC

[jira] [Moved] (HDDS-14470) Improve the data structures in OMFailoverProxyProviderBase

     [ https://issues.apache.org/jira/browse/HDDS-14470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz-wo Sze moved RATIS-2386 to HDDS-14470:
------------------------------------------

    Component/s: common
                     (was: common)
            Key: HDDS-14470  (was: RATIS-2386)
       Workflow: patch-available, re-open possible, description required.  (was: no-reopen-closed, patch-avail)
        Project: Apache Ozone  (was: Ratis)

> Improve the data structures in OMFailoverProxyProviderBase
> ----------------------------------------------------------
>
>                 Key: HDDS-14470
>                 URL: https://issues.apache.org/jira/browse/HDDS-14470
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: common
>            Reporter: Tsz-wo Sze
>            Assignee: Tsz-wo Sze
>            Priority: Major
>
> {code}
> //OMFailoverProxyProviderBase
>   private Map<String, OMProxyInfo<T>> omProxies;
>   private List<String> omNodesInOrder;
> {code}
> OMFailoverProxyProviderBase currently has
> - omProxies: nodeId -> OMProxyInfo (Note that OMProxyInfo has a getNodeId() method.)
> - omNodesInOrder: int -> nodeId (Note that the ints specify the ordering of the proxies)
> When getting an OMProxyInfo from an int, it needs to get the nodeId and then lookup the omProxies map for OMProxyInfo.  The map lookup is unnecessary.
> In this JIRA, we improve the data structures by replacing them with the following:
> {code}
> // Suggested improvement
>     /** A list of proxies in a particular order. */
>     private final List<OMProxyInfo<P>> proxies;
>     /**
>      * The ordering of the nodes.
>      * <p>
>      * Invariant 1: Given a nodeId, let Integer i = ordering.get(nodeId);
>      *              If i != null, let info = proxies.get(i), then  nodeId.equals(info.getNodeId()) == true.
>      *              Otherwise, nodeId.equals(info.getNodeId()) == false for any info in proxies.
>      * <p>
>      * Invariant 2: Given a 0 <= i < proxies.size(), let nodeId = proxies.get(i).getNodeId().
>      *              Then, ordering.get(nodeId) == i.
>      */
>     private final SortedMap<String, Integer> ordering;
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org