A new TreeMap<K, V> gets created when toBinary() is called, and keys
as well as values are converted to binary objects and added to it.
This fails with a CCE because binary objects are not comparable (so
the comparison logic for the keys is lost after conversion).

Not sure whether there are discussions going on in the background due
to the non-newbie nature of this, but my thought was that you force
the programmer to provide the logic how the binary versions of the
keys should be compared. Maybe by requiring the original keys to
implement a org.apache.ignite.binary.BinaryComparable interface
(basically Comparable<BinaryObject>)

Would that make any sense?





On Thu, Jul 21, 2016 at 9:28 PM, Dmitriy Setrakyan
<dsetrak...@apache.org> wrote:
> Well, in my view we should have that discussion or close this ticket. What
> are the challenges there? Is there a dev thread I can review?
>
> On Thu, Jul 21, 2016 at 5:41 AM, Denis Magda <dma...@gridgain.com> wrote:
>
>> Dmitriy,
>>
>> Presently even the guys who spent bunch the time developing and improving
>> binary marshaller don’t have a view on how to implement this feature. So
>> initially we should discuss how to implement it in general and after that
>> decide if the ticket can be taken over by new contributors.
>>
>> —
>> Denis
>>
>> > On Jul 21, 2016, at 1:18 PM, Dmitriy Setrakyan <dsetrak...@apache.org>
>> wrote:
>> >
>> > On Wed, Jul 20, 2016 at 2:45 PM, Denis Magda <dma...@gridgain.com>
>> wrote:
>> >
>> >> Hi Jens,
>> >>
>> >> This is not the best candidate for the first contribution and presently
>> I
>> >> don’t think that this feature should be supported at all.
>> >>
>> >
>> > Denis, why not?
>> >
>> >
>> >>
>> >> I would recommend you picking up one of the tickets with “newbie”
>> filter.
>> >> https://issues.apache.org/jira/issues/?filter=12338037 <
>> >> https://issues.apache.org/jira/issues/?filter=12338037>
>> >>
>> >> Regards,
>> >> Denis
>> >>
>> >>> On Jul 19, 2016, at 9:00 PM, NoTrueScotsman <
>> no.true.scots...@gmail.com>
>> >> wrote:
>> >>>
>> >>> It happens when applying ignite.binary().toBinary(m) to a TreeMap<K,
>> >>> V> with a custom key K.
>> >>>
>> >>> I thought this would be a nice task to pick as a first (attempt of a)
>> >>> contribution, however there is a ticket for this already assigned to
>> >>> someone: https://issues.apache.org/jira/browse/IGNITE-2852
>> >>>
>> >>> I haven't seen much activity on it though. Would it be possible for me
>> >>> to pick it?
>> >>>
>> >>> Thanks
>> >>> Jens
>> >>
>> >>
>>
>>

Reply via email to