[ 
https://issues.apache.org/jira/browse/GEODE-9602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alberto Gomez updated GEODE-9602:
---------------------------------
    Description: 
The QueryObserver interface allows to create classes that would be notified 
about query events.

The way to set a QueryObserver is by means of the QueryObserverHolder class, 
that is able to hold a single instance of a QueryObserver.

This mechanism currently has two problems:
 * The QueryObserverHolder class is not thread-safe. The observer instance to 
be returned by the getInstance() class could return an undefined value.
 * Given that the observer is retrieved via the 
QueryObserverHolder::getInstance() method at different points of the query 
execution, it is possible that if several queries with different observers are 
run in parallel, the observers for the queries are changed in the middle of the 
query execution with unexpected results for the queries.

In order to solve the above problems, the following is proposed:
 * Make the QueryObserverHolder class thread-safe.
 * Allow for having an observer per query. A simple way to allow this is to set 
the observer in the query context when the query is started. That way, several 
queries could be run in parallel, each with its own observer.

Apart from the above, it's been observed that there are no QueryObserver 
before/after iteration evaluation 'callbacks' invoked when the query is using 
indexes.

It is also proposed to add these before/after IterationEvaluation callbacks so 
that they are called also when the query is using indexes.

  was:
The QueryObserver interface allows to create classes that would be notified 
about query events.

The way to set a QueryObserver is by means of the QueryObserverHolder class, 
that is able to hold a single instance of a QueryObserver.

This mechanism currently has two problems:
 * The QueryObserverHolder class is not thread-safe. The observer instance to 
be returned by the getInstance() class could return an undefined value.
 * Given that the observer is retrieved via the 
QueryObserverHolder::getInstance() method at different points of the query 
execution, it is possible that if several queries with different observers are 
run in parallel, the observers for the queries will be changed in the middle of 
the query execution with unexpected results for the queries.

In order to solve the above problems, the following is proposed:
 * Make the QueryObserverHolder class thread-safe.
 * Allow for having an observer per query. A simple way to allow this is to set 
the observer in the query context when the query is started. That way, several 
queries could be run in parallel, each with its own observer.

Apart from the above, it's been observed that there are no QueryObserver 
before/after iteration evaluation 'callbacks' invoked when the query is using 
indexes.

It is also proposed to add these before/after IterationEvaluation callbacks so 
that they are called also when the query is using indexes.


> QueryObserver improvements
> --------------------------
>
>                 Key: GEODE-9602
>                 URL: https://issues.apache.org/jira/browse/GEODE-9602
>             Project: Geode
>          Issue Type: Bug
>          Components: querying
>            Reporter: Alberto Gomez
>            Assignee: Alberto Gomez
>            Priority: Major
>
> The QueryObserver interface allows to create classes that would be notified 
> about query events.
> The way to set a QueryObserver is by means of the QueryObserverHolder class, 
> that is able to hold a single instance of a QueryObserver.
> This mechanism currently has two problems:
>  * The QueryObserverHolder class is not thread-safe. The observer instance to 
> be returned by the getInstance() class could return an undefined value.
>  * Given that the observer is retrieved via the 
> QueryObserverHolder::getInstance() method at different points of the query 
> execution, it is possible that if several queries with different observers 
> are run in parallel, the observers for the queries are changed in the middle 
> of the query execution with unexpected results for the queries.
> In order to solve the above problems, the following is proposed:
>  * Make the QueryObserverHolder class thread-safe.
>  * Allow for having an observer per query. A simple way to allow this is to 
> set the observer in the query context when the query is started. That way, 
> several queries could be run in parallel, each with its own observer.
> Apart from the above, it's been observed that there are no QueryObserver 
> before/after iteration evaluation 'callbacks' invoked when the query is using 
> indexes.
> It is also proposed to add these before/after IterationEvaluation callbacks 
> so that they are called also when the query is using indexes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to