geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Smith (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-625) A function's ResultCollector throws ClassCastException when ResultSender.sendException is invoked
Date Tue, 08 Dec 2015 00:39:11 GMT

    [ https://issues.apache.org/jira/browse/GEODE-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15046061#comment-15046061
] 

Dan Smith commented on GEODE-625:
---------------------------------

On the ResultSender, there is a method to return exceptions using sendException.

However, the ResultCollector only has addResult(). Further, ResultCollector has generic types

public interface ResultCollector<T,S> {
  public void addResult(DistributedMember memberID, T resultOfSingleExecution);

Since the type of T is the user result type, trying to call add result will almost invariably
result in the ClassCastException. We should add an addException method to the ResultCollector
interface.

> A function's ResultCollector throws ClassCastException when ResultSender.sendException
is invoked
> -------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-625
>                 URL: https://issues.apache.org/jira/browse/GEODE-625
>             Project: Geode
>          Issue Type: Bug
>          Components: functions
>            Reporter: Ashvin
>            Assignee: Ashvin
>
> For e.g. If LuceneFunction.execute invokes resultSender.sendException, the following
error is generated.
> {code}
> java.lang.ClassCastException: java.lang.IllegalArgumentException cannot be cast to com.gemstone.gemfire.cache.lucene.int
> ernal.distributed.TopEntriesCollector
> 	at com.gemstone.gemfire.cache.lucene.internal.distributed.TopEntriesFunctionCollector.addResult(TopEntriesFunctionColle
> ctor.java:1)
> 	at com.gemstone.gemfire.internal.cache.execute.LocalResultCollectorImpl.addResult(LocalResultCollectorImpl.java:76)
> 	at com.gemstone.gemfire.internal.cache.execute.PartitionedRegionFunctionResultSender.lastResult(PartitionedRegionFuncti
> onResultSender.java:208)
> 	at com.gemstone.gemfire.internal.cache.execute.PartitionedRegionFunctionResultSender.lastResult(PartitionedRegionFuncti
> onResultSender.java:166)
> 	at com.gemstone.gemfire.internal.cache.execute.PartitionedRegionFunctionResultSender.sendException(PartitionedRegionFun
> ctionResultSender.java:301)
> 	at com.gemstone.gemfire.cache.lucene.internal.distributed.LuceneFunction.execute(LuceneFunction.java:52)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message