Giter VIP home page Giter VIP logo

Comments (3)

cruppstahl avatar cruppstahl commented on September 15, 2024

Option 1: split the recovery operation into a new API function (ups_env_recover) and deprecate UPS_AUTO_RECOVERY.
-> requires updates for the wrapper APIs, remote API...

Option 2: somehow store the callback function in the ups_parameter_t structure -> but this is super ugly

Option 3: come up with another hack -> even more ugly

from upscaledb.

Piwosz avatar Piwosz commented on September 15, 2024

About second option: databases might use various callbacks. But this concept might be modified to introduce new callback. As probably most developers know what they store in particular databases this callback might be used to temporary set compare function for known id databases during recover. Anyway, it's still ugly but probably more flexible.

Introducing new dedicated function for recovery also need to handle possible various compare function for databases in environment.

from upscaledb.

cruppstahl avatar cruppstahl commented on September 15, 2024

I found a way for option 2 to be less ugly.

Callbacks are registered globally under a "name" (this can happen prior to opening or creating the Environment):

ups_register_compare_callback(const char *name, ups_compare_callback_func cb);

When creating the database, the name is specified as a parameter:

ups_parameter_t db_create_params[] = {
    {UPS_KEY_TYPE, UPS_TYPE_CUSTOM},
    {UPS_KEY_COMPARE_CALLBACK, (uint64_t)"int128compare"},
    ...
};

(I use a similar pattern of registering global callbacks for a different set of functions which are not yet released.)

When opening the database, it is not required to specify the callback name since the name is persisted.

However, it is not trivial to persist the name. I'll try to work something out.

from upscaledb.

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.