@@ -281,7 +281,7 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
281281
282282 int32_t edge_group_num = 0 ;
283283 if (!bytes_reader.GetInt32 (&edge_group_num)) {
284- LOG (ERROR) << " edge group num error" ;
284+ LOG (ERROR) << " edge group num error, node_id: " << id_ ;
285285 return false ;
286286 }
287287
@@ -293,20 +293,22 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
293293 std::vector<int32_t > edge_group_size_list;
294294 if (!bytes_reader.GetInt32List (edge_group_num,
295295 &edge_group_size_list)) {
296- LOG (ERROR) << " edge group size list error" ;
296+ LOG (ERROR) << " edge group size list error, node_id: " << id_ ;
297297 return false ;
298298 }
299299
300300 std::vector<float > edge_group_weight_list;
301301 if (!bytes_reader.GetFloatList (edge_group_num,
302302 &edge_group_weight_list)) {
303- LOG (ERROR) << " edge group weight list error" ;
303+ LOG (ERROR) << " edge group weight list error, node_id: " << id_ ;
304304 return false ;
305305 }
306306
307307 // build edge_group_collection_
308- edge_group_collection_.Init (edge_group_ids, edge_group_weight_list);
309-
308+ if (!edge_group_collection_.Init (edge_group_ids, edge_group_weight_list)) {
309+ LOG (ERROR) << " edge group collection error, node_id: " << id_;
310+ return false ;
311+ }
310312 // build neighbors info
311313 int32_t total_neighbors_num = 0 ;
312314 std::vector<std::vector<uint64_t >> ids_list (edge_group_num);
@@ -317,7 +319,7 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
317319 ids_list[i] = std::vector<uint64_t >();
318320 if (!bytes_reader.GetUInt64List (edge_group_size_list[i],
319321 &ids_list[i])) {
320- LOG (ERROR) << " neighbor id list error" ;
322+ LOG (ERROR) << " neighbor id list error, node_id: " << id_ ;
321323 return false ;
322324 }
323325 }
@@ -327,7 +329,7 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
327329 weights_list[i] = std::vector<float >();
328330 if (!bytes_reader.GetFloatList (edge_group_size_list[i],
329331 &weights_list[i])) {
330- LOG (ERROR) << " neighbor weight list error" ;
332+ LOG (ERROR) << " neighbor weight list error, node_id: " << id_ ;
331333 return false ;
332334 }
333335 }
@@ -356,16 +358,15 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
356358 neighbors_weight_.push_back (sum_weight);
357359 }
358360 }
359-
360361 // parse uint64 feature
361362 int32_t uint64_feature_type_num = 0 ;
362363 if (!bytes_reader.GetInt32 (&uint64_feature_type_num)) {
363- LOG (ERROR) << " uint64 feature type num error" ;
364+ LOG (ERROR) << " uint64 feature type num error, node_id: " << id_ ;
364365 return false ;
365366 }
366367 if (!bytes_reader.GetInt32List (uint64_feature_type_num,
367368 &uint64_features_idx_)) {
368- LOG (ERROR) << " uint64 feature idx list error" ;
369+ LOG (ERROR) << " uint64 feature idx list error, node_id: " << id_ ;
369370 return false ;
370371 }
371372 int32_t uint64_fv_num = 0 ;
@@ -374,19 +375,19 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
374375 uint64_features_idx_[i] = uint64_fv_num;
375376 }
376377 if (!bytes_reader.GetUInt64List (uint64_fv_num, &uint64_features_)) {
377- LOG (ERROR) << " uint64 feature value list error" ;
378+ LOG (ERROR) << " uint64 feature value list error, node_id: " << id_ ;
378379 return false ;
379380 }
380381
381382 // parse float feature
382383 int32_t float_feature_type_num = 0 ;
383384 if (!bytes_reader.GetInt32 (&float_feature_type_num)) {
384- LOG (ERROR) << " float feature type num error" ;
385+ LOG (ERROR) << " float feature type num error, node_id: " << id_ ;
385386 return false ;
386387 }
387388 if (!bytes_reader.GetInt32List (float_feature_type_num,
388389 &float_features_idx_)) {
389- LOG (ERROR) << " float feature idx list error" ;
390+ LOG (ERROR) << " float feature idx list error, node_id: " << id_ ;
390391 return false ;
391392 }
392393 int32_t float_fv_num = 0 ;
@@ -395,19 +396,19 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
395396 float_features_idx_[i] = float_fv_num;
396397 }
397398 if (!bytes_reader.GetFloatList (float_fv_num, &float_features_)) {
398- LOG (ERROR) << " float feature value list error" ;
399+ LOG (ERROR) << " float feature value list error, node_id: " << id_ ;
399400 return false ;
400401 }
401402
402403 // parse binary feature
403404 int32_t binary_feature_type_num = 0 ;
404405 if (!bytes_reader.GetInt32 (&binary_feature_type_num)) {
405- LOG (ERROR) << " binary feature type num error" ;
406+ LOG (ERROR) << " binary feature type num error, node_id: " << id_ ;
406407 return false ;
407408 }
408409 if (!bytes_reader.GetInt32List (binary_feature_type_num,
409410 &binary_features_idx_)) {
410- LOG (ERROR) << " binary feature idx list error" ;
411+ LOG (ERROR) << " binary feature idx list error, node_id: " << id_ ;
411412 return false ;
412413 }
413414 int32_t binary_fv_num = 0 ;
@@ -416,10 +417,9 @@ bool CompactNode::DeSerialize(const char* s, size_t size) {
416417 binary_features_idx_[i] = binary_fv_num;
417418 }
418419 if (!bytes_reader.GetString (binary_fv_num, &binary_features_)) {
419- LOG (ERROR) << " binary feature value list error" ;
420+ LOG (ERROR) << " binary feature value list error, node_id: " << id_ ;
420421 return false ;
421422 }
422-
423423 return true ;
424424}
425425
0 commit comments