summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dealpkt/duplicate_pkt_distinguish.c37
-rw-r--r--src/extensions/sapp_metrics.cpp4
-rw-r--r--src/packet_io/packet_io_status.cpp33
-rwxr-xr-xsrc/support/dablooms/src/dablooms.c94
-rwxr-xr-xsrc/support/dablooms/src/dablooms.h6
5 files changed, 95 insertions, 79 deletions
diff --git a/src/dealpkt/duplicate_pkt_distinguish.c b/src/dealpkt/duplicate_pkt_distinguish.c
index 1b93f99..54a1593 100644
--- a/src/dealpkt/duplicate_pkt_distinguish.c
+++ b/src/dealpkt/duplicate_pkt_distinguish.c
@@ -12,18 +12,18 @@ extern "C" {
识别因路由策略导致的重复流量, 首次收到数据包加入bloom filter,
每个流的前N个包扫描bloom filter, 重复的数据包直接转发即可.
- ip层的ttl, hop不能算为key, 因为经过了几跳路由器又回绕了, ttl肯定会变�?, 而上层的数据包确实是重复�?.
+ ip层的ttl, hop不能算为key, 因为经过了几跳路由器又回绕了, ttl肯定会变�??, 而上层的数据包确实是重复�??.
*/
/*
2021-05-18 lijia close ipv6 protocol:
重复流量识别bloom filter句柄, 根据流量方向和协议的不同, 功能分为三类,
- IPv6因为没有Ipid字段, 无法区别真正的应用层重传和重复流�?, 开启了会导致断网或者CT, 所以不支持!!!
+ IPv6因为没有Ipid字段, 无法区别真正的应用层重传和重复流�??, 开启了会导致断网或者CT, 所以不支持!!!
- 对于IPv6的两种情�?:
- 1)如果开启了代理策略, 重传包被识别成了重复包的�?, sapp就直接PASS�?, 实际那个包是真实通信双方发的, 没有经过tfe处理, 可能就断网了.
- 2)如果开启了firewall的drop策略, 第一次drop成功�?, 但应用层会重�?, 重传包被识别成了重复包的�?, sapp就直接PASS�?, 导致CT.
+ 对于IPv6的两种情�??:
+ 1)如果开启了代理策略, 重传包被识别成了重复包的�??, sapp就直接PASS�??, 实际那个包是真实通信双方发的, 没有经过tfe处理, 可能就断网了.
+ 2)如果开启了firewall的drop策略, 第一次drop成功�??, 但应用层会重�??, 重传包被识别成了重复包的�??, sapp就直接PASS�??, 导致CT.
*/
void *bloom_new(const sapp_dup_pkt_t *dup_conf, struct timeval now, long now_ms)
@@ -164,29 +164,30 @@ int bloomfilter_get_stat_by_type(void *bm_handle, sapp_sys_stat_type_t type, lon
return 0;
}
-static int bloomfilter_get_stat(void *bm_handle)
+static int bloomfilter_get_stat(int tseq, void *bm_handle)
{
+ sapp_gval_mthread_t **mstat = sapp_global_val->mthread_volatile;
long long count = 0;
bloomfilter_get_stat_by_type(bm_handle, SAPP_STAT_BM_HASH_NUM, &count);
- sapp_fs3_metric_set(0, SAPP_STAT_BM_HASH_NUM, count);
+ mstat[tseq]->sys_stat.count[SAPP_STAT_BM_HASH_NUM] = count;
count = 0;
bloomfilter_get_stat_by_type(bm_handle, SAPP_STAT_BM_EXPAND_NUM, &count);
- sapp_fs3_metric_set(0, SAPP_STAT_BM_EXPAND_NUM, count);
+ mstat[tseq]->sys_stat.count[SAPP_STAT_BM_EXPAND_NUM] = count;
count = 0;
bloomfilter_get_stat_by_type(bm_handle, SAPP_STAT_BM_SLICE_NUM_NEW, &count);
- sapp_fs3_metric_set(0, SAPP_STAT_BM_SLICE_NUM_NEW, count);
+ mstat[tseq]->sys_stat.count[SAPP_STAT_BM_SLICE_NUM_NEW] = count;
count = 0;
bloomfilter_get_stat_by_type(bm_handle, SAPP_STAT_BM_SLICE_NUM_FREE, &count);
- sapp_fs3_metric_set(0, SAPP_STAT_BM_SLICE_NUM_FREE, count);
+ mstat[tseq]->sys_stat.count[SAPP_STAT_BM_SLICE_NUM_FREE] = count;
count = 0;
bloomfilter_get_stat_by_type(bm_handle, SAPP_STAT_BM_CUR_SLICE_NUM, &count);
- sapp_fs3_metric_set(0, SAPP_STAT_BM_CUR_SLICE_NUM, count);
+ mstat[tseq]->sys_stat.count[SAPP_STAT_BM_CUR_SLICE_NUM] = count;
count = 0;
bloomfilter_get_stat_by_type(bm_handle, SAPP_STAT_APBM_EXPAND_MAX_MULTIPLE, &count);
- sapp_fs3_metric_set(0, SAPP_STAT_APBM_EXPAND_MAX_MULTIPLE, count);
+ mstat[tseq]->sys_stat.count[SAPP_STAT_APBM_EXPAND_MAX_MULTIPLE] = count;
count = 0;
bloomfilter_get_stat_by_type(bm_handle, SAPP_STAT_DABM_RESIZE_MAX_RATIO, &count);
- sapp_fs3_metric_set(0, SAPP_STAT_DABM_RESIZE_MAX_RATIO, count);
+ mstat[tseq]->sys_stat.count[SAPP_STAT_DABM_RESIZE_MAX_RATIO] = count;
return 0;
}
@@ -215,7 +216,7 @@ int bloomfilter_get_mem_stat(int tseq, long long *mem_blocks, long long *mem_byt
break;
}
- bloomfilter_get_stat(bm_handle);
+ bloomfilter_get_stat(tseq, bm_handle);
return 0;
}
@@ -275,8 +276,8 @@ static inline int sapp_set_dup_pkt_key(enum addr_type_t addr_type, enum stream_t
if (stream_type == STREAM_TYPE_UDP)
{
const struct mesa_udp_hdr *uhdr = (const struct mesa_udp_hdr *)l4_hdr;
- l4->tcp_seq = 0x5A5A5A5A; /* udp没有, 但设�?0可能对某些hash函数不友�?, 此处设个固定�? */
- l4->tcp_ack = 0xA5A5A5A5; /* udp没有, 但设�?0可能对某些hash函数不友�?, 此处设个固定�? */
+ l4->tcp_seq = 0x5A5A5A5A; /* udp没有, 但设�??0可能对某些hash函数不友�??, 此处设个固定�?? */
+ l4->tcp_ack = 0xA5A5A5A5; /* udp没有, 但设�??0可能对某些hash函数不友�??, 此处设个固定�?? */
l4->sport = uhdr->uh_sport;
l4->dport = uhdr->uh_dport;
l4->checksum = uhdr->uh_sum;
@@ -350,8 +351,8 @@ int sapp_dup_pkt_init(void)
return 0;
}
- /* 流量入口有三个开�?, 识别句柄只有一�?,
- 拆分句柄多耗费内存, 且判断时每个包需要扫描多个句�?,
+ /* 流量入口有三个开�??, 识别句柄只有一�??,
+ 拆分句柄多耗费内存, 且判断时每个包需要扫描多个句�??,
可能好处只是准确率高了一点点而已 */
struct timeval now={time(NULL), 0};
for(i = 0; i < sapp_global_val->config.cpu.worker_threads; i++){
diff --git a/src/extensions/sapp_metrics.cpp b/src/extensions/sapp_metrics.cpp
index d8239fe..f5b7056 100644
--- a/src/extensions/sapp_metrics.cpp
+++ b/src/extensions/sapp_metrics.cpp
@@ -639,10 +639,10 @@ static int sapp_fs3_init(sapp_global_t *global_paramters)
|| dup_cfg->dup_pkt_distinguish_all_inject)
{
fs3_rt->metrics_ids[0][SAPP_STAT_BM_HASH_NUM] = fieldstat_register(fs3_handle, FIELD_TYPE_GAUGE, "BM_HASH_NUM", NULL, 0);
- fs3_rt->metrics_ids[0][SAPP_STAT_BM_EXPAND_NUM] = fieldstat_register(fs3_handle, FIELD_TYPE_GAUGE, "BM_EXPAND_NUM", NULL, 0);
+ fs3_rt->metrics_ids[0][SAPP_STAT_BM_EXPAND_NUM] = fieldstat_register(fs3_handle, FIELD_TYPE_COUNTER, "BM_EXPAND", NULL, 0);
fs3_rt->metrics_ids[0][SAPP_STAT_BM_SLICE_NUM_NEW] = fieldstat_register(fs3_handle, FIELD_TYPE_COUNTER, "BM_SLICE_NEW", NULL, 0);
fs3_rt->metrics_ids[0][SAPP_STAT_BM_SLICE_NUM_FREE] = fieldstat_register(fs3_handle, FIELD_TYPE_COUNTER, "BM_SLICE_FREE", NULL, 0);
- fs3_rt->metrics_ids[0][SAPP_STAT_BM_CUR_SLICE_NUM] = fieldstat_register(fs3_handle, FIELD_TYPE_GAUGE, "BM_CUR_SLICE_NUM", NULL, 0);
+ fs3_rt->metrics_ids[0][SAPP_STAT_BM_CUR_SLICE_NUM] = fieldstat_register(fs3_handle, FIELD_TYPE_GAUGE, "BM_MAX_SLICE", NULL, 0);
fs3_rt->metrics_ids[0][SAPP_STAT_APBM_EXPAND_MAX_MULTIPLE] = fieldstat_register(fs3_handle, FIELD_TYPE_GAUGE, "APBM_EXPAND_MULTIPLE", NULL, 0);
fs3_rt->metrics_ids[0][SAPP_STAT_DABM_RESIZE_MAX_RATIO] = fieldstat_register(fs3_handle, FIELD_TYPE_GAUGE, "DABM_MAX_RESIZE_RATIO", NULL, 0);
}
diff --git a/src/packet_io/packet_io_status.cpp b/src/packet_io/packet_io_status.cpp
index f8ed442..4f1f81a 100644
--- a/src/packet_io/packet_io_status.cpp
+++ b/src/packet_io/packet_io_status.cpp
@@ -237,6 +237,22 @@ static void packet_io_update_metrics_fs3(void)
sapp_fs3_metric_incrby(0, SAPP_STAT_TCP_TRY_TIMEOUTS,cur_count[SAPP_STAT_TCP_TRY_TIMEOUTS]-history_count[SAPP_STAT_TCP_TRY_TIMEOUTS]);
sapp_fs3_metric_incrby(0, SAPP_STAT_UDP_TRY_TIMEOUTS,cur_count[SAPP_STAT_UDP_TRY_TIMEOUTS]-history_count[SAPP_STAT_UDP_TRY_TIMEOUTS]);
+
+ const sapp_dup_pkt_t *dup_cfg = &sapp_global_val->config.packet_io.dup_pkt_para;
+ if (dup_cfg->kickout_udp_stream_enabled
+ || dup_cfg->dup_pkt_distinguish_ipv4_tcp
+ || dup_cfg->dup_pkt_distinguish_ipv4_udp
+ || dup_cfg->dup_pkt_distinguish_all_inject)
+ {
+ sapp_fs3_metric_set(0, SAPP_STAT_BM_HASH_NUM, cur_count[SAPP_STAT_BM_HASH_NUM]);
+ sapp_fs3_metric_incrby(0, SAPP_STAT_BM_EXPAND_NUM, cur_count[SAPP_STAT_BM_EXPAND_NUM]-history_count[SAPP_STAT_BM_EXPAND_NUM]);
+ sapp_fs3_metric_incrby(0, SAPP_STAT_BM_SLICE_NUM_NEW, cur_count[SAPP_STAT_BM_SLICE_NUM_NEW]-history_count[SAPP_STAT_BM_SLICE_NUM_NEW]);
+ sapp_fs3_metric_incrby(0, SAPP_STAT_BM_SLICE_NUM_FREE, cur_count[SAPP_STAT_BM_SLICE_NUM_FREE]-history_count[SAPP_STAT_BM_SLICE_NUM_FREE]);
+ sapp_fs3_metric_set(0, SAPP_STAT_BM_CUR_SLICE_NUM, cur_count[SAPP_STAT_BM_CUR_SLICE_NUM]);
+ sapp_fs3_metric_set(0, SAPP_STAT_APBM_EXPAND_MAX_MULTIPLE, cur_count[SAPP_STAT_APBM_EXPAND_MAX_MULTIPLE]);
+ sapp_fs3_metric_set(0, SAPP_STAT_DABM_RESIZE_MAX_RATIO, cur_count[SAPP_STAT_DABM_RESIZE_MAX_RATIO]);
+ }
+
return;
}
@@ -313,6 +329,18 @@ static void sysinfo_output_per_layer_stat(FILE *fp)
return;
}
+static void sysinfo_find_the_maximum_value(sapp_sys_stat_type_t stype)
+{
+ sapp_gval_mthread_t **mstat = sapp_global_val->mthread_volatile;
+ unsigned long long max_val = 0;
+ for (int i = 0; i < g_packet_io_thread_num; i++){
+ if (max_val < mstat[i]->sys_stat.count[stype]){
+ max_val = mstat[i]->sys_stat.count[stype];
+ }
+ }
+ cur_count[stype] = max_val;
+}
+
void sysinfo_output(void)
{
int i, j;
@@ -351,6 +379,11 @@ void sysinfo_output(void)
}
}
+ sysinfo_find_the_maximum_value(SAPP_STAT_BM_HASH_NUM);
+ sysinfo_find_the_maximum_value(SAPP_STAT_BM_CUR_SLICE_NUM);
+ sysinfo_find_the_maximum_value(SAPP_STAT_APBM_EXPAND_MAX_MULTIPLE);
+ sysinfo_find_the_maximum_value(SAPP_STAT_DABM_RESIZE_MAX_RATIO);
+
for(i=0;i<g_packet_io_thread_num;i++){
for(j = 0; j < PROJECT_REQ_MAX_PLUG_NUM; j++){
cur_project_in_use_array[j] += mstat[i]->sys_stat.count_project_in_use[j];
diff --git a/src/support/dablooms/src/dablooms.c b/src/support/dablooms/src/dablooms.c
index 7ecbe4d..63fbc5d 100755
--- a/src/support/dablooms/src/dablooms.c
+++ b/src/support/dablooms/src/dablooms.c
@@ -27,6 +27,27 @@
#define FREE(p, mstat) dabm_free(p, mstat)
#define REALLOC(p, size, mstat) dabm_realloc(p, size, mstat)
+struct expiry_dablooms_handle_entity{
+ scaling_bloom_t *cur_bloom;
+ scaling_bloom_t *next_bloom;
+ long cur_bloom_start_ms;
+ long next_bloom_start_ms;
+ long last_bloom_check_ms;
+ uint64_t cur_bloom_inc_id;
+ uint64_t next_bloom_inc_id;
+ unsigned int capacity;
+ long expiry_time_ms;
+ long cur_time_ms;
+ long transition_time_ms;
+ double error_rate;
+ struct dabm_mem_stat mstat;
+ size_t bloom_new_num;
+ size_t bloom_free_num;
+ size_t expand_num_acc;
+ size_t slice_num_rt;
+ double expand_size_ratio_rt; //current bitmap size / defalut bitmap size * 100
+};
+
const char *dablooms_version(void)
{
return DABLOOMS_VERSION;
@@ -319,7 +340,7 @@ static int free_scaling_bloom(scaling_bloom_t *bloom, struct dabm_mem_stat *msta
}
/* creates a new counting bloom filter from a given scaling bloom filter, with count and id */
-counting_bloom_t *new_counting_bloom_from_scale(scaling_bloom_t *bloom, struct dabm_mem_stat *mstat)
+counting_bloom_t *new_counting_bloom_from_scale(struct expiry_dablooms_handle_entity *handle, scaling_bloom_t *bloom, struct dabm_mem_stat *mstat)
{
long offset;
double error_rate;
@@ -339,8 +360,8 @@ counting_bloom_t *new_counting_bloom_from_scale(scaling_bloom_t *bloom, struct d
bloom->bitmap = bitmap_resize(bloom->bitmap, bloom->num_bytes, bloom->num_bytes + cur_bloom->num_bytes, mstat);
if(bloom->num_bytes > sizeof(scaling_bloom_header_t)){
- bloom->stat.expand_num_acc++;
- bloom->stat.expand_size_ratio_rt *= (double)(bloom->num_bytes + cur_bloom->num_bytes) / bloom->num_bytes;
+ handle->expand_num_acc++;
+ handle->expand_size_ratio_rt *= (double)(bloom->num_bytes + cur_bloom->num_bytes) / bloom->num_bytes;
}
/* reset header pointer, as mmap may have moved */
@@ -348,7 +369,7 @@ counting_bloom_t *new_counting_bloom_from_scale(scaling_bloom_t *bloom, struct d
/* Set the pointers for these header structs to the right location since mmap may have moved */
bloom->num_blooms++;
- bloom->stat.slice_num_rt = bloom->num_blooms;
+ handle->slice_num_rt = bloom->num_blooms;
for (unsigned int i = 0; i < bloom->num_blooms; i++) {
offset = bloom->blooms[i]->offset - sizeof(counting_bloom_header_t);
bloom->blooms[i]->header = (counting_bloom_header_t *) (bloom->bitmap->array + offset);
@@ -376,7 +397,8 @@ uint64_t scaling_bloom_clear_seqnums(scaling_bloom_t *bloom)
return seqnum;
}
-static int scaling_bloom_add(scaling_bloom_t *bloom, const uint32_t checksum[4], uint64_t id, struct dabm_mem_stat *mstat)
+static int scaling_bloom_add(struct expiry_dablooms_handle_entity *handle, scaling_bloom_t *bloom,
+ const uint32_t checksum[4], uint64_t id, struct dabm_mem_stat *mstat)
{
int i;
uint64_t seqnum;
@@ -392,7 +414,7 @@ static int scaling_bloom_add(scaling_bloom_t *bloom, const uint32_t checksum[4],
seqnum = scaling_bloom_clear_seqnums(bloom);
if ((id > bloom->header->max_id) && (cur_bloom->header->count >= cur_bloom->capacity - 1)) {
- cur_bloom = new_counting_bloom_from_scale(bloom, mstat);
+ cur_bloom = new_counting_bloom_from_scale(handle, bloom, mstat);
cur_bloom->header->count = 0;
cur_bloom->header->id = bloom->header->max_id + 1;
}
@@ -483,13 +505,13 @@ scaling_bloom_t *scaling_bloom_init(unsigned int capacity, double error_rate,str
return bloom;
}
-static scaling_bloom_t *new_scaling_bloom(unsigned int capacity, double error_rate, struct dabm_mem_stat *mstat)
+static scaling_bloom_t *new_scaling_bloom(struct expiry_dablooms_handle_entity *handle, unsigned int capacity, double error_rate, struct dabm_mem_stat *mstat)
{
scaling_bloom_t *bloom;
counting_bloom_t *cur_bloom;
bloom = scaling_bloom_init(capacity, error_rate, mstat);
- cur_bloom = new_counting_bloom_from_scale(bloom, mstat);
+ cur_bloom = new_counting_bloom_from_scale(handle, bloom, mstat);
// if (!()) {
// fprintf(stderr, "Error, Could not create counting bloom\n");
// free_scaling_bloom(bloom, mstat);
@@ -500,27 +522,10 @@ static scaling_bloom_t *new_scaling_bloom(unsigned int capacity, double error_ra
cur_bloom->header->id = 0;
bloom->header->mem_seqnum = 1;
- bloom->stat.expand_size_ratio_rt = 1.0;
+ handle->expand_size_ratio_rt = 1.0;
return bloom;
}
-struct expiry_dablooms_handle_entity{
- scaling_bloom_t *cur_bloom;
- scaling_bloom_t *next_bloom;
- long cur_bloom_start_ms;
- long next_bloom_start_ms;
- long last_bloom_check_ms;
- uint64_t cur_bloom_inc_id;
- uint64_t next_bloom_inc_id;
- unsigned int capacity;
- long expiry_time_ms;
- long cur_time_ms;
- long transition_time_ms;
- double error_rate;
- struct dabm_mem_stat mstat;
- size_t bloom_new_num;
- size_t bloom_free_num;
-};
/* 24.05, split bloomfilter into multiple partition to avoid blocking caused by memset large memory */
struct expiry_dablooms_handle{
@@ -562,7 +567,7 @@ void expiry_dablooms_destroy(struct expiry_dablooms_handle *handle){
static struct expiry_dablooms_handle_entity* expiry_dablooms_init_entity(unsigned int capacity, double error_rate, long cur_time_ms, long expiry_time_ms, long transition_time_ms){
struct expiry_dablooms_handle_entity *handle = (struct expiry_dablooms_handle_entity *)calloc(1, sizeof(struct expiry_dablooms_handle_entity));
- scaling_bloom_t *cur_bloom = new_scaling_bloom(capacity, error_rate, &handle->mstat);
+ scaling_bloom_t *cur_bloom = new_scaling_bloom(handle, capacity, error_rate, &handle->mstat);
if(cur_bloom == NULL){
goto error_out;
}
@@ -651,7 +656,7 @@ static int bloom_expired_check(struct expiry_dablooms_handle_entity *handle, lon
handle->last_bloom_check_ms=0;
}
else{
- scaling_bloom_t *cur_bloom = new_scaling_bloom(handle->capacity, handle->error_rate, mstat);
+ scaling_bloom_t *cur_bloom = new_scaling_bloom(handle, handle->capacity, handle->error_rate, mstat);
if(unlikely(cur_bloom == NULL)){
return EXPIRY_DABLOOMS_ERRNO_NEW_BLOOM_FAIL;
}
@@ -685,7 +690,7 @@ static int expiry_dablooms_add_entity(struct expiry_dablooms_handle_entity *hand
int is_transition = bloom_in_transition_period(handle, cur_time_ms);
if(unlikely(is_transition != 0)){
if(unlikely(handle->next_bloom == NULL)){
- scaling_bloom_t *next_bloom = new_scaling_bloom(handle->capacity, handle->error_rate, &handle->mstat);
+ scaling_bloom_t *next_bloom = new_scaling_bloom(handle, handle->capacity, handle->error_rate, &handle->mstat);
if(next_bloom == NULL){
return EXPIRY_DABLOOMS_ERRNO_NEW_BLOOM_FAIL;
}
@@ -694,10 +699,10 @@ static int expiry_dablooms_add_entity(struct expiry_dablooms_handle_entity *hand
handle->next_bloom_inc_id = 0;
handle->next_bloom_start_ms=cur_time_ms;
}
- scaling_bloom_add(handle->next_bloom, checksum, handle->next_bloom_inc_id, &handle->mstat);
+ scaling_bloom_add(handle,handle->next_bloom, checksum, handle->next_bloom_inc_id, &handle->mstat);
handle->next_bloom_inc_id++;
}else{
- scaling_bloom_add(handle->cur_bloom, checksum, handle->cur_bloom_inc_id, &handle->mstat);
+ scaling_bloom_add(handle,handle->cur_bloom, checksum, handle->cur_bloom_inc_id, &handle->mstat);
handle->cur_bloom_inc_id++;
}
@@ -799,12 +804,7 @@ size_t DA_bloom_stat_get_expand_num(const struct expiry_dablooms_handle *bloom)
size_t tot_num = 0;
for(int i = 0; i < bloom->bm_partition_num; i++){
const struct expiry_dablooms_handle_entity *bm_entity = bloom->bm_handle[i];
- if(bm_entity->cur_bloom){
- tot_num += bm_entity->cur_bloom->stat.expand_num_acc;
- }
- if(bm_entity->next_bloom){
- tot_num += bm_entity->next_bloom->stat.expand_num_acc;
- }
+ tot_num += bm_entity->expand_num_acc;
}
return tot_num;
}
@@ -813,12 +813,7 @@ size_t DA_bloom_stat_get_cur_slice_num(const struct expiry_dablooms_handle *bloo
size_t tot_num = 0;
for(int i = 0; i < bloom->bm_partition_num; i++){
const struct expiry_dablooms_handle_entity *bm_entity = bloom->bm_handle[i];
- if(bm_entity->cur_bloom){
- tot_num += bm_entity->cur_bloom->stat.slice_num_rt;
- }
- if(bm_entity->next_bloom){
- tot_num += bm_entity->next_bloom->stat.slice_num_rt;
- }
+ tot_num += bm_entity->slice_num_rt;
}
return tot_num;
}
@@ -827,16 +822,9 @@ size_t DA_bloom_stat_get_resize_ratio(const struct expiry_dablooms_handle *bloom
double max_ratio = 1.000;
for(int i = 0; i < bloom->bm_partition_num; i++){
const struct expiry_dablooms_handle_entity *bm_entity = bloom->bm_handle[i];
- if(bm_entity->cur_bloom){
- if(bm_entity->cur_bloom->stat.expand_size_ratio_rt > max_ratio){
- max_ratio = bm_entity->cur_bloom->stat.expand_size_ratio_rt;
- }
- }
- if(bm_entity->next_bloom){
- if(bm_entity->next_bloom->stat.expand_size_ratio_rt > max_ratio){
- max_ratio = bm_entity->next_bloom->stat.expand_size_ratio_rt;
- }
+ if(bm_entity->expand_size_ratio_rt > max_ratio){
+ max_ratio = bm_entity->expand_size_ratio_rt;
}
}
return (size_t)(max_ratio * 100.0);
-} \ No newline at end of file
+}
diff --git a/src/support/dablooms/src/dablooms.h b/src/support/dablooms/src/dablooms.h
index 1c5a342..4bd156b 100755
--- a/src/support/dablooms/src/dablooms.h
+++ b/src/support/dablooms/src/dablooms.h
@@ -41,11 +41,6 @@ typedef struct {
uint32_t _pad;
} counting_bloom_header_t;
-struct DA_bloom_stat{
- size_t expand_num_acc;
- double expand_size_ratio_rt; //current bitmap size / defalut bitmap size * 100
- size_t slice_num_rt;
-};
typedef struct {
counting_bloom_header_t *header;
unsigned int capacity;
@@ -79,7 +74,6 @@ typedef struct {
double error_rate;
counting_bloom_t **blooms;
bitmap_t *bitmap;
- struct DA_bloom_stat stat;
} scaling_bloom_t;
// scaling_bloom_t *new_scaling_bloom(unsigned int capacity, double error_rate);