to_s cast on getValue and max_task_parallelism in cluster

This commit is contained in:
Colin Surprenant 2012-06-27 16:11:20 -04:00
parent 91f58b3bd0
commit 246a4ec7e1
2 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,7 @@ module RedStorm
class RedisWordSpout < RedStorm::SimpleSpout
output_fields :word
on_send {@q.pop if @q.size > 0}
on_send {@q.pop.to_s if @q.size > 0}
on_init do
@q = Queue.new
@ -51,6 +51,7 @@ module RedStorm
when :local
max_task_parallelism 3
when :cluster
max_task_parallelism 5
num_workers 20
max_spout_pending(1000);
end

View File

@ -9,7 +9,7 @@ module RedStorm
# block declaration style using auto-emit (default)
#
on_receive do |tuple|
word = tuple.getString(0)
word = tuple.getValue(0).to_s
@counts[word] += 1
[word, @counts[word]]