You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Ar...@bka.bund.de on 2014/11/06 09:17:10 UTC

Exception handling

Hi!

An exception in an analysis engine causes the whole pipeline to crash. That’s not what I want? The processing of the current document should stop. To do so, I can catch the exception in that engine. But afterwards no more engines should touch that document. The pipeline should continue with the next document. How to do that?

Thanks,
Armin



Re: AW: Exception handling

Posted by Sumit Madan <su...@scai.fraunhofer.de>.
On 11/11/14 09:37, Armin.Wegner@bka.bund.de wrote:
> Hello Sumit and Richard!

Hi Armin,

>
> I've used CpeBuilder from uimaFIT as basis for my own. Essentially, I removed setAnalysisEngine() and made addProcessor() public. Doing so I can set everything I need so far. But it's a very specific and therefore limited first try. Nothing to be contributed yet.
>
> There is another kind of issue. CollectionProcessingEngine.process() starts the CPE in a new thread but never notifies when it's done. Is this correct? I adapted the StatusCallbackListener from the CPE example in uimaj-examples for my needs. Is this really the way it's meant to be?

Yes, I think so. Here we are using our own version of 
StatusCallbackListener to handle this issue too. Additionally, we are 
calculating initialization, processing time and creating some 
performance statistics too.

I think UIMAFit is tracking all the thrown Exceptions for an entity in 
an object and throwing the first one after the entity has been 
processed. We are logging all the exceptions and not throwing them. It 
might be needed for the ActionOnMaxError=continue case. So there some 
small changes in our version.

> Thanks,
> Armin

-- 
Mit freundlichem Gruß / Best regards

Sumit Madan

Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Schloss Birlinghoven
D-53754 Sankt Augustin

Room: C3-140
Tel.: +49 2241 14 2997
E-mail: sumit.madan@scai.fraunhofer.de
Internet: http://www.scai.fraunhofer.de/


AW: Exception handling

Posted by Ar...@bka.bund.de.
Hello Sumit and Richard!

I've used CpeBuilder from uimaFIT as basis for my own. Essentially, I removed setAnalysisEngine() and made addProcessor() public. Doing so I can set everything I need so far. But it's a very specific and therefore limited first try. Nothing to be contributed yet.

There is another kind of issue. CollectionProcessingEngine.process() starts the CPE in a new thread but never notifies when it's done. Is this correct? I adapted the StatusCallbackListener from the CPE example in uimaj-examples for my needs. Is this really the way it's meant to be?

Thanks,
Armin


-----Ursprüngliche Nachricht-----
Von: Richard Eckart de Castilho [mailto:rec@apache.org] 
Gesendet: Freitag, 7. November 2014 14:04
An: user@uima.apache.org
Betreff: Re: Exception handling

Hi,

the CpeBuilder implementation is very basic. Please feel invited to file issues against it - and of course you can also submit patches if you have them ;)

Cheers,

-- Richard

On 07.11.2014, at 13:34, <Ar...@bka.bund.de> <Ar...@bka.bund.de> wrote:

> Hi Sumit!
> 
> Setting dropCasOnException works. org.apache.uima.fit.cpe.CpeBuilder::createProcessor() is private and ACTION_ON_MAX_ERROR a static field. It seems to me that the CpeBuilder is missing some methods. There should be a method to create a new processor from a given analysis engine with some of those options and add (not set) it to the CPE, just as with AggregateBuilder. 
> 
> Thanks,
> Armin


Re: Exception handling

Posted by Richard Eckart de Castilho <re...@apache.org>.
Hi,

the CpeBuilder implementation is very basic. Please feel invited to file issues against it - and of course you can also submit patches if you have them ;)

Cheers,

-- Richard

On 07.11.2014, at 13:34, <Ar...@bka.bund.de> <Ar...@bka.bund.de> wrote:

> Hi Sumit!
> 
> Setting dropCasOnException works. org.apache.uima.fit.cpe.CpeBuilder::createProcessor() is private and ACTION_ON_MAX_ERROR a static field. It seems to me that the CpeBuilder is missing some methods. There should be a method to create a new processor from a given analysis engine with some of those options and add (not set) it to the CPE, just as with AggregateBuilder. 
> 
> Thanks,
> Armin


Re: AW: AW: Exception handling

