Skip to content

Commit

Permalink
Support Type-Lookup Service with new new GUID-less Discovery Server (#…
Browse files Browse the repository at this point in the history
…4768)

* Refs #20953: TLU_request instance name made from CacheChange writer GUID instead of proxy_data

Signed-off-by: cferreiragonz <[email protected]>

* Refs #20953: Add Warning for backup with XTypes

Signed-off-by: cferreiragonz <[email protected]>

* Refs #20953: Update versions.md

Signed-off-by: cferreiragonz <[email protected]>

---------

Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz authored Jul 29, 2024
1 parent 3dd5cfe commit fc2fb99
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,20 @@ SampleIdentity TypeLookupManager::get_types(

ReturnCode_t TypeLookupManager::async_get_type(
eprosima::ProxyPool<eprosima::fastdds::rtps::WriterProxyData>::smart_ptr& temp_writer_data,
const fastdds::rtps::GUID_t& type_server,
const AsyncGetTypeWriterCallback& callback)
{
return check_type_identifier_received<eprosima::fastdds::rtps::WriterProxyData>(
temp_writer_data, callback, async_get_type_writer_callbacks_);
temp_writer_data, type_server, callback, async_get_type_writer_callbacks_);
}

ReturnCode_t TypeLookupManager::async_get_type(
eprosima::ProxyPool<eprosima::fastdds::rtps::ReaderProxyData>::smart_ptr& temp_reader_data,
const fastdds::rtps::GUID_t& type_server,
const AsyncGetTypeReaderCallback& callback)
{
return check_type_identifier_received<eprosima::fastdds::rtps::ReaderProxyData>(
temp_reader_data, callback, async_get_type_reader_callbacks_);
temp_reader_data, type_server, callback, async_get_type_reader_callbacks_);
}

