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

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

After some discussion with [~agingade], we came up with the following proposal:

# Change the behavior of calling ResultSender.sendResult/lastResult with an 
exception. Anything passed to sendResult/lastResult will be passed on directly 
to ResultCollector.addResult, including exceptions.
# Deprecate sendException. It will retain the current behavior where 
ResultSender.sendException gets passed to ResultCollector.addResult.
# Add a new method on the ResultCollector, addThrowable, that will receive any 
exceptions thrown by the function during execution. Currently the user's 
ResultCollector never sees these exceptions, so ResultCollector will have a 
default implementation of this method that will just ignore the exception.
# Add a method on the ResultSender, sendThrowable, that will behave the same as 
throwing an exception from the function. 

> 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: Dan Smith
>
> 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)

Reply via email to