| 994 | |
| 995 | |
| 996 | void ResourceProviderManagerProcess::updateState( |
| 997 | ResourceProvider* resourceProvider, |
| 998 | const Call::UpdateState& update) |
| 999 | { |
| 1000 | foreach (const Resource& resource, update.resources()) { |
| 1001 | CHECK_EQ(resource.provider_id(), resourceProvider->info.id()); |
| 1002 | } |
| 1003 | |
| 1004 | // TODO(chhsiao): Report pending operations. |
| 1005 | |
| 1006 | hashmap<UUID, Operation> operations; |
| 1007 | foreach (const Operation &operation, update.operations()) { |
| 1008 | operations.put(operation.uuid(), operation); |
| 1009 | } |
| 1010 | |
| 1011 | LOG(INFO) |
| 1012 | << "Received UPDATE_STATE call with resources '" << update.resources() |
| 1013 | << "' and " << operations.size() << " operations from resource provider " |
| 1014 | << resourceProvider->info.id(); |
| 1015 | |
| 1016 | ResourceProviderMessage::UpdateState updateState{ |
| 1017 | resourceProvider->info.id(), |
| 1018 | update.resource_version_uuid(), |
| 1019 | update.resources(), |
| 1020 | std::move(operations)}; |
| 1021 | |
| 1022 | ResourceProviderMessage message; |
| 1023 | message.type = ResourceProviderMessage::Type::UPDATE_STATE; |
| 1024 | message.updateState = std::move(updateState); |
| 1025 | |
| 1026 | messages.put(std::move(message)); |
| 1027 | } |
| 1028 | |
| 1029 | |
| 1030 | void ResourceProviderManagerProcess::updatePublishResourcesStatus( |