storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander S. Klimov" <>
Subject RE: spout instance id - can be used for partitioning?
Date Thu, 09 Jan 2014 18:02:48 GMT
Thank you!

From: Guillaume Perrot []
Sent: Thursday, January 9, 2014 8:48 AM
Subject: Re: spout instance id - can be used for partitioning?

Hi, yes you can do that, DRPCSpout uses the following code from the open(Map,TopologyContext,SpoutOutputCollector)

int numTasks = context.getComponentTasks(context.getThisComponentId()).size();  // number
of this spout tasks
int index = context.getThisTaskIndex();                                                  
              // this task index

2014/1/9 Alexander S. Klimov <<>>
Hi guys,

From a given topic in Kafka I can read messages from multiple partitions. Let’s say we have
100 partitions.

Can this load be evenly distributed across 10 spouts reading from Kafka. If spout instance
has persistent id – I can use hash function to understand which part of partitions should
given spout instance read.

Do we have spout instance id notion accessible in Storm Java API? Even simple number from
1 to 10 would work.

View raw message