Git Product home page Git Product logo

Comments (5)

vishesh avatar vishesh commented on August 27, 2024 1

Resolved in #1105 which implements CompareAndClear op.

from foundationdb.

spullara avatar spullara commented on August 27, 2024

This seems pretty useful to me. I also have used counters in this way and have had to manually garbage collect them to remove those that are no longer in use. There are probably several atomic operations that have not yet been implemented that would also be useful.

from foundationdb.

alecgrieser avatar alecgrieser commented on August 27, 2024

It sounds like there were two options here, either to implement COMPARE_AND_CLEAR that clears key k if and only if the value at k is equal to the other parameter, or a more specific ADD_AND_CLEAR that would clear a key that hits zero. I think some of us on the team decided that COMPARE_AND_CLEAR, being more generic, would be more useful even if it means a few more client operations.

from foundationdb.

KrzysFR avatar KrzysFR commented on August 27, 2024

Bindings could provide a ADD_AND_CLEAR overload that internally calls ADD and COMPARE_AND_CLEAR, so that we have both :)

from foundationdb.

ajbeamon avatar ajbeamon commented on August 27, 2024

And more generally, layers can create functions that combine any of the atomic ops as they see fit. I suspect that will be how we initially approach the bindings we're currently publishing -- we probably won't provide any combinations in the bindings themselves, but instead defer that to layer writers as is appropriate to them.

from foundationdb.

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.