Changeset 2458 for XIOS3/trunk/src/manager/services_manager.cpp
- Timestamp:
- 01/25/23 16:59:46 (17 months ago)
- Location:
- XIOS3/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk
-
Property
svn:mergeinfo
set to
False
/XIOS3/dev/XIOS_FILE_SERVICES merged eligible
-
Property
svn:mergeinfo
set to
False
-
XIOS3/trunk/src/manager/services_manager.cpp
r2404 r2458 54 54 55 55 int leader ; 56 int poolSize ;56 int poolSize, poolFreeSize ; 57 57 58 58 info(40)<<"CServicesManager : waiting for pool info : "<<poolId<<endl ; ; 59 bool ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, leader) ;59 bool ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, poolFreeSize, leader) ; 60 60 if (wait) 61 61 { … … 63 63 { 64 64 CXios::getDaemonsManager()->eventLoop() ; 65 ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, leader) ;65 ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, poolFreeSize, leader) ; 66 66 } 67 67 } … … 70 70 { 71 71 info(40)<<"CServicesManager : create service notification to leader "<<leader<<", serviceId : "<<serviceId<<", size : "<<size<<endl ; 72 CXios::getRessourcesManager()->decreasePoolFreeSize(poolId ,size) ; 72 73 createServicesNotify(leader, serviceId, type, size, nbPartitions) ; 73 74 return true ; … … 81 82 int leader ; 82 83 int poolSize ; 84 int poolFreeSize ; 83 85 84 86 info(40)<<"CServicesManager : waiting for pool info : "<<poolId<<endl ; ; 85 bool ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, leader) ;87 bool ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, poolFreeSize, leader) ; 86 88 if (wait) 87 89 { … … 89 91 { 90 92 CXios::getDaemonsManager()->eventLoop() ; 91 ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, leader) ;93 ok=CXios::getRessourcesManager()->getPoolInfo(poolId, poolSize, poolFreeSize, leader) ; 92 94 } 93 95 } … … 251 253 252 254 bool CServicesManager::getServiceInfo(const std::string& poolId, const std::string& serviceId, const int& partitionId, int& type, 253 int& size, int& nbPartitions, int& leader )255 int& size, int& nbPartitions, int& leader, bool wait) 254 256 { 255 257 … … 259 261 260 262 auto it=services_.find(std::tuple<std::string,std::string,int>(poolId,serviceId,partitionId)) ; 261 if ( it == services_.end() ) return false ;263 if ( it == services_.end() && !wait) return false ; 262 264 else 263 265 { 266 if (wait) waitServiceRegistration(poolId, serviceId, partitionId) ; 264 267 type= std::get<0>(it->second); 265 268 size= std::get<1>(it->second); … … 270 273 } 271 274 272 bool CServicesManager::getServiceLeader(const std::string& poolId, const std::string& serviceId, const int& partitionId, int& leader )275 bool CServicesManager::getServiceLeader(const std::string& poolId, const std::string& serviceId, const int& partitionId, int& leader, bool wait) 273 276 { 274 277 int type; … … 278 281 } 279 282 280 bool CServicesManager::getServiceType(const std::string& poolId, const std::string& serviceId, const int& partitionId, int& type )283 bool CServicesManager::getServiceType(const std::string& poolId, const std::string& serviceId, const int& partitionId, int& type, bool wait) 281 284 { 282 285 int size ; … … 286 289 } 287 290 288 bool CServicesManager::getServiceNbPartitions(const std::string& poolId, const std::string& serviceId, const int& partitionId, int& nbPartitions )291 bool CServicesManager::getServiceNbPartitions(const std::string& poolId, const std::string& serviceId, const int& partitionId, int& nbPartitions, bool wait) 289 292 { 290 293 int size ; … … 303 306 else return true ; 304 307 } 308 309 void CServicesManager::waitServiceRegistration(const std::string& poolId, const std::string& serviceId, const int& partitionId) 310 { 311 while(!hasService(poolId,serviceId,partitionId)) CXios::getDaemonsManager()->servicesEventLoop() ; 312 } 305 313 306 314 }
Note: See TracChangeset
for help on using the changeset viewer.