// SPDX-License-Identifier: GPL-3.0-or-later
#define NETDATA_RRD_INTERNALS
#include "pdc.h"
struct extent_page_details_list {
uv_file file;
uint64_t extent_offset;
uint32_t extent_size;
unsigned number_of_pages_in_JudyL;
Pvoid_t page_details_by_metric_id_JudyL;
struct page_details_control *pdc;
struct rrdengine_datafile *datafile;
struct rrdeng_cmd *cmd;
bool head_to_datafile_extent_queries_pending_for_extent;
struct {
struct extent_page_details_list *prev;
struct extent_page_details_list *next;
} query;
};
typedef struct datafile_extent_offset_list {
uv_file file;
unsigned fileno;
Pvoid_t extent_pd_list_by_extent_offset_JudyL;
} DEOL;
// ----------------------------------------------------------------------------
// PDC cache
static struct {
struct {
ARAL *ar;
} pdc;
struct {
ARAL *ar;
} pd;
struct {
ARAL *ar;
} epdl;
struct {
ARAL *ar;
} deol;
} pdc_globals = {};
void pdc_init(void) {
pdc_globals.pdc.ar = aral_create(
"dbengine-pdc",
sizeof(PDC),
0,
65536,
NULL,
NULL, NULL, false, false
);
}
PDC *pdc_get(void) {
PDC *pdc = aral_mallocz(pdc_globals.pdc.