xiaoyangren / dkpro-core-asl

Automatically exported from code.google.com/p/dkpro-core-asl
0 stars 0 forks source link

Share the same model instance between multiple instances #250

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Now we get the URL from the resolver, but still every instance of the 
StanfordParser (or some other component) UIMA component would load a model 
instance. It should be possible to plug in the instantiation code as a callback 
to the model resolver.

The autoresolver needs to take care of caching the last retrieved model, so 
that if the same model is requested again it is not loaded again. 

Also to avoid multi threading issues, its probably best to make getModel 
"synchronized"

Original issue reported on code.google.com by richard.eckart on 22 Sep 2013 at 3:05

GoogleCodeExporter commented 9 years ago

Original comment by richard.eckart on 19 Dec 2013 at 1:59

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2887.

- Resource handle was not held by resource provider that created the resource 
in the first place

Original comment by richard.eckart on 5 Oct 2014 at 4:00

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2889.

- Remove explicit sharing parameter in StanfordParser
- Introduce general mechanism to enable resource sharing in any component via 
system properties

Original comment by richard.eckart on 5 Oct 2014 at 4:58

GoogleCodeExporter commented 9 years ago
To enable resource sharing for any component that uses a resource provider, you 
can set a system property, e.g. to enable resource sharing in the 
StanfordParser component use:

String prop = "dkpro.core.resourceprovider.sharable." + 
StanfordParser.class.getName();
System.setProperty(prop, "true");

Mind this is still experimental code and may be removed or implemented 
differently at a later stage.

Original comment by richard.eckart on 5 Oct 2014 at 5:00

GoogleCodeExporter commented 9 years ago

Original comment by richard.eckart on 11 Oct 2014 at 7:10

GoogleCodeExporter commented 9 years ago
The move to 1.8.0 does not mean that this feature is removed in 1.7.0. It is 
just a function of the feature being experimental in 1.7.0. I hope that for the 
next release, we find some time to figure out which models we could enabled 
sharing for by default. Also the mechanism for enabling sharing might be 
changed again, e.g. from enabling/disabling it globally to for certain 
components to enable/disable it for specific instances of components, e.g. via 
some PARAM_XXX again.

If you use this feature and like it, please comment here to help us find a good 
and more permanent solution for 1.8.0.

Original comment by richard.eckart on 11 Oct 2014 at 7:28