Commit eb500b8c authored by Rich Prohaska's avatar Rich Prohaska

#178 destroy ule status partitioned counters

parent 21421e1f
......@@ -213,6 +213,7 @@ basement nodes, bulk fetch, and partial fetch:
#include "leafentry.h"
#include "xids.h"
#include "ft_msg.h"
#include "ule.h"
#include <toku_race_tools.h>
......@@ -6456,6 +6457,7 @@ int toku_ft_layer_init(void) {
partitioned_counters_init();
status_init();
txn_status_init();
toku_ule_status_init();
toku_checkpoint_init();
toku_ft_serialize_layer_init();
toku_mutex_init(&ft_open_close_lock, NULL);
......@@ -6470,6 +6472,7 @@ void toku_ft_layer_destroy(void) {
toku_checkpoint_destroy();
status_destroy();
txn_status_destroy();
toku_ule_status_destroy();
toku_context_status_destroy();
partitioned_counters_destroy();
toku_scoped_malloc_destroy();
......
......@@ -133,8 +133,7 @@ static LE_STATUS_S le_status;
#define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(le_status, k, c, t, "le: " l, inc)
static void
status_init(void) {
void toku_ule_status_init(void) {
// Note, this function initializes the keyname, type, and legend fields.
// Value fields are initialized to zero by compiler.
STATUS_INIT(LE_MAX_COMMITTED_XR, nullptr, UINT64, "max committed xr", TOKU_ENGINE_STATUS);
......@@ -149,10 +148,15 @@ status_init(void) {
}
#undef STATUS_INIT
void
toku_le_get_status(LE_STATUS statp) {
if (!le_status.initialized)
status_init();
void toku_ule_status_destroy(void) {
for (int i = 0; i < LE_STATUS_NUM_ROWS; ++i) {
if (le_status.status[i].type == PARCOUNT) {
destroy_partitioned_counter(le_status.status[i].value.parcount);
}
}
}
void toku_le_get_status(LE_STATUS statp) {
*statp = le_status;
}
......
......@@ -102,6 +102,9 @@ PATENT RIGHTS GRANT:
#include "txn_manager.h"
#include <util/mempool.h>
void toku_ule_status_init(void);
void toku_ule_status_destroy(void);
// opaque handles used by outside world (i.e. indexer)
typedef struct ule *ULEHANDLE;
typedef struct uxr *UXRHANDLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment