NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Network::ExchangeProtocol Class Reference

This class is used by the ZmqServer and defines the reaction for events onDataBuffer, clientAnnouncement, endOfStream and exceptionHandling between all nodes of NES. More...

#include <ExchangeProtocol.hpp>

Public Member Functions

 ExchangeProtocol (std::shared_ptr< PartitionManager > partitionManager, std::shared_ptr< ExchangeProtocolListener > listener)
 Create an exchange protocol object with a partition manager and a listener. More...
 
 ExchangeProtocol (const ExchangeProtocol &other)
 Copy-Constructor for ExchangeProtocol. More...
 
std::variant< Messages::ServerReadyMessage, Messages::ErrorMessageonClientAnnouncement (Messages::ClientAnnounceMessage msg)
 Reaction of the zmqServer after a ClientAnnounceMessage is received. More...
 
void onBuffer (NesPartition nesPartition, Runtime::TupleBuffer &buffer, SequenceData messageSequenceData)
 Reaction of the zmqServer after a buffer is received. More...
 
void onServerError (Messages::ErrorMessage error)
 Reaction of the zmqServer after an error occurs. More...
 
void onChannelError (Messages::ErrorMessage error)
 Reaction of the zmqServer after an error occurs. More...
 
void onEndOfStream (Messages::EndOfStreamMessage endOfStreamMessage, std::optional< ReconfigurationMarkerPtr > marker=std::nullopt)
 Reaction of the zmqServer after an EndOfStream message is received. More...
 
void onEvent (NesPartition nesPartition, Runtime::BaseEvent &event)
 This method is called when the server receives an event message. More...
 
std::shared_ptr< PartitionManagergetPartitionManager () const
 getter for the PartitionManager More...
 

Detailed Description

This class is used by the ZmqServer and defines the reaction for events onDataBuffer, clientAnnouncement, endOfStream and exceptionHandling between all nodes of NES.

Constructor & Destructor Documentation

◆ ExchangeProtocol() [1/2]

NES::Network::ExchangeProtocol::ExchangeProtocol ( std::shared_ptr< PartitionManager partitionManager,
std::shared_ptr< ExchangeProtocolListener listener 
)
explicit

Create an exchange protocol object with a partition manager and a listener.

Parameters
partitionManager
listener

References NES_ASSERT, and NES_DEBUG.

◆ ExchangeProtocol() [2/2]

NES::Network::ExchangeProtocol::ExchangeProtocol ( const ExchangeProtocol other)

Copy-Constructor for ExchangeProtocol.

Parameters
other

References magic_enum::detail::value().

Here is the call graph for this function:

Member Function Documentation

◆ getPartitionManager()

std::shared_ptr< PartitionManager > NES::Network::ExchangeProtocol::getPartitionManager ( ) const

getter for the PartitionManager

Returns
the PartitionManager

◆ onBuffer()

void NES::Network::ExchangeProtocol::onBuffer ( NesPartition  nesPartition,
Runtime::TupleBuffer buffer,
SequenceData  messageSequenceData 
)

Reaction of the zmqServer after a buffer is received.

Parameters
idof the buffer
buffercontent
messageSequenceData

References NES_ERROR, NES::Network::Registered, and NES::SequenceData::sequenceNumber.

◆ onChannelError()

void NES::Network::ExchangeProtocol::onChannelError ( Messages::ErrorMessage  error)

Reaction of the zmqServer after an error occurs.

Parameters
theerror message

◆ onClientAnnouncement()

std::variant< Messages::ServerReadyMessage, Messages::ErrorMessage > NES::Network::ExchangeProtocol::onClientAnnouncement ( Messages::ClientAnnounceMessage  msg)

Reaction of the zmqServer after a ClientAnnounceMessage is received.

Parameters
clientAnnounceMessage
Returns
if successful, return ServerReadyMessage

References NES::Network::Messages::DataChannel, NES::Network::Deleted, NES::Network::Messages::ExchangeMessage::getChannelId(), NES::Network::Messages::ClientAnnounceMessage::getMode(), NES::Network::ChannelId::getNesPartition(), NES_DEBUG, NES_INFO, NES_WARNING, NES::Network::Registered, and NES::Network::ChannelId::toString().

Here is the call graph for this function:

◆ onEndOfStream()

void NES::Network::ExchangeProtocol::onEndOfStream ( Messages::EndOfStreamMessage  endOfStreamMessage,
std::optional< ReconfigurationMarkerPtr marker = std::nullopt 
)

Reaction of the zmqServer after an EndOfStream message is received.

Parameters
endOfStreamMessagea message containing details about the type of EoS
markerin case of reconfiguration: a marker containing a set of reconfiguration events

References NES::Network::Messages::ExchangeMessage::getChannelId(), NES::Network::Messages::EndOfStreamMessage::getMaxMessageSequenceNumber(), NES::Network::ChannelId::getNesPartition(), NES::Network::Messages::EndOfStreamMessage::getNumberOfSendingThreads(), NES::Network::Messages::EndOfStreamMessage::getQueryTerminationType(), NES::Network::Messages::EndOfStreamMessage::isEventChannel(), backward::details::move(), NES_ASSERT2_FMT, NES_DEBUG, NES_ERROR, NES_WARNING, NES::Runtime::Reconfiguration, NES::Network::Registered, NES::Network::ChannelId::toString(), and NES::Network::Messages::UnknownPartitionError.

Here is the call graph for this function:

◆ onEvent()

void NES::Network::ExchangeProtocol::onEvent ( NesPartition  nesPartition,
Runtime::BaseEvent event 
)

This method is called when the server receives an event message.

Parameters
nesPartition
event

References NES_ERROR, and NES::Network::Registered.

◆ onServerError()

void NES::Network::ExchangeProtocol::onServerError ( Messages::ErrorMessage  error)

Reaction of the zmqServer after an error occurs.

Parameters
theerror message

The documentation for this class was generated from the following files: