You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Rupert Westenthaler <rw...@apache.org> on 2011/04/15 14:06:51 UTC

EnhancementEngines and OfflineMode (related to STANBOL-162)

Hi

The LocationEnhancementEngine (geonames.org) defines an dependency to
"OnlineMode" so if the "OfflineMode" is activated this dependency
would be no longer available and the Engine would be deactivated by
OSGI.

Fot the ReferencedSiteEntityTaggingEnhancementEngine this decision is
not static but depends on
 (1) The configuration of the ReferencedSite (if a local Cache is
configured and the used CacheStrategy supports queries on the local
cache
 (2) If the local Cache is currently active

Note also that this engine uses "configurationFactory = true" so there
may be multiple instances using different referenced sites.

The question is:

Is it enough to
 (a) avoid the execution of the computeEnhancements(...) in cases it
is not possible because Stanbol operates in OfflineMode or
 (b) is it required to deactivate the enhancement engine.

The current implementation does (a)

computeEnhancements(...) {
    ...
    if(isOfflineMode() && !site.supportsLocalMode()){
        log.warn("Unable to enhance ci {} because "+
            "OfflineMode is not supported by ReferencedSite {}.",
            ci.getId(),site.getId());
        return;
    }
    ...
}

For (b) I would not even know how to implement the dynamic
removal/adding of services if either
 - offline mode is enabled/disabled or
 - offline mode is active but because of an other change an Engine can
no longer operate in offline mode


In summary
(a) only ensures that no remote services are called in OfflineMode it
does not communicate to the JobManager that an Engine can no longer be
used
(b) would only deactivate the engine, but also not tell why this
engine is no longer available

so maybe we need a (c) where an engine can communicate some status
messages to the JobManager and extend the user interface.

WDYT
Rupert

-- 
| Rupert Westenthaler                            rwesten@apache.org
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: EnhancementEngines and OfflineMode (related to STANBOL-162)

Posted by Olivier Grisel <ol...@ensta.org>.
2011/4/15 Rupert Westenthaler <rw...@apache.org>:
> Hi
>
> The LocationEnhancementEngine (geonames.org) defines an dependency to
> "OnlineMode" so if the "OfflineMode" is activated this dependency
> would be no longer available and the Engine would be deactivated by
> OSGI.
>
> Fot the ReferencedSiteEntityTaggingEnhancementEngine this decision is
> not static but depends on
>  (1) The configuration of the ReferencedSite (if a local Cache is
> configured and the used CacheStrategy supports queries on the local
> cache
>  (2) If the local Cache is currently active
>
> Note also that this engine uses "configurationFactory = true" so there
> may be multiple instances using different referenced sites.
>
> The question is:
>
> Is it enough to
>  (a) avoid the execution of the computeEnhancements(...) in cases it
> is not possible because Stanbol operates in OfflineMode or
>  (b) is it required to deactivate the enhancement engine.
>

I think (a) is good enough for now. We might revise this once we
implement configurable engines chains.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: EnhancementEngines and OfflineMode (related to STANBOL-162)

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Rupert,

On Sat, Apr 16, 2011 at 8:06 PM, Rupert Westenthaler <rw...@apache.org> wrote:
> On Fri, Apr 15, 2011 at 2:16 PM, Bertrand Delacretaz
> <bd...@apache.org> wrote:
>> Maybe later...the simplest might be be an additional return value for
>> canEnhance(...): the reason why that method returns no, "system is
>> offline" in this case, or a specific return value.
>
> In my opinion canEnhance(...) can not be used, because the state can
> change between the calls to canEnhance(...) and
> computeEnhancements(...) - especially if the Enhancements are
> calculated.
> This is also the reason, why I do not check for offlineMode in canEnhance(...).

Ok, makes sense.

>
> However we could use an Integer that indicates the state as return
> value to computeEnhancements(...).
>
> An other possibility would be that Engines add informations about the
> states to the Enhancement Results.

I'd prefer the former option: a return value that indicates what happened.

> Based on the feedback I will mark STANBOL-162 as resloved

Ok, thanks for taking care of this.

-Bertrand

Re: EnhancementEngines and OfflineMode (related to STANBOL-162)

Posted by Rupert Westenthaler <rw...@apache.org>.
On Fri, Apr 15, 2011 at 2:16 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
> Maybe later...the simplest might be be an additional return value for
> canEnhance(...): the reason why that method returns no, "system is
> offline" in this case, or a specific return value.

In my opinion canEnhance(...) can not be used, because the state can
change between the calls to canEnhance(...) and
computeEnhancements(...) - especially if the Enhancements are
calculated.
This is also the reason, why I do not check for offlineMode in canEnhance(...).

However we could use an Integer that indicates the state as return
value to computeEnhancements(...).

An other possibility would be that Engines add informations about the
states to the Enhancement Results.

Based on the feedback I will mark STANBOL-162 as resloved

best
Rupert


-- 
| Rupert Westenthaler                            rwesten@apache.org
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: EnhancementEngines and OfflineMode (related to STANBOL-162)

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Fri, Apr 15, 2011 at 2:06 PM, Rupert Westenthaler <rw...@apache.org> wrote:
> ...In summary
> (a) only ensures that no remote services are called in OfflineMode it
> does not communicate to the JobManager that an Engine can no longer be
> used...

I agree with Olivier that that's good enough for now. It would be good
though for canEnhance(...) to be consistent and return false when
offline and computeEnhancements will do nothing.

> (b) would only deactivate the engine, but also not tell why this
> engine is no longer available
>
> so maybe we need a (c) where an engine can communicate some status
> messages to the JobManager and extend the user interface....

Maybe later...the simplest might be be an additional return value for
canEnhance(...): the reason why that method returns no, "system is
offline" in this case, or a specific return value.

-Bertrand