Write to Kafka from Dask Stream
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- kafka, python
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 1.3k
- Forks
- 149
- Merge medio
- 17 h 39 min
- PR fusionados (30 d)
- 1
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python-streamz/streamz
-
pkg_resources warningAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
python-streamz/streamz#481 · 4 comentarios ·
-
Combining the streamz.Stream.filenames() and streamz.Stream.from_textfile() using dask scatter?Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
python-streamz/streamz#480 · 2 comentarios ·
-
Compile the code into c++Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
python-streamz/streamz#479 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
python-streamz/streamz#478 · 6 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 10/100
python-streamz/streamz#476 · 17 comentarios · 2 reacciones ·
Todos los issues de python-streamz/streamz
Issues similares
-
Broken links found in docsAbiertodocs pydanty:is-working
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
pydantic/pydantic-ai#8863 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
run-llama/llama_index#23278 ·
Los mantenedores suelen responder en 2 días
-
documentation from-review-extraction github-actions priority: low severity:nit
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
LearningCircuit/local-deep-research#6946 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
oracle/langchain-oracle#323 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
tenstorrent/tt-metal#58057 · 1 comentario ·
Los mantenedores suelen responder en 1 día