This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-maat/src/inc_internal/maat_group.h

59 lines
1.9 KiB
C
Raw Normal View History

2023-01-06 18:54:59 +08:00
/*
**********************************************************************************************
* File: maat_group.h
* Description:
* Authors: Liu wentan <liuwentan@geedgenetworks.com>
* Date: 2022-10-31
* Copyright: (c) 2018-2022 Geedge Networks, Inc. All rights reserved.
***********************************************************************************************
*/
#ifndef _MAAT_GROUP_H_
#define _MAAT_GROUP_H_
#ifdef __cplusplus
2023-01-06 18:54:59 +08:00
extern "C"
{
#endif
#include <stdint.h>
2023-01-30 21:59:35 +08:00
#include "cJSON/cJSON.h"
#include "maat_kv.h"
#include "maat_table.h"
2023-01-06 18:54:59 +08:00
2023-02-03 17:28:14 +08:00
struct maat_group;
2023-01-30 21:59:35 +08:00
/* group2group schema API */
2023-02-03 17:28:14 +08:00
void *group2group_schema_new(cJSON *json, struct table_manager *tbl_mgr,
const char *table_name, struct log_handle *logger);
2023-01-30 21:59:35 +08:00
void group2group_schema_free(void *g2g_schema);
/* group2group runtime API */
2023-02-03 17:28:14 +08:00
void *group2group_runtime_new(void *g2g_schema, int max_thread_num,
struct maat_garbage_bin *garbage_bin,
2023-01-31 20:39:53 +08:00
struct log_handle *logger);
2023-01-30 21:59:35 +08:00
void group2group_runtime_free(void *g2g_runtime);
2023-02-03 17:28:14 +08:00
void maat_group_ref_inc(struct maat_group *group);
void maat_group_ref_dec(struct maat_group *group);
2023-02-22 15:22:41 +08:00
struct maat_group *group2group_runtime_add_group(void *g2g_runtime, long long group_id);
2023-01-31 20:39:53 +08:00
void group2group_runtime_remove_group(void *g2g_runtime, struct maat_group *group);
2023-02-22 15:22:41 +08:00
struct maat_group *group2group_runtime_find_group(void *g2g_runtime, long long group_id);
2023-01-31 20:39:53 +08:00
int group2group_runtime_build_top_groups(void *g2g_runtime);
2023-02-22 15:22:41 +08:00
int group2group_runtime_get_top_groups(void *g2g_runtime, long long *group_ids,
size_t n_group_ids, long long *top_group_ids);
2023-01-31 20:39:53 +08:00
2023-02-03 17:28:14 +08:00
int group2group_runtime_update(void *g2g_runtime, void *g2g_schema,
const char *table_name, const char *line,
int valid_column);
2023-02-09 22:13:15 +08:00
int group2group_runtime_commit(void *g2g_runtime, const char *table_name);
2023-01-30 21:59:35 +08:00
#ifdef __cplusplus
2023-01-06 18:54:59 +08:00
}
#endif
2023-02-22 15:22:41 +08:00
#endif