I have a topology where my spout connects to mysql and executes select
query with limit clause and put the rows in list
for eg. select * from tablename limit index,size
where my index variable is an instance variable & it gets incremented as
per the rows fetched from the table
               size variable is a final variable of value 1000
for eg. the situation is when first time select query is executed it
fetches first 1000 rows & dumps it in the list & the second time select
query is executed when all the first rows are fetched from the list & it
dumps the next 1000 rows in the list & so on.So is there a way that by the
time data is retrieved from list the select query is executed parallely.
OR
Now when i run the topology with setting spout parallelism as one it works
fine. But when i increase the parallelism to four it gives three duplicate
entries. I think its because the select query is executed with four times
with same value of index variable.

Then I thought of making my spout thread safe so i made the index variable
as volatile & put the select query under synchronized block but nothing
worked out.

So can i make spout paralelism more than one . If yes how to implement it.

Reply via email to