Ignore:
Timestamp:
06/09/16 11:32:01 (8 years ago)
Author:
mhnguyen
Message:

Improvement of DHT: allow multiple values correspond to one key

+) If there are several returned values corresponding to one key,
all of them are returned by DHT in vector.

Test
+) Testing only very basic. This commit serves as temporary one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/client_server_mapping_distributed.cpp

    r843 r860  
    3737{ 
    3838  ccDHT_->computeIndexInfoMapping(globalIndexOnClient); 
    39   const boost::unordered_map<size_t,int>& infoIndexMap = (ccDHT_->getInfoIndexMap()); 
    40   boost::unordered_map<size_t,int>::const_iterator itb = infoIndexMap.begin(), ite = infoIndexMap.end(), it; 
     39  const CClientClientDHTInt::Index2VectorInfoTypeMap& infoIndexMap = (ccDHT_->getInfoIndexMap()); 
     40  CClientClientDHTInt::Index2VectorInfoTypeMap::const_iterator itb = infoIndexMap.begin(), ite = infoIndexMap.end(), it; 
    4141  std::vector<size_t> nbInfoIndex(ccDHT_->getNbClient(),0); 
    4242 
    4343  for (it = itb; it != ite; ++it) 
    4444  { 
    45     ++nbInfoIndex[it->second]; 
     45    ++nbInfoIndex[it->second[0]]; 
    4646  } 
    4747 
     
    5757  for (it = itb; it != ite; ++it) 
    5858  { 
    59     indexGlobalOnServer_[it->second][nbInfoIndex[it->second]] = (it->first); 
    60     ++nbInfoIndex[it->second]; 
     59    indexGlobalOnServer_[it->second[0]][nbInfoIndex[it->second[0]]] = (it->first); 
     60    ++nbInfoIndex[it->second[0]]; 
    6161  } 
    6262} 
Note: See TracChangeset for help on using the changeset viewer.