You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Pim D <pi...@ns.nl> on 2018/01/20 18:00:21 UTC

DataStreamer does not persist in cache when a receiver is set

Hi,

I have created a datastreamer that will stream data from a database to my
cache.
This works very nice, untill...
... I include a StreamTransformer in the data streamer.
When the transformer is set, nothing gets stored in the cache?!?

In a simple example my transformer extends the StreamTransformer and
implements process:
    @Override
    public Object process(MutableEntry<String, Integer> entry, Object...
arg) throws EntryProcessorException {
        if (log.isDebugEnabled())
            log.debug("Laad " + entry.getKey() + " in de cache");
        if (arg.length==1 && arg[0] instanceof HighScore) {
            // Transformeer stream argument naar het cache object en zet
deze
            entry.setValue((Integer) arg[0]);
        }
        return arg[0];
    }

Eventually I would really like to transform the object read from the
database to a new object which corresponds with my cache value object (basic
ETL).
But for now I first need to get the Streamer to work properly.
Any clues why this is not working?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: DataStreamer does not persist in cache when a receiver is set

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,

Please share a full code of your EntryProcessor. Which logger do you use
here?

Thanks,
Evgenii

2018-01-20 21:00 GMT+03:00 Pim D <pi...@ns.nl>:

> Hi,
>
> I have created a datastreamer that will stream data from a database to my
> cache.
> This works very nice, untill...
> ... I include a StreamTransformer in the data streamer.
> When the transformer is set, nothing gets stored in the cache?!?
>
> In a simple example my transformer extends the StreamTransformer and
> implements process:
>     @Override
>     public Object process(MutableEntry<String, Integer> entry, Object...
> arg) throws EntryProcessorException {
>         if (log.isDebugEnabled())
>             log.debug("Laad " + entry.getKey() + " in de cache");
>         if (arg.length==1 && arg[0] instanceof HighScore) {
>             // Transformeer stream argument naar het cache object en zet
> deze
>             entry.setValue((Integer) arg[0]);
>         }
>         return arg[0];
>     }
>
> Eventually I would really like to transform the object read from the
> database to a new object which corresponds with my cache value object
> (basic
> ETL).
> But for now I first need to get the Streamer to work properly.
> Any clues why this is not working?
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>