[infinispan-issues] [JBoss JIRA] (ISPN-4467) keySet operation via HotRod in compatibility mode throws ClassCastException

Galder Zamarreño (JIRA) issues at jboss.org
Wed Jul 2 11:52:24 EDT 2014


    [ https://issues.jboss.org/browse/ISPN-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981503#comment-12981503 ] 

Galder Zamarreño commented on ISPN-4467:
----------------------------------------

Bulk get keys relies on map/reduce functions to retrieve all keys in the cache cluster-wide. Map/reduce however skips the interceptor chain altogether, skiping the interceptor doing transformations,  and instead hits directly the data container to do its job. AdvancedCache.filterEntries() cannot be used alternatively due to  similar problems, so the cleanest way to solve this is to use a different collator for when compatibility is enabled. 


> keySet operation via HotRod in compatibility mode throws ClassCastException
> ---------------------------------------------------------------------------
>
>                 Key: ISPN-4467
>                 URL: https://issues.jboss.org/browse/ISPN-4467
>             Project: Infinispan
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Martin Gencur
>            Assignee: Martin Gencur
>
> The HotRod client's keySet() operation throws ClassCastException due to the following reason:
> When Encoder2x.scala in its writeResponse() method decodes the operation as BulkGetKeysResponse, it runs a Map/Reduce job that returns a set of keys in the whole cluster.
> The operation returns a set of "unmarshalled" (cos we're in compatibility mode) entries. However, Scala infers the type of individual entries as "Bytes" which is an alias for Array[Byte]. 
> As a result, when this iterator from this key set is retrieved, it is not possible to iterate through the entries because Scala automatically tries to convert each (unmarshalled) entry into a byte array, which results in the exception.
> This line results in throwing CCE:
> https://github.com/infinispan/infinispan/blob/master/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Encoder2x.scala#L231
>  



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)



More information about the infinispan-issues mailing list