Is the poll() method of kafka SourceTask class thread safe? -
i'm using kafka connect send data web service kafka (version 0.10.1) in distributed mode. poll() method documentation states that:
poll sourcetask new records. method should block if no data available.
however, i'm not sure if poll() method can called more 1 thread kafka. requests web service time-consuming, done in method , want avoid sending them multiple times.
there question states prior version 0.10.2.1-cp2, poll() method called different threads. however, release notes can't confirm if situation doesn't happen on newer versions.
kafka connect tasks not need threadsafe perspective of framework, , tasks should not assume can communicate other tasks , connectors via static mechanisms. note of course there may multiple tasks running in separate threads.
at least kafka 0.11.0.0, methods on each sourcetask , sinktask instance called thread dedicated task. same thread used lifetime of task instance until stopped. when task paused, thread blocks.
my understanding behavior ever since @ least 0.10.1.0, you'd have check codebase sure.
Comments
Post a Comment