Write to Kafka from Dask Stream
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- kafka, python
調査の方向性
Start by reviewing the existing DaskStream and core.to_kafka implementations, including to_kafka.update and the get_producer workaround shown in the issue. Determine how the existing back-pressure handling and worker-local Kafka connection should fit together without pickling the producer. Done means Dask Stream can write to Kafka with the existing back-pressure behavior and a reliable worker-side producer.
索引モデルが issue の本文から書いたものです。
説明
It seems like the exiting PR for this needs improvements. I'm creating this issue to invite discussion on now to properly solve this problem.
I would like to use the existing back pressure handling implementation in the existing to_kafka function. I'm thinking that we can just call the existing to_kafka.update from Dask. It looks something like this:
@DaskStream.register_api()
class to_kafka(DaskStream, core.to_kafka):
def update(self, x, who=None, metadata=None):
client = default_client()
result = client.submit(to_kafka.update, self, x, who, metadata)
yield self._emit(result)
However, there's still the issue of the Kafka connection. It seems Dask attempts to pickle the Kafka producer and push it the worker. This fails due to the Confluent producer using some sort of lazy instantiation. In my previous attempt to make this work, I was able to create the producer using the getattr workaround. It also attaches the producer to the worker in order to maintain the connection.
def get_producer(config):
w = get_worker()
if hasattr(w, 'producer'):
return w.producer
import confluent_kafka as ck
w.producer = getattr(ck, 'Producer')(config)
return w.producer
This seems very much like a hack to me, and I would prefer a better solution. If anyone has more expertise on Dask, any help would be appreciated.
- 主要言語
- Python
- スター
- 1.3k
- フォーク
- 149
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-streamz/streamz のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
python-streamz/streamz#481 · コメント 4 件 ·
-
Combining the streamz.Stream.filenames() and streamz.Stream.from_textfile() using dask scatter? オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
python-streamz/streamz#480 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
python-streamz/streamz#479 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
python-streamz/streamz#478 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 10/100
python-streamz/streamz#476 · コメント 17 件 · リアクション 2 件 ·
python-streamz/streamz の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
use-agent-os/agent-os#3314 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BasedHardware/omi#15662 · コメント 1 件 ·
-
documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
AiursoftWeb/AnduinOS-2#19 ·