Giter Site home page Giter Site logo

Support ephemeral nodes about doozerd HOT 14 CLOSED

ha avatar ha commented on June 21, 2024
Support ephemeral nodes

from doozerd.

Comments (14)

dgryski avatar dgryski commented on June 21, 2024

ActiveState's fork ( https://github.com/ActiveState/doozerd ) has support for ephemeral nodes.

from doozerd.

pitr avatar pitr commented on June 21, 2024

awesome. let's keep this issue open until it's merged and documented

from doozerd.

bketelsen avatar bketelsen commented on June 21, 2024

Patches GLADLY reviewed.

from doozerd.

mreiferson avatar mreiferson commented on June 21, 2024

I poked around ActiveState's fork and, to be honest, I'm not terribly happy with the implementation chosen.

I think any node should be able to be created as ephemeral (not just some specific hard coded path requiring special case handling in both get and set code).

I think this would produce the most flexible implementation but I acknowledge that it might mean more breaking changes to the API.

I'm curious to hear other's thoughts before I take a swing at this.

from doozerd.

pitr avatar pitr commented on June 21, 2024

@mreiferson I also looked at the code and I agree. It's obvious that ActiveState did what anyone else would have done in their place - quickly get the feature to work. But for it to be useful to everyone, this needs to be done properly and thoughtfully. Before we hit major version 1 I think it's perfectly acceptable to break API, considering how important this feature is.

from doozerd.

mreiferson avatar mreiferson commented on June 21, 2024

@pitr Yes, absolutely, it's always a matter of tradeoffs 😄

from doozerd.

srid avatar srid commented on June 21, 2024

It's obvious that ActiveState did what anyone else would have done in their place - quickly get the feature to work.

that's exactly what happened (the commit itself was titled "limited ephemeral node support").

I think any node should be able to be created as ephemeral (not just some specific hard coded path requiring special case handling in both get and set code).

+1

But for it to be useful to everyone, this needs to be done properly and thoughtfully. Before we hit major version 1 I think it's perfectly acceptable to break API, considering how important this feature is.

as for the API, how about having SET take an extra argument (t.req.CreateMode = EPHEMERAL)?

as for the implementation, i'm thinking that the list of ephemeral paths can be stored in the conn{} struct; to be deleted during disconnection.

from doozerd.

mreiferson avatar mreiferson commented on June 21, 2024

@srid I was thinking the same thing (your suggested implementation)

Do you want to take a stab at this? I'm working on cleaning up logging and other misc odds and ends so I might not get to this for a bit.

from doozerd.

srid avatar srid commented on June 21, 2024

sure, i'll take a look.

from doozerd.

pitr avatar pitr commented on June 21, 2024

should directories have ability to be ephemeral?

from doozerd.

mreiferson avatar mreiferson commented on June 21, 2024

@pitr at the moment you only ever indirectly create directories (SET works on "file" paths), so my vote would be no.

from doozerd.

bketelsen avatar bketelsen commented on June 21, 2024

Agreed. And there's no real need for data-owning directories in the use cases I've seen.

from doozerd.

cespare avatar cespare commented on June 21, 2024

I've certainly seen Zookeeper use cases where ephemeral znodes with other nodes underneath them (ephemeral directories in Doozer) are useful. For instance, a server might come online, open up an ephemeral node called $HOSTNAME to indicate its existence and keep status information in files underneath that.

But since you don't really deal with directories directly in Doozer, I see how that wouldn't really make sense here.

from doozerd.

bketelsen avatar bketelsen commented on June 21, 2024

Sorry my comment is unclear. I meant data-owning in the sense that all nodes in zk can have data associated, but they can't in doozer. A path like /myHostname/ can't have data attached, but an easy work around is to apply children paths like /myHostname/ipAddress with the data you want to store.

from doozerd.

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.