Comments (3)
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.
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.
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)
- UPS_FIND_GEQ_MATCH finds erased item in env with UPS_ENABLE_TRANSACTIONS HOT 2
- Cursor skip entry during iteration
- Cursor moves from UPS_CURSOR_FIRST to UPS_CURSOR_PREVIOUS without UPS_KEY_NOT_FOUND
- Python3 compatible? HOT 1
- upscaledb does not compile with boost 1.66 HOT 2
- Three unittests failed HOT 1
- https://upscaledb.com/ SSL certificate expired HOT 1
- Compile server library HOT 3
- Compilation fails on non-SSE platform
- how to join tables? HOT 1
- Production and performance query HOT 1
- compilation in visual c++ 2017 HOT 1
- https://upscaledb.com/ SSL certificate expired HOT 1
- Failure to compile with OpenSSL 1.1.1c HOT 2
- https://upscaledb.com/ SSL certificate expired HOT 2
- 3rd party dependecies under Linux HOT 3
- Can't build from outside the source tree
- Fails to find boost in "make" step
- Cannot compile with newest proto and boost libraries HOT 2
- upsserver.cc:1976:22: error: no match for 'operator!=' (operand types are 'const boost::system::error_code' and 'int')
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upscaledb.