Coder Social home page Coder Social logo

Assign partitions based on lag about kafkajs HOT 5 CLOSED

tulios avatar tulios commented on August 20, 2024
Assign partitions based on lag

from kafkajs.

Comments (5)

Nevon avatar Nevon commented on August 20, 2024

One thing I'm not sure about is how to calculate the offset lag per partition. Maybe I'm missing something, but I don't see a way to get this using ListOffset, etc.

from kafkajs.

tulios avatar tulios commented on August 20, 2024

You will have to use broker#offsetFetch because you want the group offset and not the topic offset.

from kafkajs.

Nevon avatar Nevon commented on August 20, 2024

But that just gives you the group offset, but to calculate the lag you'd also need the highwater mark and the starting offset.

from kafkajs.

tulios avatar tulios commented on August 20, 2024

It's a combination of listOffset and offsetFetch

from kafkajs.

Nevon avatar Nevon commented on August 20, 2024

I have a PoC implementation now that seems to work. I'll create a PR with it as soon as I've dealt with some error cases, and get some feedback. The assignment algorithm itself seems to produce balanced assignments. It's mostly calculating the offset lag that's not the nicest at the moment.

I'm not sure it makes sense to bundle it with the main distribution of KafkaJS though, as for most people the round-robin assigner would be fine. Since the assigner is pluggable anyway, I think it might make more sense to publish it as a separate module.

from kafkajs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.