ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saurabh Sharma <saurabh.sha...@nviz.com>
Subject Issue while extending out of the box classes
Date Wed, 27 Jan 2016 06:41:53 GMT
Hi,

I am facing issue while trying to extend any out of the box Ignite classes. I am trying to
extend DataStreamerImpl class and overriding addData(K,V) method to do extra processing before
saving it to cache.
I did not find bean definitions defined in Bean configuration file except Ignite configuration
in Ignite.

If I need to extend any bean which has parametrized constructor then I had to define that
constructor of base class into my child class. I passed constructor argument through Bean
configuration file.

public CustomStreamer(
               final GridKernalContext ctx,
               @Nullable final String cacheName,
               DelayQueue<DataStreamerImpl<K, V>> flushQ) {
              super(ctx, cacheName, flushQ);
       }

<bean id="igniteStreamer" class="org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl"/>
<bean id="kafkaStreamer" class="com.ignite.streamer.CustomStreamer " parent="igniteStreamer">
              <constructor-arg ref="ignite.ctx" index="0"/>
              <constructor-arg type="java.lang.String" value="igfs-data" index="1"/>
              <constructor-arg ref="delayQueue" index="2"/>
</bean>

But then it gave error for GridKernalContextImpl class like no default constructor defined
which got resolved when I extended this class and defined parameterized constructor. But then
again it contains many objects in constructor for which I again have to define beans and constructor
arguments.

I wanted to confirm if this is the right approach or am I missing anything here.

Thanks,
Saurabh

Mime
View raw message