Posted by Sumit Madan <su...@scai.fraunhofer.de>.
On 07/11/14 13:34, Armin.Wegner@bka.bund.de wrote:
> Hi Sumit!

Hi Armin,

> Setting dropCasOnException works. org.apache.uima.fit.cpe.CpeBuilder::createProcessor() is private and ACTION_ON_MAX_ERROR a static field. It seems to me that the CpeBuilder is missing some methods. There should be a method to create a new processor from a given analysis engine with some of those options and add (not set) it to the CPE, just as with AggregateBuilder.

Yes I know, long time ago we have added our own class based on 
CpeBuilder but not using CpeBuilder as the API doesn't allow to change 
stuff. I think you can/have to do that too.

We should file a bug for UIMAFit and create a patch too. I will put this 
on my todo list.

> Thanks,
> Armin
>
-- 
Mit freundlichem Gruß / Best regards

Sumit Madan

Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Schloss Birlinghoven
D-53754 Sankt Augustin

Room: C3-140
Tel.: +49 2241 14 2997
E-mail: sumit.madan@scai.fraunhofer.de
Internet: http://www.scai.fraunhofer.de/


AW: AW: Exception handling

Posted by Ar...@bka.bund.de.
Hi Sumit!

Setting dropCasOnException works. org.apache.uima.fit.cpe.CpeBuilder::createProcessor() is private and ACTION_ON_MAX_ERROR a static field. It seems to me that the CpeBuilder is missing some methods. There should be a method to create a new processor from a given analysis engine with some of those options and add (not set) it to the CPE, just as with AggregateBuilder. 

Thanks,
Armin

-----Ursprüngliche Nachricht-----
Von: Sumit Madan [mailto:sumit.madan@scai.fraunhofer.de] 
Gesendet: Freitag, 7. November 2014 11:52
An: user@uima.apache.org
Betreff: Re: AW: Exception handling

On 07/11/14 11:39, Armin.Wegner@bka.bund.de wrote:
> Hi Sumit,

Hi Armin,

> I've got a CPE up and running. But where do the interfaces CpeIntegratedCasProcessor and CpeCasProcessors fit in? Can you point me to some documentation or example source code, please?

yeah sure.

Check the method in the 
org.apache.uima.fit.cpe.CpeBuilder::createProcessor(). In this method 
you can set the ActionOnMaxError. Currently, it is defined to terminate 
the pipeline when an exception occurs.

Check the method org.apache.uima.fit.cpe.CpeBuilder::createCpe(). In the 
method after the call of setProcessingUnitThreadCount() you can call 
cpeDesc.getCpeCasProcessors().setAttributeValue("dropCasOnException", 
<VALUE>) to set the dropCasOnException Value.

Documentation can be found under 
http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/references/references.html#ugr.ref.xml.cpe_descriptor.descriptor.cas_processors.individual. 
See the errorHandling element.

Hope it helps.

Regards
   Sumit

> Thanks,
> Armin

-- 
Mit freundlichem Gruß / Best regards

Sumit Madan

Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Schloss Birlinghoven
D-53754 Sankt Augustin

Room: C3-140
Tel.: +49 2241 14 2997
E-mail: sumit.madan@scai.fraunhofer.de
Internet: http://www.scai.fraunhofer.de/


Re: AW: Exception handling

Posted by Sumit Madan <su...@scai.fraunhofer.de>.
On 07/11/14 11:39, Armin.Wegner@bka.bund.de wrote:
> Hi Sumit,

Hi Armin,

> I've got a CPE up and running. But where do the interfaces CpeIntegratedCasProcessor and CpeCasProcessors fit in? Can you point me to some documentation or example source code, please?

yeah sure.

Check the method in the 
org.apache.uima.fit.cpe.CpeBuilder::createProcessor(). In this method 
you can set the ActionOnMaxError. Currently, it is defined to terminate 
the pipeline when an exception occurs.

Check the method org.apache.uima.fit.cpe.CpeBuilder::createCpe(). In the 
method after the call of setProcessingUnitThreadCount() you can call 
cpeDesc.getCpeCasProcessors().setAttributeValue("dropCasOnException", 
<VALUE>) to set the dropCasOnException Value.

Documentation can be found under 
http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/references/references.html#ugr.ref.xml.cpe_descriptor.descriptor.cas_processors.individual. 
See the errorHandling element.

