incubator-s4-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Morel <matth...@yahoo-inc.com>
Subject Re: 回复: ontime()
Date Mon, 13 May 2013 15:14:20 GMT
Well it seems that your processing element is not thread safe. So why would you annotate it
with @ThreadSafe?

Matthieu

On May 13, 2013, at 16:24 , 唐装鼠 wrote:

Hi,I annotated the PE subclass threadsafe.However,errors still come out,as below:
<8518B0D2@37CC8D1F.97F79051.jpg<mailto:8518B0D2@37CC8D1F.97F79051.jpg>>
I don't know where I'm wrong.Can you help me ?
Thanks very much!
------------------ 原始邮件 ------------------
发件人: "Matthieu Morel"<matthieu@yahoo-inc.com<mailto:matthieu@yahoo-inc.com>>;
发送时间: 2013年5月13日(星期一) 下午5:27
收件人: "<s4-user@incubator.apache.org<mailto:s4-user@incubator.apache.org>>"<s4-user@incubator.apache.org<mailto:s4-user@incubator.apache.org>>;
主题: Re: ontime()


Hi,

the thread safe annotation comes from "java concurrency in practice" APIs: http://jcip.net.s3-website-us-east-1.amazonaws.com/annotations/doc/index.html

Please check the isThreadSafe method in ProcessingElement for an explanation of implications
in S4. If the PE class is annotated with @ThreadSafe, the isThreadSafe() method will return
true and no lock will be taken on the PE when executing the "onTime" method (i.e. periodic
operation may run concurrently with the processing of on or multiple events).

Hope this helps,

Matthieu


On May 13, 2013, at 10:16 , 唐装鼠 wrote:

> Hi,I'm new to java and s4.
> in my project,I want to use the method onTime().
> The javadoc says theProcessingElement subclass must be annotated with ThreadSafe.
> However,I don't know how to annotate threadsafe.Can someone help me?
> Thanks!

.


Mime
View raw message