TypeKind TypeLookupManager::get_type_kind_to_propagate() const
Expand All @@ -346,6 +348,7 @@ TypeKind TypeLookupManager::get_type_kind_to_propagate() const
template <typename ProxyType, typename AsyncCallback>
ReturnCode_t TypeLookupManager::check_type_identifier_received(
typename eprosima::ProxyPool<ProxyType>::smart_ptr& temp_proxy_data,
const fastdds::rtps::GUID_t& type_server,
const AsyncCallback& callback,
std::unordered_map<xtypes::TypeIdentfierWithSize,
std::vector<std::pair<ProxyType*,
Expand All @@ -356,7 +359,6 @@ ReturnCode_t TypeLookupManager::check_type_identifier_received(
TK_NONE ?
temp_proxy_data->type_information().type_information.complete().typeid_with_size() :
temp_proxy_data->type_information().type_information.minimal().typeid_with_size();
fastdds::rtps::GUID_t type_server = temp_proxy_data->guid();

// Check if the type is known
if (fastdds::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,19 @@ class TypeLookupManager
* Use builtin TypeLookup service to solve the type and dependencies of a given TypeInformation.
* It receives a callback that will be used to notify when the negotiation is complete.
* @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request.
* @param type_server[in] GUID of the remote participant that has the type.
* @param callback Callback called when the negotiation is complete.
* @return ReturnCode_t RETCODE_OK if the type is already known.
* RETCODE_NO_DATA if type is not known, and a negotiation has been started.
* RETCODE_ERROR if any request was not sent correctly.
*/
ReturnCode_t async_get_type(
eprosima::ProxyPool<eprosima::fastdds::rtps::WriterProxyData>::smart_ptr& temp_proxy_data,
const fastdds::rtps::GUID_t& type_server,
const AsyncGetTypeWriterCallback& callback);
ReturnCode_t async_get_type(
eprosima::ProxyPool<eprosima::fastdds::rtps::ReaderProxyData>::smart_ptr& temp_proxy_data,
const fastdds::rtps::GUID_t& type_server,
const AsyncGetTypeReaderCallback& callback);

/**
Expand All @@ -205,6 +208,7 @@ class TypeLookupManager
* Adds a callback to the async_get_type_callbacks_ entry of the TypeIdentfierWithSize, or creates a new one if
* TypeIdentfierWithSize was not in the map before
* @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request.
* @param type_server[in] GUID of the remote participant that has the type.
* @param callback[in] Callback to add.
* @param async_get_type_callbacks[in] The collection ProxyData and their callbacks to use.
* @return ReturnCode_t RETCODE_OK if type is known.
Expand All @@ -214,6 +218,7 @@ class TypeLookupManager
template <typename ProxyType, typename AsyncCallback>
ReturnCode_t check_type_identifier_received(
typename eprosima::ProxyPool<ProxyType>::smart_ptr& temp_proxy_data,
const fastdds::rtps::GUID_t& type_server,
const AsyncCallback& callback,
std::unordered_map<xtypes::TypeIdentfierWithSize,
std::vector<std::pair<ProxyType*,
Expand Down
1 change: 1 addition & 0 deletions src/cpp/rtps/builtin/BuiltinProtocols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ bool BuiltinProtocols::initBuiltinProtocols(

#if HAVE_SQLITE3
case DiscoveryProtocol::BACKUP:
EPROSIMA_LOG_WARNING(RTPS_PDP, "BACKUP discovery protocol is not yet supported with XTypes.");
mp_PDP = new fastdds::rtps::PDPServer(this, allocation, DurabilityKind_t::TRANSIENT);
break;
#endif // if HAVE_SQLITE3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void EDPBasePUBListener::add_writer_from_change(
const NetworkFactory& network = edp->mp_RTPSParticipant->network_factory();
CDRMessage_t tempMsg(change->serializedPayload);
auto temp_writer_data = edp->get_temporary_writer_proxies_pool().get();
const auto type_server = change->writerGUID;

if (temp_writer_data->readFromCDRMessage(&tempMsg, network,
edp->mp_RTPSParticipant->has_shm_transport(), true, change->vendor_id))
Expand Down Expand Up @@ -141,6 +142,7 @@ void EDPBasePUBListener::add_writer_from_change(
{
typelookup_manager->async_get_type(
temp_writer_data,
type_server,
after_typelookup_callback);
}
// If TypeInformation does not exist, try fallback mechanism
Expand Down Expand Up @@ -216,6 +218,7 @@ void EDPBaseSUBListener::add_reader_from_change(
const NetworkFactory& network = edp->mp_RTPSParticipant->network_factory();
CDRMessage_t tempMsg(change->serializedPayload);
auto temp_reader_data = edp->get_temporary_reader_proxies_pool().get();
const auto type_server = change->writerGUID;

if (temp_reader_data->readFromCDRMessage(&tempMsg, network,
edp->mp_RTPSParticipant->has_shm_transport(), true, change->vendor_id))
Expand Down Expand Up @@ -285,6 +288,7 @@ void EDPBaseSUBListener::add_reader_from_change(
{
typelookup_manager->async_get_type(
temp_reader_data,
type_server,
after_typelookup_callback);
}
// If TypeInformation does not exist, try fallback mechanism
Expand Down
2 changes: 2 additions & 0 deletions versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Forthcoming
* Servers only redirect discovery information of their direct clients.
* Remote Discovery servers connection list can now be updated and modified at runtime without restrictions.
* Fast DDS CLI has been updated to allow the creation of servers without GUID.
* Servers are responsible of answering TypeLookupRequests of others servers when working with X-Types.
* Backup server is not compatible with X-Types.
* Refactor in XML Parser to return DynamicTypeBuilder instead of DynamicType
* Setting vendor_id in the received CacheChange_t for Data and DataFrag.
* Added new DynamicData to JSON serializer (`json_serialize`).
Expand Down

0 comments on commit fc2fb99

Please sign in to comment.