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