Hope it helps.

Regards
   Sumit

> Thanks,
> Armin

-- 
Mit freundlichem Gruß / Best regards

Sumit Madan

Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Schloss Birlinghoven
D-53754 Sankt Augustin

Room: C3-140
Tel.: +49 2241 14 2997
E-mail: sumit.madan@scai.fraunhofer.de
Internet: http://www.scai.fraunhofer.de/


AW: Exception handling

Posted by Ar...@bka.bund.de.
Hi Sumit,

I've got a CPE up and running. But where do the interfaces CpeIntegratedCasProcessor and CpeCasProcessors fit in? Can you point me to some documentation or example source code, please?

Thanks,
Armin

-----Ursprüngliche Nachricht-----
Von: Sumit Madan [mailto:sumit.madan@scai.fraunhofer.de] 
Gesendet: Donnerstag, 6. November 2014 15:30
An: user@uima.apache.org
Betreff: Re: Exception handling

Hi Armin,

I think you can use thes option DropCasOnException and ActionOnMaxError. 
The last option can have three values: disable, terminate and continue.

See methods:
  - CpeIntegratedCasProcessor::setActionOnMaxError()
  - CpeCasProcessors::setAttributeValue() to set dropCasOnException.

Regards
   Sumit


On 06/11/14 10:02, Richard Eckart de Castilho wrote:
> I think that the CPE can do something like that. Otherwise, it sounds like something that might be realizable through a custom flow controller.
>
> Cheers,
>
> -- Richard
>
> On 06.11.2014, at 09:17, Armin.Wegner@bka.bund.de wrote:
>
>> Hi!
>>   
>> An exception in an analysis engine causes the whole pipeline to crash. That’s not what I want? The processing of the current document should stop. To do so, I can catch the exception in that engine. But afterwards no more engines should touch that document. The pipeline should continue with the next document. How to do that?
>>   
>> Thanks,
>> Armin


-- 
Mit freundlichem Gruß / Best regards

Sumit Madan

Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Schloss Birlinghoven
D-53754 Sankt Augustin

Room: C3-140
Tel.: +49 2241 14 2997
E-mail: sumit.madan@scai.fraunhofer.de
Internet: http://www.scai.fraunhofer.de/


Re: Exception handling

Posted by Sumit Madan <su...@scai.fraunhofer.de>.
Hi Armin,

I think you can use thes option DropCasOnException and ActionOnMaxError. 
The last option can have three values: disable, terminate and continue.

See methods:
  - CpeIntegratedCasProcessor::setActionOnMaxError()
  - CpeCasProcessors::setAttributeValue() to set dropCasOnException.

Regards
   Sumit


On 06/11/14 10:02, Richard Eckart de Castilho wrote:
> I think that the CPE can do something like that. Otherwise, it sounds like something that might be realizable through a custom flow controller.
>
> Cheers,
>
> -- Richard
>
> On 06.11.2014, at 09:17, Armin.Wegner@bka.bund.de wrote:
>
>> Hi!
>>   
>> An exception in an analysis engine causes the whole pipeline to crash. That’s not what I want? The processing of the current document should stop. To do so, I can catch the exception in that engine. But afterwards no more engines should touch that document. The pipeline should continue with the next document. How to do that?
>>   
>> Thanks,
>> Armin


-- 
Mit freundlichem Gruß / Best regards

Sumit Madan

Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Schloss Birlinghoven
D-53754 Sankt Augustin

Room: C3-140
Tel.: +49 2241 14 2997
E-mail: sumit.madan@scai.fraunhofer.de
Internet: http://www.scai.fraunhofer.de/


Re: Exception handling

Posted by Richard Eckart de Castilho <re...@apache.org>.
I think that the CPE can do something like that. Otherwise, it sounds like something that might be realizable through a custom flow controller.

Cheers,

-- Richard

On 06.11.2014, at 09:17, Armin.Wegner@bka.bund.de wrote:

> Hi!
>  
> An exception in an analysis engine causes the whole pipeline to crash. That’s not what I want? The processing of the current document should stop. To do so, I can catch the exception in that engine. But afterwards no more engines should touch that document. The pipeline should continue with the next document. How to do that?
>  
> Thanks,
> Armin