Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 073FC200BC1 for ; Wed, 16 Nov 2016 13:48:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 06192160B17; Wed, 16 Nov 2016 12:48:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 591BC160B03 for ; Wed, 16 Nov 2016 13:47:59 +0100 (CET) Received: (qmail 61776 invoked by uid 500); 16 Nov 2016 12:47:58 -0000 Mailing-List: contact issues-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 issues@ignite.apache.org Received: (qmail 61756 invoked by uid 99); 16 Nov 2016 12:47:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2016 12:47:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 61C0D2C4C70 for ; Wed, 16 Nov 2016 12:47:58 +0000 (UTC) Date: Wed, 16 Nov 2016 12:47:58 +0000 (UTC) From: "Vladimir Ozerov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IGNITE-2664) Cache.invokeAll() returns a map with BinaryObjects instead of user objects MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 16 Nov 2016 12:48:00 -0000 [ https://issues.apache.org/jira/browse/IGNITE-2664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vladimir Ozerov updated IGNITE-2664: ------------------------------------ Fix Version/s: (was: 1.8) 2.0 > Cache.invokeAll() returns a map with BinaryObjects instead of user objects > -------------------------------------------------------------------------- > > Key: IGNITE-2664 > URL: https://issues.apache.org/jira/browse/IGNITE-2664 > Project: Ignite > Issue Type: Bug > Affects Versions: 1.5.0.final > Reporter: Artem Shutak > Fix For: 2.0 > > > {{Cache.invokeAll()}} return a map with {{BinaryObjectImpl}} instead of user objects. > Cache.invoke() works fine. > I see a different behavior for Transactional and Atomic caches. But both of them return {{BinaryObjectImpl}} instead of user objects at keys/values of a result map. > It can be reproduced with CacheFullApiNewSelfTest.testInvokeAllOptimisticReadCommitted1() (and others). Note: It does not work for plane object and serializable object, but it works fine for EXTERNALIZABLE. > Or use the following code example > {code} > public static void main(String[] args) throws Exception { > CacheConfiguration cc = new CacheConfiguration() > .setMemoryMode(CacheMemoryMode.ONHEAP_TIERED) > .setCacheMode(CacheMode.PARTITIONED) > .setAtomicityMode(CacheAtomicityMode.ATOMIC) > .setLoadPreviousValue(true) > .setSwapEnabled(true) > .setCacheStoreFactory(new CacheAbstractNewSelfTest.TestStoreFactory()) > .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) > .setAtomicWriteOrderMode(CacheAtomicWriteOrderMode.PRIMARY) > ; > cc.setReadThrough(true); > cc.setWriteThrough(true); > try(Ignite ignite = Ignition.start(getConfiguration("1")); > Ignite ignite2 = Ignition.start(getConfiguration("2")); > Ignite ignite3 = Ignition.start(getConfiguration("3")); > Ignite ignite4 = Ignition.start(getConfiguration("4"))) { > System.out.println(ignite.configuration().getMarshaller()); > IgniteCache cache = ignite.getOrCreateCache(cc); > // Await partition map exchange. > Thread.sleep(10_000); > CacheFullApiNewSelfTest.DataMode mode = CacheFullApiNewSelfTest.DataMode.SERIALIZABLE; > final TestObject key = key(1, mode); > final TestObject val = value(1, mode); > // InvokeAll > cache.put(key, val); > Map> mapRes = cache.invokeAll(F.asSet(key), CacheFullApiNewSelfTest.RMV_PROCESSOR); > for (Map.Entry> e : mapRes.entrySet()) { > TestObject eKey = e.getKey(); > System.out.println(eKey); > if (!(eKey instanceof TestObject)) > throw new IllegalStateException("key=" + eKey + ", class=" + eKey.getClass()); > TestObject eVal = e.getValue().get(); > if (!(eVal instanceof TestObject)) > throw new IllegalStateException("val=" + eVal + ", class=" + eVal.getClass()); > } > } > } > private static IgniteConfiguration getConfiguration(String s) { > TcpDiscoverySpi spi = new TcpDiscoverySpi(); > TcpDiscoveryMulticastIpFinder finder = new TcpDiscoveryMulticastIpFinder(); > finder.setAddresses(Collections.singleton("127.0.0.1:" + TcpDiscoverySpi.DFLT_PORT)); > spi.setIpFinder(finder); > return new IgniteConfiguration() > .setPeerClassLoadingEnabled(true) > .setSwapSpaceSpi(new GridTestSwapSpaceSpi()) > .setGridName(s) > .setDiscoverySpi(spi) > .setLocalHost("127.0.0.1") > ; > } > {code} > I've investigated the issue and found the root cause. Ignite does not unwrap BinaryObject before get it to user. See {GridCacheReturn.finishUnmarshal()} and org/apache/ignite/internal/processors/cache/GridCacheReturn.java:332. We need to pass {{keepBinary}} flag at this place according to used cache. -- This message was sent by Atlassian JIRA (v6.3.4#6332)