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

Nikolay Izhikov commented on IGNITE-425:
----------------------------------------

Hello, [~yzhdanov]

> Given we cannot distinguish newly created entry and one that existed before 
> query

We can distinguish create and update operation in filter and transformer.
We can pass that knowledge further to listener if we want to.

ContinuousQueryWithTransformer.java
{code:java}
    public Factory<? extends IgniteClosure<CacheEntryEvent<? extends K, ? 
extends V>, T>> getRemoteTransformerFactory() {
        return rmtTransFactory;
    }
{code}

CacheEntryEventFilter.java
{code:java}
public interface CacheEntryEventFilter<K, V> {
  boolean evaluate(CacheEntryEvent<? extends K, ? extends V> event)
      throws CacheEntryListenerException;
}
{code}

CacheEntryEvent.java
{code:java}
public abstract class CacheEntryEvent<K, V> extends EventObject  implements 
Cache.Entry<K, V> {
  public final EventType getEventType() {
    return eventType;
  }
}
{code}

> should we just remove it?

In my implementation, I try to minimize a difference between regular 
ContinuousQuery and ContinuousQueryWithTransformer.
I think it useful from user experience point of view.

> Introduce transformers for continuous queries
> ---------------------------------------------
>
>                 Key: IGNITE-425
>                 URL: https://issues.apache.org/jira/browse/IGNITE-425
>             Project: Ignite
>          Issue Type: Sub-task
>          Components: cache
>            Reporter: Yakov Zhdanov
>            Assignee: Nikolay Izhikov
>
> Currently if updated entry passes the filter, it is sent to node initiated 
> the query entirely. It would be good to provide user with the ability to 
> transform entry and, for example, select only fields that are important. This 
> may bring huge economy to traffic and lower GC pressure as well.
> Possible signatures will be:
> {noformat}
> public final class ContinuousQuery<K, V, T> {..} // T is a type transformer 
> transforms to
> public ContinuousQuery<K, V, T> setLocalListener(Listener<T> locLsnr) {..} // 
> Probably, we will have to introduce new listener type, since user may want to 
> wipe out key as well.
> /* new method to add */
> public ContinuousQuery<K, V, T> setRemoteTransformerFactory(Factory<? extends 
> ContinuousQueryTransformer<K, V, T>> factory) { ..}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to