ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Artem Shutak (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IGNITE-2191) Binary marshaller: support user classes with the same simple name
Date Wed, 13 Jan 2016 17:49:40 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-2191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096662#comment-15096662
] 

Artem Shutak edited comment on IGNITE-2191 at 1/13/16 5:49 PM:
---------------------------------------------------------------

Found that BinaryIdMapper has the following contract:

{code}
    /**
     * Gets type ID for provided class name.
     * <p>
     * If {@code 0} is returned, hash code of class simple name will be used.
     *
     * @param clsName Class name.
     * @return Type ID.
     */
    public int typeId(String clsName);
{code}

So, If a user uses a custom implementation for id mapper we have to delegate a calculation
of typeId to BinarySimpleNameIdMapper if the custom implementation returns 'zero'.


was (Author: ashutak):
Found that BinaryIdMapper has the following contact:

{code}
    /**
     * Gets type ID for provided class name.
     * <p>
     * If {@code 0} is returned, hash code of class simple name will be used.
     *
     * @param clsName Class name.
     * @return Type ID.
     */
    public int typeId(String clsName);
{code}

So, If a user uses a custom implementation for id mapper we have to delegate a calculation
of typeId to BinarySimpleNameIdMapper if the custom implementation returns 'zero'.

> Binary marshaller: support user classes with the same simple name
> -----------------------------------------------------------------
>
>                 Key: IGNITE-2191
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2191
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: ignite-1.4
>            Reporter: Denis Magda
>            Assignee: Artem Shutak
>            Priority: Critical
>              Labels: important
>             Fix For: 1.6
>
>
> Presently the user won't be able to use across the cluster object that have a single
simple name.
> As an example if the user has 'org.comp.MyObject' and 'org.apache.comp.MyObject' then
he won't be able to have them both in a cluster because marshalling mechanism supports uniqueness
at simple name level only.
> There are several reasons for that:
> - interoperability with other platforms;
> - queries that use simple name is their 'where' clause.
> In general according to the API as a workaround the user can implement its own BinaryIdMapper
returning a precise id for every class. However there is a bug in BinaryContext that passes
simple name rather than a full name to a BinaryIdMapper implementation. BinaryIdMapper must
be fixed as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message