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

Marshall Schor edited comment on UIMA-5256 at 1/17/17 4:12 PM:
---------------------------------------------------------------

The problem seems to be: some path is taken in this sequence: 
* some type system is committed, and the Ruta types are set up for a process
* the Ruta types are cleared (after running some tests)
* a new type system is loaded, but it happens to be identical to a previously 
committed one
* the Ruta types are not initialized, even though they have been cleared, 
because the new type system which was just loaded and committed, was found to 
be "equal" to a previously committed type system, and so the previous type 
system is used.  This causes the Ruta types at this point (having been cleared) 
to never get initialized.

Summary: in v2, loading and committing a type system into a CAS always resulted 
in that type system never being "==" to any previous type system.  In v3, this 
no longer is true; loaded and committed type systems are compared using an 
"equal" style comparison to previous loaded ones, and if one is found it is 
reused instead (this reduces cache footprints, etc.).

These changes are not committed (pending your review :-) ).  I'll attach a 
patch.


was (Author: schor):
The problem seems to be: some path is taken in this sequence: 
* some type system is committed, and the Ruta types are set up for a process
* the Ruta types are cleared (after running some tests)
* a new type system is loaded, but it happens to be identical to a previously 
committed one
* the Ruta types are not initialized, even though they have been cleared, 
because the new type system which was just loaded and committed, was found to 
be "equal" to a previously committed type system, and so the previous type 
system is used.  This causes the Ruta types at this point (having been cleared) 
to never get initialized.

These changes are not committed (pending your review :-) ).  I'll attach a 
patch.

> Ruta/uv3 accomodation, ruta-core
> --------------------------------
>
>                 Key: UIMA-5256
>                 URL: https://issues.apache.org/jira/browse/UIMA-5256
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Ruta
>    Affects Versions: 2.5.0ruta
>            Reporter: Marshall Schor
>            Assignee: Peter Klügl
>            Priority: Minor
>             Fix For: 2.5.1ruta
>
>         Attachments: patch.txt
>
>
> These are the minor changes I made to ruta-core to accomodate UIMA v3; I 
> believe they are compatible with V2.
> in Ruta.java
> - the 2nd "inject" method, change the 2nd arg from Annotation ... to 
> FeatureStructureImpl ...
> - remove the 3rd "inject" method - now covered by 2nd.
> - change getAddresses arg list to have type FeatureStructureImpl[]
> - remove the 2nd getAddresses method (now covered by previous one).
> These (above) changes accomodate the fact that there's just one impl of 
> Annotation in v3, and AnnotationImpl is now an interface.
> ============
> In RutaEngine, the process method sets a variable:
> boolean typeSystemChanged = lastTypeSystem != cas.getTypeSystem();
>  
> In UIMA V3, loading a new type system which is identical to a previously 
> committed type system, results in the cas.getTypeSystem being == to the 
> "lastTypeSystem".  So as a result, you can't use this to determine if a new 
> type system was loaded.  The line 484 fails for one test because of this.  
> The workaround is to set "typeSystemChanged" to true, always.  But you might 
> have a better solution.



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

Reply via email to