@@ -95,7 +95,6 @@ int load_types_from_xml(struct fastbit_config *conf)
95
95
uint32_t en;
96
96
uint16_t id;
97
97
int len;
98
- enum store_type type;
99
98
std::string str_value;
100
99
101
100
result = doc.load_file (ipfix_elements);
@@ -111,45 +110,12 @@ int load_types_from_xml(struct fastbit_config *conf)
111
110
{
112
111
str_value = it->node ().child_value (" enterprise" );
113
112
en = strtoul (str_value.c_str (), NULL , 0 );
113
+
114
114
str_value = it->node ().child_value (" id" );
115
115
id = strtoul (str_value.c_str (), NULL , 0 );
116
- str_value = it->node ().child_value (" dataType" );
117
116
118
117
/* 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" );
153
119
154
120
/* Obtain field length */
155
121
if (str_value == " unsigned64" \
@@ -524,12 +490,6 @@ int storage_init(char *params, void **config)
524
490
return 1 ;
525
491
}
526
492
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
-
533
493
c->elements_lengths = new std::map<uint32_t , std::map<uint16_t , int >>;
534
494
if (c->elements_lengths == NULL ) {
535
495
MSG_ERROR (msg_module, " Memory allocation failed (%s:%d)" , __FILE__, __LINE__);
@@ -769,7 +729,6 @@ int storage_close(void **config)
769
729
delete od_infos;
770
730
delete conf->index_en_id ;
771
731
delete conf->dirs ;
772
- delete conf->elements_types ;
773
732
delete conf->elements_lengths ;
774
733
delete conf;
775
734
return 0 ;
0 commit comments