You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Junfeng Chen <k-...@hotmail.com> on 2014/10/20 08:14:19 UTC

DRPC problem

Hi, I am a newbie for the Storm. Now I meet a problem about DRPC. 

 

In the BasicDRPCTopology of sample code, drpc.execute("exclamation", word)
return a String as the result. I don't understand how the DRPC return the
emitted value in ExclaimBolt as it declares two Tuples as output format,
while it just return "result" field. I tried to discover the source code but
no source file of the class "LocalDRPC" can be found in
storm-core\src\jvm\backtype\storm path. Could somebody explain for me?
Thanks a lot. 

 

Regard,

Junfeng Chen

 


答复: 答复: DRPC problem

Posted by Junfeng Chen <k-...@hotmail.com>.
Thanks, and no worries. The official document doesn't indicate that but now
I have understood it.
 

 

Thank you again.

Regard,
Junfeng Chen

 

发件人: 肖康(Kang Xiao) [mailto:kxiao.tiger@gmail.com] 
发送时间: 2014年11月9日 20:07
收件人: user@storm.apache.org
主题: Re: 答复: DRPC problem

 

​Sorry for late response. Yes, 'id' is ​is a fixed field that generated by drpc server and emitted by drpc spout. However it is not visible to drpc client.

 

On Wed, Oct 22, 2014 at 9:49 AM, Junfeng Chen <k-2feng@hotmail.com <ma...@hotmail.com> > wrote:

Hi , thanks

I found the following sentences:” The first bolt you declare will take in as input 2-tuples, where the first field is the request id and the second field is the arguments for that request. LinearDRPCTopologyBuilder expects the last bolt to emit an output stream containing 2-tuples of the form [id, result]. Finally, all intermediate tuples must contain the request id as the first field.”

 

I tried to add one more field in the declareOutputFields function, and I get the following error message: “Output stream of last component in LinearDRPCTopology must contain exactly two fields. The first should be the request id, and the second should be the result.”

 

Does that mean the ‘id’ field is a fixed field in the tuple and be ignored in the “drpc.execute("exclamation", word)”. The returned value must be the second field. 

 

Is my word correnct? 

 

 

发件人: 肖康(Kang Xiao) [mailto:kxiao.tiger@gmail.com <ma...@gmail.com> ] 
发送时间: 2014年10月21日 23:24
收件人: user@storm.apache.org <ma...@storm.apache.org> 
主题: Re: DRPC problem

 

hi Junfeng,

 

http://storm.apache.org/documentation/Distributed-RPC.html is useful for you to understand how DRPC works.

 

LocalDRPC is generated from clj code https://github.com/apache/storm/blob/master/storm-core/src/clj/backtype/storm/LocalDRPC.clj.

 

On Mon, Oct 20, 2014 at 2:14 PM, Junfeng Chen <k-2feng@hotmail.com <ma...@hotmail.com> > wrote:

Hi, I am a newbie for the Storm. Now I meet a problem about DRPC. 

 

In the BasicDRPCTopology of sample code, drpc.execute("exclamation", word) return a String as the result. I don’t understand how the DRPC return the emitted value in ExclaimBolt as it declares two Tuples as output format, while it just return "result" field. I tried to discover the source code but no source file of the class “LocalDRPC” can be found in storm-core\src\jvm\backtype\storm path. Could somebody explain for me? Thanks a lot. 

 

Regard,

Junfeng Chen

 





 

-- 

Best Regards!

Kang Xiao,<kxiao.tiger@gmail.com <ma...@gmail.com> >
Distributed Software Engineer





 

-- 

Best Regards!

Kang Xiao,<kxiao.tiger@gmail.com <ma...@gmail.com> >
Distributed Software Engineer


Re: 答复: DRPC problem

Posted by "肖康 (Kang Xiao)" <kx...@gmail.com>.
​Sorry for late response. Yes, 'id' is ​is a fixed field that generated by
drpc server and emitted by drpc spout. However it is not visible to drpc
client.

On Wed, Oct 22, 2014 at 9:49 AM, Junfeng Chen <k-...@hotmail.com> wrote:

