{"id":2152,"date":"2010-10-18T12:51:04","date_gmt":"2010-10-18T02:51:04","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=2152"},"modified":"2010-10-18T12:51:04","modified_gmt":"2010-10-18T02:51:04","slug":"new-apis-in-haildb","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2010\/10\/18\/new-apis-in-haildb\/","title":{"rendered":"New APIs in HailDB"},"content":{"rendered":"<p>In the current HailDB we have a couple of new API calls that you may like:<\/p>\n<ul>\n<li><strong>ib_status_get_all()<\/strong><br \/>\nIs very similar to ib_cfg_get_all(). This allows the library to add new status variables without applications having to know about them &#8211; because we return a list of what there are. For Drizzle, this means that the DATA_DICTIONARY.HAILDB_STATUS table will automatically have any new status variables we add to HailDB without a single extra line of code having to be written.<\/li>\n<li><strong>ib_set_panic_handler()<\/strong><br \/>\nHaving a shared library call exit() is generally considered impolite. Previously, if HailDB hit corruption (or some other nasty conditions), it could call exit() and you&#8217;d never get a chance to display a sensible error message to your user (especially bad in a GUI app where the printed to console error message would be unseen). This call allows an application to specify a callback in the case of HailDB entering such a condition. We&#8217;ll still be unable to continue (and we strongly advise that you do in fact exit the process in your callback) but you&#8217;re at least now able to (for example) pop up a dialog box saying sorry.<\/li>\n<li><strong>ib_trx_set_client_data()<\/strong><br \/>\nThis call lets you associate a void* with a transaction. HailDB keeps this pointer in its transaction data structure and in some callbacks (e.g. ib_set_trx_is_interrupted_handler(), see below) will pass this pointer back to you for you to use to help make a decision. In InnoDB in MySQL, this is the THD. In Drizzle, it&#8217;s the Session.<strong> <\/strong><\/li>\n<li><strong>ib_set_trx_is_interrupted_handler()<\/strong><br \/>\nIn various wait conditions (e.g. waiting for a row lock), HailDB will call the callback you set with this function with the client data (set with ib_trx_set_client_data()) to work out if the transaction has been cancelled. This enables an application to implement something like the MySQL\/Drizzle KILL command to cancel a transaction in another thread.<\/li>\n<li><strong>ib_get_duplicate_key()<\/strong><br \/>\nIf you just got a duplicate key error, this function will tell you what key it was. This allows you to implement a nicer error message.<\/li>\n<li><strong>ib_get_table_statistics()<\/strong><br \/>\nThis function gives you access to some basic table statistics that HailDB maintains. This includes an approximate row count, clustered index size, total of secondary indexes as well as a &#8220;modified counter&#8221; which can give you a rough idea about how out of date these statistics are.<\/li>\n<\/ul>\n<p>All of these are new to HailDB (and weren&#8217;t available in embedded_innodb), many in the new 2.3 development release. You can see usage examples both in the HailDB test suite and (for most of them) in the Drizzle HailDB Storage Engine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the current HailDB we have a couple of new API calls that you may like: ib_status_get_all() Is very similar to ib_cfg_get_all(). This allows the library to add new status variables without applications having to know about them &#8211; because &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2010\/10\/18\/new-apis-in-haildb\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[75],"tags":[78,70,275,287],"class_list":["post-2152","post","type-post","status-publish","format-standard","hentry","category-drizzle-work-et-al","tag-api","tag-drizzle","tag-embedded_innodb","tag-haildb"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-yI","jetpack-related-posts":[{"id":1894,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/04\/16\/announcing-haildb\/","url_meta":{"origin":2152,"position":0},"title":"Announcing HailDB","author":"Stewart Smith","date":"2010-04-16","format":false,"excerpt":"I just announced our continuation of the Embedded InnoDB project under the name of HailDB. Check out the announcement over at http:\/\/www.haildb.com\/. HailDB is a relational database that is embeddable within applications. You embed\u00c2\u00a0HailDB by linking to a shared library and calling a clean and simple API.\u00c2\u00a0HailDB is a continuation\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2155,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/10\/14\/second-drizzle-beta-and-innodb-update\/","url_meta":{"origin":2152,"position":1},"title":"Second Drizzle Beta (and InnoDB update)","author":"Stewart Smith","date":"2010-10-14","format":false,"excerpt":"We just released the latest Drizzle tarball (2010-10-11 milestone). There are a whole bunch of bug fixes, but there are two things that are interesting from a storage engine point of view: The Innobase plugin is now based on innodb_plugin 1.0.6 The embedded_innodb engine is now named HailDB and requires\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2099,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/08\/03\/haildb-2-0-0-released\/","url_meta":{"origin":2152,"position":2},"title":"HailDB 2.0.0 released!","author":"Stewart Smith","date":"2010-08-03","format":false,"excerpt":"(Reposted from the HailDB Blog. See also the\u00c2\u00a0announcement\u00c2\u00a0on the Drizzle Blog.) We've made our first HailDB release! We've decided to make this a very conservative release. Fixing some minor bugs, getting a lot of compiler warnings fixed and start to make the name change in the source from Embedded InnoDB\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2161,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/10\/21\/haildb-being-built-by-default-in-drizzle\/","url_meta":{"origin":2152,"position":3},"title":"HailDB being built by default in Drizzle","author":"Stewart Smith","date":"2010-10-21","format":false,"excerpt":"It just it trunk - if you have HailDB installed when you build Drizzle, you will now get the HailDB plugin built. You can even run Drizzle with it (remove innobase plugin, load HailDB plugin). Previously, we had problems building both due to symbol conflicts between innobase and HailDB. We've\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2356,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/04\/12\/speaking-on-tuesday-haildb-and-dropping-acid-eating-data-in-a-web-2-0-cloud-world\/","url_meta":{"origin":2152,"position":4},"title":"Speaking on Tuesday: HailDB and Dropping ACID: Eating Data in a Web 2.0 Cloud World","author":"Stewart Smith","date":"2011-04-12","format":false,"excerpt":"I'm giving two talks tomorrow (Tuesday) at the MySQL Conference and Expo: HailDB: A NoSQL API direct to InnoDB, 2:00pm, Ballroom D Dropping ACID: Eating Data In A Web 2.0 Cloud World 3:05pm, Ballroom G The HailDB talk is all about a C API to embed an InnoDB based relational\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2115,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/08\/18\/embedded_innodb-engine-haildb-engine\/","url_meta":{"origin":2152,"position":5},"title":"embedded_innodb engine (HailDB Engine)","author":"Stewart Smith","date":"2010-08-18","format":false,"excerpt":"A whole bunch of stuff got merged to the embedded_innodb engine recently. The end game is to have the embedded_innodb engine be just linking to HailDB (where we're continuing maintenance of Embedded InnoDB). So, what made it in? A lot of bug fixes (especially around error reporting and tables without\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=2152"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2152\/revisions"}],"predecessor-version":[{"id":2159,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2152\/revisions\/2159"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=2152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=2152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=2152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}