ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Kulichenko <valentin.kuliche...@gmail.com>
Subject Re: Converting TreeMap to BinaryObject causes ClassCastException (IGNITE-2852)
Date Sat, 06 Aug 2016 04:57:06 GMT
Hi Jens,

The main purpose of binary format is to avoid deploying any classes on
server nodes, but with your approach you will need to deploy the comparator
class. You will also not be able to dynamically change this.

All,

This issue becomes more and more critical as more users face with it in
different situations. I think we should finally come up with some simple
solution which we can then improve. How about we provide an option to
define an ordered set of fields for comparison and save this information in
metadata, so that it can be dynamically changed? Will this work? By default
we can compare all fields in alphabetical order.

Thoughts?

-Val

On Fri, Aug 5, 2016 at 7:27 AM, NoTrueScotsman <no.true.scotsman@gmail.com>
wrote:

> 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
> <dsetrakyan@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 <dmagda@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 <dsetrakyan@apache.org
> >
> >> wrote:
> >> >
> >> > On Wed, Jul 20, 2016 at 2:45 PM, Denis Magda <dmagda@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.scotsman@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
> >> >>
> >> >>
> >>
> >>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message