Hum, I had totally forgotten about this code by Philipp W. But anyway, I recently looked into the problem as well [1] and I wasn't particularly happy because whatever I could come up with required client code to call CAS.release() explicitly - at least when trying to solve the problem in JCasIterable.
Addressing that only on the level of SimplePipeline may be more straight-forward. I'll look into that as well. Btw. feel free to comment on the issue if you have further insight or suggestions (or patches ;) ). Cheers, -- Richard [1] https://issues.apache.org/jira/browse/UIMA-3470 On 16.04.2014, at 11:27, Petr Baudis <pa...@ucw.cz> wrote: > Hi! > > On Wed, Apr 16, 2014 at 03:26:54PM +0900, Hugo Mougard wrote: >> I'm trying to use a multiplier to discard some CASes based on some >> annotation. It currently doesn't work (the CASes are not discarded). I >> also noticed several tickets opened on the suject of multipliers and >> am therefore not sure if it's currently possible to use them in >> UIMAfit. > > Perhaps a better solution exists meanwhile, but some time ago, > Philipp W suggested on this mailing list a SimplePipeline replacement > that can deal with CAS multipliers: > > https://groups.google.com/forum/#!topic/uimafit-users/yA0w2Q8tGNE > > I had to wrap it up in an actual class and fix it for Aggregate Engines, > my version is at: > > > https://github.com/brmson/yodaqa/blob/master/src/main/java/cz/brmlab/yodaqa/flow/MultiCASPipeline.java > > You just use it in the same way as you'd use SimplePipeline then, e.g.: > > > https://github.com/brmson/yodaqa/blob/9e12a80c/src/main/java/cz/brmlab/yodaqa/YodaQAApp.java > > > P.S.: I think ideally, to enable better scale-out and for consistency > if you are using other Aggregate Engines anyway, you would probably > create a single aggregate engine for your pipeline with the proper flow > controller setup within, setting FlowController's > ActionForIntermediateSegments > to "drop". In XML CPE descriptor you'd do that like this: > > > https://github.com/brmson/yodaqa/blob/bad64d5c/src/main/resources/cz/brmlab/yodaqa/pipeline/YodaQA.xml > > If you come up with a way to do that in UIMAfit, I will be glad if you'd > share a working code snippet. > > Petr "Pasky" Baudis