From dev-return-44268-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Thu Jan 24 11:41:53 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8AF8C18062C for ; Thu, 24 Jan 2019 11:41:52 +0100 (CET) Received: (qmail 60155 invoked by uid 500); 24 Jan 2019 10:41:51 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 60144 invoked by uid 99); 24 Jan 2019 10:41:51 -0000 Received: from mail-relay.apache.org (HELO mailrelay2-lw-us.apache.org) (207.244.88.137) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jan 2019 10:41:51 +0000 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mailrelay2-lw-us.apache.org (ASF Mail Server at mailrelay2-lw-us.apache.org) with ESMTPSA id 862002D3B for ; Thu, 24 Jan 2019 10:41:50 +0000 (UTC) Received: by mail-lj1-f174.google.com with SMTP id c19-v6so4783425lja.5 for ; Thu, 24 Jan 2019 02:41:50 -0800 (PST) X-Gm-Message-State: AJcUukezYZgigoIaqMChtahCMAp/qPXR2W3gPvZcoBjErJg73sB3KWmS syLITCXvAmQW3xEksCxPO15YGLQlslUK3bs5yQ== X-Google-Smtp-Source: ALg8bN6ibhelQyhzUqSds6M2cMrafswAFyx7dYYIqXm3TVEhPqmiZtd6nF9X7gGV+4Ds5e41HrX511BoLnlrtzHuOBc= X-Received: by 2002:a2e:551:: with SMTP id 78-v6mr5082664ljf.82.1548326509326; Thu, 24 Jan 2019 02:41:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Tupitsyn Date: Thu, 24 Jan 2019 13:41:37 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: CacheInterceptor ClassCastException in case of cache was updated from thin java client To: dev Content-Type: multipart/alternative; boundary="00000000000095bd2a058031dbd5" --00000000000095bd2a058031dbd5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable You are exactly right, generic parameters don't make much sense here. Ignite caches are not restricted to any type, and there is type erasure in Java so you have no runtime guarantees. Maybe Interceptor design should be improved (e.g. add a flag to force binary or non-binary mode), but Thin or Thick client connector logic is unrelated here. withKeepBinary() call is valid and should not depend on Interceptor presence or implementation. On Thu, Jan 24, 2019 at 1:17 PM Sergey Antonov wrote: > Hi, Pavel, > > "Interceptor should support both modes, binary or not. Any code can call > withKeepBinary(), this should be expected. > Just add if (x instanceof BinaryObject) and go from there. " > I don't agree. The cache interceptor[1] is a parametrized class and you > couldn't pass multiple cache interceptors in cache configuration. So all > cache interceptors must have Object, Object parameters for supporting bot= h > modes: binary and deserialized. In this case parametrized class no sense. > > [1] > > https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache= /CacheInterceptor.html > > =D1=87=D1=82, 24 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 13:06, Pavel Tup= itsyn : > > > Hi Sergey, > > > > I don't think this is a bug. > > > > Thick or thin clients always work in binary mode on server side, becaus= e > > you receive data in serialized form and there is no point in > deserializing > > it. > > Moreover, in most cases you don't have classes on the server, so binary > > mode is the only way. > > > > Interceptor should support both modes, binary or not. Any code can call > > withKeepBinary(), this should be expected. > > Just add if (x instanceof BinaryObject) and go from there. > > > > Thanks, > > Pavel > > > > On Thu, Jan 24, 2019 at 12:38 PM Sergey Antonov < > antonovsergey93@gmail.com > > > > > wrote: > > > > > I did a little investigation. In > > o.a.i.i.p.p.c.c.ClientCacheRequest#cache() > > > enforced cache with keep binary. Why we should always work binary > > objects? > > > > > > =D1=87=D1=82, 24 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 12:29, Serge= y Antonov >: > > > > > > > Hello, Igniters! > > > > > > > > I have ignite node with configured cache. The cache have cache > > > > interceptor. I wiil got ClassCastException on cache interceptor, If= I > > put > > > > some entry to the cache (without keepBinary) from thin java client. > > > > > > > > I think it's a bug. I'd like to find out yours view! > > > > > > > > Also I made JIRA ticket with reproducer [1]. > > > > > > > > [1] https://issues.apache.org/jira/browse/IGNITE-10789 > > > > > > > > -- > > > > BR, Sergey Antonov > > > > > > > > > > > > > -- > > > BR, Sergey Antonov > > > > > > > > -- > BR, Sergey Antonov > --00000000000095bd2a058031dbd5--