|
Packit Service |
584ef9 |
#ifndef CRAWLER_H
|
|
Packit Service |
584ef9 |
#define CRAWLER_H
|
|
Packit Service |
584ef9 |
|
|
Packit Service |
584ef9 |
#define LRU_CRAWLER_CAP_REMAINING -1
|
|
Packit Service |
584ef9 |
|
|
Packit Service |
584ef9 |
typedef struct {
|
|
Packit Service |
584ef9 |
uint64_t histo[61];
|
|
Packit Service |
584ef9 |
uint64_t ttl_hourplus;
|
|
Packit Service |
584ef9 |
uint64_t noexp;
|
|
Packit Service |
584ef9 |
uint64_t reclaimed;
|
|
Packit Service |
584ef9 |
uint64_t seen;
|
|
Packit Service |
584ef9 |
rel_time_t start_time;
|
|
Packit Service |
584ef9 |
rel_time_t end_time;
|
|
Packit Service |
584ef9 |
bool run_complete;
|
|
Packit Service |
584ef9 |
} crawlerstats_t;
|
|
Packit Service |
584ef9 |
|
|
Packit Service |
584ef9 |
struct crawler_expired_data {
|
|
Packit Service |
584ef9 |
pthread_mutex_t lock;
|
|
Packit Service |
584ef9 |
crawlerstats_t crawlerstats[POWER_LARGEST];
|
|
Packit Service |
584ef9 |
/* redundant with crawlerstats_t so we can get overall start/stop/done */
|
|
Packit Service |
584ef9 |
rel_time_t start_time;
|
|
Packit Service |
584ef9 |
rel_time_t end_time;
|
|
Packit Service |
584ef9 |
bool crawl_complete;
|
|
Packit Service |
584ef9 |
bool is_external; /* whether this was an alloc local or remote to the module. */
|
|
Packit Service |
584ef9 |
};
|
|
Packit Service |
584ef9 |
|
|
Packit Service |
584ef9 |
enum crawler_result_type {
|
|
Packit Service |
584ef9 |
CRAWLER_OK=0, CRAWLER_RUNNING, CRAWLER_BADCLASS, CRAWLER_NOTSTARTED, CRAWLER_ERROR
|
|
Packit Service |
584ef9 |
};
|
|
Packit Service |
584ef9 |
int start_item_crawler_thread(void);
|
|
Packit Service |
584ef9 |
#define CRAWLER_WAIT true
|
|
Packit Service |
584ef9 |
#define CRAWLER_NOWAIT false
|
|
Packit Service |
584ef9 |
int stop_item_crawler_thread(bool wait);
|
|
Packit Service |
584ef9 |
int init_lru_crawler(void *arg);
|
|
Packit Service |
584ef9 |
enum crawler_result_type lru_crawler_crawl(char *slabs, enum crawler_run_type,
|
|
Packit Service |
584ef9 |
void *c, const int sfd, unsigned int remaining);
|
|
Packit Service |
584ef9 |
int lru_crawler_start(uint8_t *ids, uint32_t remaining,
|
|
Packit Service |
584ef9 |
const enum crawler_run_type type, void *data,
|
|
Packit Service |
584ef9 |
void *c, const int sfd);
|
|
Packit Service |
584ef9 |
void lru_crawler_pause(void);
|
|
Packit Service |
584ef9 |
void lru_crawler_resume(void);
|
|
Packit Service |
584ef9 |
|
|
Packit Service |
584ef9 |
#endif
|