ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afedotov <alexander.fedot...@gmail.com>
Subject Re: Scanquery and Peer classloading
Date Tue, 27 Jun 2017 13:42:45 GMT
Hi Helge,

The problem is that the filter passed to the ScanQuery is executed on the
server nodes as is and since these nodes
have DynaFormModel class only in binary form they are not able to operate
on it directly from the code.
Hence you need to pass a filter which will operate on BinaryObjects like
that

try (QueryCursor<Cache.Entry<String, BinaryObject>> cursor =
         cache.withKeepBinary().query(new ScanQuery<String,
BinaryObject>((k, v) -> k.startsWith("666")))
) {
    cursor.forEach(entry -> {
        // Do your thing
    });
}


Kind regards,
Alex.

On Tue, Jun 27, 2017 at 11:57 AM, Helge Waastad [via Apache Ignite Users] <
ml+s70518n14093h17@n6.nabble.com> wrote:

> Hi,
> I might do this the wrong way but storing and fetching a third party
> object from cache using peer classloading works fine, but running scanquery:
>
> try (QueryCursor cursor = cache.query(new ScanQuery<String,
> DynaFormModel>((k, p) -> k.startsWith(id)))) { }
>
> returns:
>
>
> class org.apache.ignite.binary.BinaryInvalidTypeException:
> org.primefaces.extensions.model.dynaform.DynaFormModel
> at org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(
> BinaryContext.java:701)
> at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(
> BinaryReaderExImpl.java:1745)
> at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(
> BinaryReaderExImpl.java:1704)
> at org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(
> BinaryObjectImpl.java:794)
> at org.apache.ignite.internal.binary.BinaryObjectImpl.value(
> BinaryObjectImpl.java:142)
> at org.apache.ignite.internal.processors.cache.CacheObjectContext.
> unwrapBinary(CacheObjectContext.java:273)
> at org.apache.ignite.internal.processors.cache.CacheObjectContext.
> unwrapBinaryIfNeeded(CacheObjectContext.java:161)
> at org.apache.ignite.internal.processors.cache.CacheObjectContext.
> unwrapBinaryIfNeeded(CacheObjectContext.java:148)
> at org.apache.ignite.internal.processors.cache.GridCacheContext.
> unwrapBinaryIfNeeded(GridCacheContext.java:1730)
> at org.apache.ignite.internal.processors.cache.query.
> GridCacheQueryManager$PeekValueExpiryAwareIterator.
> advance(GridCacheQueryManager.java:2998)
> at org.apache.ignite.internal.processors.cache.query.
> GridCacheQueryManager$PeekValueExpiryAwareIterator.onHasNext(
> GridCacheQueryManager.java:2924)
> at org.apache.ignite.internal.util.GridCloseableIteratorAdapter.hasNextX(
> GridCloseableIteratorAdapter.java:53)
> at org.apache.ignite.internal.util.lang.GridIteratorAdapter.
> hasNext(GridIteratorAdapter.java:45)
> at org.apache.ignite.internal.processors.cache.query.
> GridCacheQueryManager.runQuery(GridCacheQueryManager.java:1189)
> at org.apache.ignite.internal.processors.cache.query.
> GridCacheDistributedQueryManager.processQueryRequest(
> GridCacheDistributedQueryManager.java:231)
> at org.apache.ignite.internal.processors.cache.query.
> GridCacheDistributedQueryManager$2.apply(GridCacheDistributedQueryManag
> er.java:109)
> at org.apache.ignite.internal.processors.cache.query.
> GridCacheDistributedQueryManager$2.apply(GridCacheDistributedQueryManag
> er.java:107)
> at org.apache.ignite.internal.processors.cache.GridCacheIoManager.
> processMessage(GridCacheIoManager.java:863)
> at org.apache.ignite.internal.processors.cache.
> GridCacheIoManager.onMessage0(GridCacheIoManager.java:386)
> at org.apache.ignite.internal.processors.cache.GridCacheIoManager.
> handleMessage(GridCacheIoManager.java:308)
> at org.apache.ignite.internal.processors.cache.
> GridCacheIoManager.access$000(GridCacheIoManager.java:100)
> at org.apache.ignite.internal.processors.cache.GridCacheIoManager$1.
> onMessage(GridCacheIoManager.java:253)
> at org.apache.ignite.internal.managers.communication.
> GridIoManager.invokeListener(GridIoManager.java:1257)
> at org.apache.ignite.internal.managers.communication.GridIoManager.
> processRegularMessage0(GridIoManager.java:885)
> at org.apache.ignite.internal.managers.communication.
> GridIoManager.access$2100(GridIoManager.java:114)
> at org.apache.ignite.internal.managers.communication.GridIoManager$7.run(
> GridIoManager.java:802)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.ClassNotFoundException: org.primefaces.extensions.
> model.dynaform.DynaFormModel
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:348)
> at org.apache.ignite.internal.util.IgniteUtils.forName(
> IgniteUtils.java:8478)
> at org.apache.ignite.internal.MarshallerContextImpl.getClass(
> MarshallerContextImpl.java:340)
> at org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(
> BinaryContext.java:692)
>
>
>
>
> ma., 26.06.2017 kl. 09.11 -0700, skrev afedotov:
>
> Hi, could you please describe your case and elaborate a bit on your
> concern.
>
> Kind regards,
> Alex.
>
> On Fri, Jun 23, 2017 at 1:17 PM, Helge Waastad [via Apache Ignite Users]
> <[hidden email]> wrote:
>
> Hi,
> Is it correct that scanquery will not work using Peer classloading?
>
> If so, will this ever be possible?
>
> /hw
>
> Sendt fra min iPhone
>
>
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Scanquery-
> and-Peer-classloading-tp14061.html
> To start a new topic under Apache Ignite Users, email [hidden email]
> To unsubscribe from Apache Ignite Users, click here.
> NAML
>
>
> View this message in context: Re: Scanquery and Peer classloading
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Scanquery-
> and-Peer-classloading-tp14061p14093.html
> To start a new topic under Apache Ignite Users, email
> ml+s70518n1h65@n6.nabble.com
> To unsubscribe from Apache Ignite Users, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Scanquery-and-Peer-classloading-tp14061p14113.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Mime
View raw message