Continuous Query With Transformer are ready for merge

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Continuous Query With Transformer are ready for merge

Nikolay Izhikov-2
Hello, Igniters.

Improvement of Continuous Query public API are ready for merge.
AFAIK Anton Vinogradov and Yakov Zhdanov are happy with proposed API. [1]

With this improvement we can transform entry on the server node before sending it to the listener to reduce network utilization.

Example of usage:

```
ContinuousQueryWithTransformer<Long, Value, T> cqwt = new ContinuousQueryWithTransformer<>();

cqwt.setRemoteTransformerFactory(FactoryBuilder.factoryOf(new IdTransformer()));

CQWTListener lsnr = new CQWTListener();

cqwt.setLocalListener(lsnr);

cache.query(cqwt);

public static class IdTransformer implements IgniteClosure<CacheEntryEvent<? extends Long, ? extends Value>, Long> {
   @Override public Long apply(CacheEntryEvent<? extends Long, ? extends Value> event) {
       return event.getValue().id;
   }
}

public static class CQWTListener<Long> implements EventListener<Long> {
   @Override public void onUpdated(Iterable<? extends Long> ids) {
       for (Long id : ids)
          consume(id);
   }
}

```

Implementation checked on TC, benchmarks [2][3] passed as well and we’re ready to merge changes to the master branch.

Any objections?

[1] https://github.com/apache/ignite/pull/2372
[2] https://github.com/nizhikov/ignite-425-benchmark
[3] https://issues.apache.org/jira/browse/IGNITE-425?focusedCommentId=16353812&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16353812 

signature.asc (465 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Continuous Query With Transformer are ready for merge

Anton Vinogradov-2
Looks like no one have objections.

Nikolay,
Let's merge.

On Tue, Feb 6, 2018 at 8:45 PM, Nikolay Izhikov <[hidden email]> wrote:

> Hello, Igniters.
>
> Improvement of Continuous Query public API are ready for merge.
> AFAIK Anton Vinogradov and Yakov Zhdanov are happy with proposed API. [1]
>
> With this improvement we can transform entry on the server node before
> sending it to the listener to reduce network utilization.
>
> Example of usage:
>
> ```
> ContinuousQueryWithTransformer<Long, Value, T> cqwt = new
> ContinuousQueryWithTransformer<>();
>
> cqwt.setRemoteTransformerFactory(FactoryBuilder.factoryOf(new
> IdTransformer()));
>
> CQWTListener lsnr = new CQWTListener();
>
> cqwt.setLocalListener(lsnr);
>
> cache.query(cqwt);
>
> public static class IdTransformer implements IgniteClosure<CacheEntryEvent<?
> extends Long, ? extends Value>, Long> {
>    @Override public Long apply(CacheEntryEvent<? extends Long, ? extends
> Value> event) {
>        return event.getValue().id;
>    }
> }
>
> public static class CQWTListener<Long> implements EventListener<Long> {
>    @Override public void onUpdated(Iterable<? extends Long> ids) {
>        for (Long id : ids)
>           consume(id);
>    }
> }
>
> ```
>
> Implementation checked on TC, benchmarks [2][3] passed as well and we’re
> ready to merge changes to the master branch.
>
> Any objections?
>
> [1] https://github.com/apache/ignite/pull/2372
> [2] https://github.com/nizhikov/ignite-425-benchmark
> [3] https://issues.apache.org/jira/browse/IGNITE-425?
> focusedCommentId=16353812&page=com.atlassian.jira.
> plugin.system.issuetabpanels:comment-tabpanel#comment-16353812
Reply | Threaded
Open this post in threaded view
|

Re: Continuous Query With Transformer are ready for merge

Nikolay Izhikov-2
Anton,

The merge is done!

Thank you, very much.
Your help can't be overestimated.

В Чт, 08/02/2018 в 12:38 +0300, Anton Vinogradov пишет:

> Looks like no one have objections.
>
> Nikolay,
> Let's merge.
>
> On Tue, Feb 6, 2018 at 8:45 PM, Nikolay Izhikov <[hidden email]> wrote:
>
> > Hello, Igniters.
> >
> > Improvement of Continuous Query public API are ready for merge.
> > AFAIK Anton Vinogradov and Yakov Zhdanov are happy with proposed API. [1]
> >
> > With this improvement we can transform entry on the server node before
> > sending it to the listener to reduce network utilization.
> >
> > Example of usage:
> >
> > ```
> > ContinuousQueryWithTransformer<Long, Value, T> cqwt = new
> > ContinuousQueryWithTransformer<>();
> >
> > cqwt.setRemoteTransformerFactory(FactoryBuilder.factoryOf(new
> > IdTransformer()));
> >
> > CQWTListener lsnr = new CQWTListener();
> >
> > cqwt.setLocalListener(lsnr);
> >
> > cache.query(cqwt);
> >
> > public static class IdTransformer implements IgniteClosure<CacheEntryEvent<?
> > extends Long, ? extends Value>, Long> {
> >    @Override public Long apply(CacheEntryEvent<? extends Long, ? extends
> > Value> event) {
> >        return event.getValue().id;
> >    }
> > }
> >
> > public static class CQWTListener<Long> implements EventListener<Long> {
> >    @Override public void onUpdated(Iterable<? extends Long> ids) {
> >        for (Long id : ids)
> >           consume(id);
> >    }
> > }
> >
> > ```
> >
> > Implementation checked on TC, benchmarks [2][3] passed as well and we’re
> > ready to merge changes to the master branch.
> >
> > Any objections?
> >
> > [1] https://github.com/apache/ignite/pull/2372
> > [2] https://github.com/nizhikov/ignite-425-benchmark
> > [3] https://issues.apache.org/jira/browse/IGNITE-425?
> > focusedCommentId=16353812&page=com.atlassian.jira.
> > plugin.system.issuetabpanels:comment-tabpanel#comment-16353812

signature.asc (465 bytes) Download Attachment