> Hi , thanks
>
> I found the following sentences:” The first bolt you declare will take in
> as input 2-tuples, where the first field is the request id and the second
> field is the arguments for that request. LinearDRPCTopologyBuilder
> expects the last bolt to emit an output stream containing 2-tuples of the
> form [id, result]. Finally, all intermediate tuples must contain the
> request id as the first field.”
>
>
>
> I tried to add one more field in the *declareOutputFields* function, and
> I get the following error message: “Output stream of last component in
> LinearDRPCTopology must contain exactly two fields. The first should be the
> request id, and the second should be the result.”
>
>
>
> Does that mean the ‘*id’* field is a fixed field in the tuple and be
> ignored in the “*drpc.execute("exclamation", word)*”. The returned value
> must be the second field.
>
>
>
> Is my word correnct?
>
>
>
>
>
> *发件人:* 肖康(Kang Xiao) [mailto:kxiao.tiger@gmail.com]
> *发送时间:* 2014年10月21日 23:24
> *收件人:* user@storm.apache.org
> *主题:* Re: DRPC problem
>
>
>
> hi Junfeng,
>
>
>
> http://storm.apache.org/documentation/Distributed-RPC.html is useful for
> you to understand how DRPC works.
>
>
>
> LocalDRPC is generated from clj code
> https://github.com/apache/storm/blob/master/storm-core/src/clj/backtype/storm/LocalDRPC.clj
> .
>
>
>
> On Mon, Oct 20, 2014 at 2:14 PM, Junfeng Chen <k-...@hotmail.com> wrote:
>
> Hi, I am a newbie for the Storm. Now I meet a problem about DRPC.
>
>
>
> In the BasicDRPCTopology of sample code, drpc.execute("exclamation", word)
> return a String as the result. I don’t understand how the DRPC return the
> emitted value in ExclaimBolt as it declares two Tuples as output format,
> while it just return "result" field. I tried to discover the source code
> but no source file of the class “LocalDRPC” can be found in
> storm-core\src\jvm\backtype\storm path. Could somebody explain for me?
> Thanks a lot.
>
>
>
> Regard,
>
> Junfeng Chen
>
>
>
>
>
>
>
> --
>
> Best Regards!
>
> Kang Xiao,<kx...@gmail.com>
> Distributed Software Engineer
>



-- 
Best Regards!

Kang Xiao,<kx...@gmail.com>
Distributed Software Engineer

答复: DRPC problem

Posted by Junfeng Chen <k-...@hotmail.com>.
Hi , thanks

I found the following sentences:” The first bolt you declare will take in as input 2-tuples, where the first field is the request id and the second field is the arguments for that request. LinearDRPCTopologyBuilder expects the last bolt to emit an output stream containing 2-tuples of the form [id, result]. Finally, all intermediate tuples must contain the request id as the first field.”

 

I tried to add one more field in the declareOutputFields function, and I get the following error message: “Output stream of last component in LinearDRPCTopology must contain exactly two fields. The first should be the request id, and the second should be the result.”

 

Does that mean the ‘id’ field is a fixed field in the tuple and be ignored in the “drpc.execute("exclamation", word)”. The returned value must be the second field. 

 

Is my word correnct? 

 

 

发件人: 肖康(Kang Xiao) [mailto:kxiao.tiger@gmail.com] 
发送时间: 2014年10月21日 23:24
收件人: user@storm.apache.org
主题: Re: DRPC problem

 

hi Junfeng,

 

http://storm.apache.org/documentation/Distributed-RPC.html is useful for you to understand how DRPC works.

 

LocalDRPC is generated from clj code https://github.com/apache/storm/blob/master/storm-core/src/clj/backtype/storm/LocalDRPC.clj.

 

On Mon, Oct 20, 2014 at 2:14 PM, Junfeng Chen <k-2feng@hotmail.com <ma...@hotmail.com> > wrote:

Hi, I am a newbie for the Storm. Now I meet a problem about DRPC. 

 

In the BasicDRPCTopology of sample code, drpc.execute("exclamation", word) return a String as the result. I don’t understand how the DRPC return the emitted value in ExclaimBolt as it declares two Tuples as output format, while it just return "result" field. I tried to discover the source code but no source file of the class “LocalDRPC” can be found in storm-core\src\jvm\backtype\storm path. Could somebody explain for me? Thanks a lot. 

 

Regard,

Junfeng Chen

 





 

-- 

Best Regards!

Kang Xiao,<kxiao.tiger@gmail.com <ma...@gmail.com> >
Distributed Software Engineer


Re: DRPC problem

Posted by "肖康 (Kang Xiao)" <kx...@gmail.com>.
hi Junfeng,

http://storm.apache.org/documentation/Distributed-RPC.html is useful for
you to understand how DRPC works.

LocalDRPC is generated from clj code
https://github.com/apache/storm/blob/master/storm-core/src/clj/backtype/storm/LocalDRPC.clj
.

On Mon, Oct 20, 2014 at 2:14 PM, Junfeng Chen <k-...@hotmail.com> wrote:

> Hi, I am a newbie for the Storm. Now I meet a problem about DRPC.
>
>
>
> In the BasicDRPCTopology of sample code, drpc.execute("exclamation", word)
> return a String as the result. I don’t understand how the DRPC return the
> emitted value in ExclaimBolt as it declares two Tuples as output format,
> while it just return "result" field. I tried to discover the source code
> but no source file of the class “LocalDRPC” can be found in
> storm-core\src\jvm\backtype\storm path. Could somebody explain for me?
> Thanks a lot.
>
>
>
> Regard,
>
> Junfeng Chen
>
>
>



-- 
Best Regards!

Kang Xiao,<kx...@gmail.com>
Distributed Software Engineer