Skip to content

Commit 60e1dd9

Browse files
author
Kirc
committed
Remove element_types
1 parent c5d6f65 commit 60e1dd9

File tree

2 files changed

+2
-48
lines changed

2 files changed

+2
-48
lines changed

plugins/storage/fastbit/config_struct.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ struct fastbit_config {
5858
std::map<uint32_t, /* ODID */
5959
struct od_info>*> *od_infos;
6060

61-
/* Element types from ipfix-elements.xml is loaded into elements_types
62-
* (Enterprise ID -> element ID -> element storage type)
63-
*/
64-
std::map<uint32_t, std::map<uint16_t, enum store_type>> *elements_types;
65-
6661
/* Element lengths from ipfix-elements.xml is loaded into elements_lengths
6762
* (Enterprise ID -> element ID -> element storage type)
6863
*/

plugins/storage/fastbit/fastbit.cpp

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ int load_types_from_xml(struct fastbit_config *conf)
9595
uint32_t en;
9696
uint16_t id;
9797
int len;
98-
enum store_type type;
9998
std::string str_value;
10099

101100
result = doc.load_file(ipfix_elements);
@@ -111,45 +110,12 @@ int load_types_from_xml(struct fastbit_config *conf)
111110
{
112111
str_value = it->node().child_value("enterprise");
113112
en = strtoul(str_value.c_str(), NULL, 0);
113+
114114
str_value = it->node().child_value("id");
115115
id = strtoul(str_value.c_str(), NULL, 0);
116-
str_value = it->node().child_value("dataType");
117116

118117
/* Obtain field type */
119-
if (str_value == "boolean" \
120-
or str_value == "dateTimeSeconds" \
121-
or str_value == "dateTimeMicroseconds" \
122-
or str_value == "dateTimeMilliseconds" \
123-
or str_value == "dateTimeNanoseconds" \
124-
or str_value == "ipv4Address" \
125-
or str_value == "macAddress" \
126-
or str_value == "unsigned8" \
127-
or str_value == "unsigned16" \
128-
or str_value == "unsigned32" \
129-
or str_value == "unsigned64") {
130-
type = UINT;
131-
} else if (str_value == "signed8" \
132-
or str_value == "signed16" \
133-
or str_value == "signed32" \
134-
or str_value == "signed64") {
135-
type = INT;
136-
} else if (str_value == "ipv6Address") {
137-
type = IPV6;
138-
} else if (str_value == "float32" \
139-
or str_value == "float64") {
140-
type = FLOAT;
141-
} else if (str_value == "string") {
142-
type = TEXT;
143-
} else if (str_value == "octetArray" \
144-
or str_value == "basicList" \
145-
or str_value == "subTemplateList" \
146-
or str_value== "subTemplateMultiList") {
147-
type = BLOB;
148-
} else {
149-
type = UNKNOWN;
150-
}
151-
152-
(*conf->elements_types)[en][id] = type;
118+
str_value = it->node().child_value("dataType");
153119

154120
/* Obtain field length */
155121
if (str_value == "unsigned64" \
@@ -524,12 +490,6 @@ int storage_init(char *params, void **config)
524490
return 1;
525491
}
526492

527-
c->elements_types = new std::map<uint32_t, std::map<uint16_t, enum store_type>>;
528-
if (c->elements_types == NULL) {
529-
MSG_ERROR(msg_module, "Memory allocation failed (%s:%d)", __FILE__, __LINE__);
530-
return 1;
531-
}
532-
533493
c->elements_lengths = new std::map<uint32_t, std::map<uint16_t, int>>;
534494
if (c->elements_lengths == NULL) {
535495
MSG_ERROR(msg_module, "Memory allocation failed (%s:%d)", __FILE__, __LINE__);
@@ -769,7 +729,6 @@ int storage_close(void **config)
769729
delete od_infos;
770730
delete conf->index_en_id;
771731
delete conf->dirs;
772-
delete conf->elements_types;
773732
delete conf->elements_lengths;
774733
delete conf;
775734
return 0;

0 commit comments

Comments
 (0)