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

Marcus Eriksson updated CASSANDRA-21199:
----------------------------------------
          Fix Version/s: 6.0-alpha2
                         7.0
                             (was: 6.x)
                             (was: 7.x)
    Source Control Link: 
https://github.com/apache/cassandra/commit/9017e18fa1223b3638064bb832da62f3cb32c74a
             Resolution: Fixed
                 Status: Resolved  (was: Ready to Commit)

> ProtocolVersion::supportedVersions can be computed once to avoid showing up 
> in allocation profiles
> --------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-21199
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21199
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Local/Other
>            Reporter: Matt Byrd
>            Assignee: Matt Byrd
>            Priority: Normal
>             Fix For: 6.0-alpha2, 7.0
>
>         Attachments: 
> 026-06-01_114157-mbyrd_CASSANDRA-21199_trunk_ci_summary.html, 
> 2026-06-05_125315-mbyrd_CASSANDRA-21199_trunk_ci_summary.html, 
> CASSANDRA-21394_mbyrd_trunk_ci_summary.html, Screenshot 2026-03-04 at 7.01.51 
> PM.png
>
>
> It's a relatively small amount in one allocation profile (see attached 
> screenshot) ~0.3% of allocations, but still seems un-necessary as we're 
> copying elements from a static final EnumSet
> {code}
>     /** All supported versions, published as an enumset */
>     public final static EnumSet<ProtocolVersion> SUPPORTED = 
> EnumSet.copyOf(Arrays.asList(ArrayUtils.addAll(SUPPORTED_VERSIONS)));
> {code}
> Could instead just compute this in static initialization .
> {code}
>     public static List<String> supportedVersions()
>     {
>         List<String> ret = new ArrayList<>(SUPPORTED.size());
>         for (ProtocolVersion version : SUPPORTED)
>             ret.add(version.toString());
>         return ret;
>     }
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to