ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Izhikov (Jira)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-12406) Refactor GridCommonAbstractTest#findKeys to use enum
Date Fri, 29 Nov 2019 14:47:00 GMT

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

Nikolay Izhikov updated IGNITE-12406:
-------------------------------------
    Description: 
Currently, we have {{type}} argument in findKeys method.
It used to distinguish between required key types.
This argument should be refactored to enum and documented in JavaDoc.

{{code:java}}
    protected List<Integer> findKeys(@Nullable ClusterNode node, IgniteCache<?, ?>
cache,
        final int cnt, final int startFrom, final int type) {
                        if (type == 0)
                            ok = aff.isPrimary(node0, key);
                        else if (type == 1)
                            ok = aff.isBackup(node0, key);
                        else if (type == 2)
                            ok = !aff.isPrimaryOrBackup(node0, key);
{{code:java}}

  was:
Currently, we have {{type}} argument in findKeys method.
It used to distinguish between required key types.
This argument should be refactored to enum and documented in JavaDoc.

{code:java}
    protected List<Integer> findKeys(@Nullable ClusterNode node, IgniteCache<?, ?>
cache,
        final int cnt, final int startFrom, final int type) {
                        if (type == 0)
                            ok = aff.isPrimary(node0, key);
                        else if (type == 1)
                            ok = aff.isBackup(node0, key);
                        else if (type == 2)
                            ok = !aff.isPrimaryOrBackup(node0, key);
{code:java}


> Refactor GridCommonAbstractTest#findKeys to use enum
> ----------------------------------------------------
>
>                 Key: IGNITE-12406
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12406
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Nikolay Izhikov
>            Priority: Major
>              Labels: newbiee
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, we have {{type}} argument in findKeys method.
> It used to distinguish between required key types.
> This argument should be refactored to enum and documented in JavaDoc.
> {{code:java}}
>     protected List<Integer> findKeys(@Nullable ClusterNode node, IgniteCache<?,
?> cache,
>         final int cnt, final int startFrom, final int type) {
>                         if (type == 0)
>                             ok = aff.isPrimary(node0, key);
>                         else if (type == 1)
>                             ok = aff.isBackup(node0, key);
>                         else if (type == 2)
>                             ok = !aff.isPrimaryOrBackup(node0, key);
> {{code:java}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message