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

This class represent the network channel for data transfer that NES uses to send data among nodes. This class can send data and event packets. This class is not thread-safe. More...

#include <NetworkChannel.hpp>

Collaboration diagram for NES::Network::NetworkChannel:
[legend]

Public Member Functions

 NetworkChannel (zmq::socket_t &&zmqSocket, ChannelId channelId, std::string &&address, Runtime::BufferManagerPtr bufferManager)
 Creates a network channel instance with the given parameters. More...
 
 ~NetworkChannel ()
 close the output channel and release resources More...
 
 NetworkChannel (const NetworkChannel &)=delete
 
NetworkChanneloperator= (const NetworkChannel &)=delete
 
void close (Runtime::QueryTerminationType, uint16_t numSendingThreads=0, uint64_t currentMessageSequenceNumber=0, bool shouldPropagateMarker=false, const std::optional< ReconfigurationMarkerPtr > &=std::nullopt)
 Closes the underlying network connection with a termination type. More...
 
- Public Member Functions inherited from NES::Network::detail::NetworkEventSender< detail::NetworkDataSender< detail::BaseNetworkChannel > >
 NetworkEventSender (Args &&... args)
 Forwarding ctor: it forwards the args to the base class. More...
 
bool sendEvent (Arguments &&... args)
 
bool sendEvent (Runtime::TupleBuffer &&inputBuffer, Runtime::EventType eventType)
 
- Public Member Functions inherited from NES::Network::detail::NetworkDataSender< BaseChannelType >
template<typename... Args>
 NetworkDataSender (Args &&... args)
 Forwarding ctor: it forwards the args to the base class. More...
 
bool sendBuffer (Runtime::TupleBuffer &buffer, uint64_t tupleSize, uint64_t messageSequenceNumber)
 Send buffer to the destination defined in the constructor. Note that this method will internally compute the payloadSize as tupleSizeInBytes*buffer.getNumberOfTuples() More...
 

Static Public Member Functions

static NetworkChannelPtr create (const std::shared_ptr< zmq::context_t > &zmqContext, std::string &&socketAddr, NesPartition nesPartition, ExchangeProtocol &protocol, Runtime::BufferManagerPtr bufferManager, int highWaterMark, std::chrono::milliseconds waitTime, uint8_t retryTimes, DecomposedQueryPlanVersion version, std::optional< std::future< bool >> abortConnection=std::nullopt)
 Creates a network channel instance with the given parameters. More...
 

Static Public Attributes

static constexpr bool canSendData = inherited::canSendData
 
static constexpr bool canSendEvent = inherited::canSendEvent
 
- Static Public Attributes inherited from NES::Network::detail::NetworkEventSender< detail::NetworkDataSender< detail::BaseNetworkChannel > >
static constexpr bool canSendData
 
static constexpr bool canSendEvent
 
- Static Public Attributes inherited from NES::Network::detail::NetworkDataSender< BaseChannelType >
static constexpr bool canSendData = true
 
static constexpr bool canSendEvent = false || BaseChannelType::canSendEvent
 

Detailed Description

This class represent the network channel for data transfer that NES uses to send data among nodes. This class can send data and event packets. This class is not thread-safe.

Constructor & Destructor Documentation

◆ NetworkChannel() [1/2]

NES::Network::NetworkChannel::NetworkChannel ( zmq::socket_t &&  zmqSocket,
ChannelId  channelId,
std::string &&  address,
Runtime::BufferManagerPtr  bufferManager 
)
explicit

Creates a network channel instance with the given parameters.

Parameters
zmqContextthe local zmq server context
channelIdthe remote nes channel id to connect to
addressthe socket address of the remote server
bufferManagerthe buffer manager

◆ ~NetworkChannel()

NES::Network::NetworkChannel::~NetworkChannel ( )

close the output channel and release resources

References NES_ASSERT2_FMT.

◆ NetworkChannel() [2/2]

NES::Network::NetworkChannel::NetworkChannel ( const NetworkChannel )
delete

Member Function Documentation

◆ close()

void NES::Network::NetworkChannel::close ( Runtime::QueryTerminationType  terminationType,
uint16_t  numSendingThreads = 0,
uint64_t  currentMessageSequenceNumber = 0,
bool  shouldPropagateMarker = false,
const std::optional< ReconfigurationMarkerPtr > &  reconfigurationMarker = std::nullopt 
)

Closes the underlying network connection with a termination type.

References canSendData, and canSendEvent.

◆ create()

NetworkChannelPtr NES::Network::NetworkChannel::create ( const std::shared_ptr< zmq::context_t > &  zmqContext,
std::string &&  socketAddr,
NesPartition  nesPartition,
ExchangeProtocol protocol,
Runtime::BufferManagerPtr  bufferManager,
int  highWaterMark,
std::chrono::milliseconds  waitTime,
uint8_t  retryTimes,
DecomposedQueryPlanVersion  version,
std::optional< std::future< bool >>  abortConnection = std::nullopt 
)
static

Creates a network channel instance with the given parameters.

Parameters
zmqContextthe local zmq server context
addressthe ip address of the remote server
nesPartitionthe remote nes partition to connect to
protocolthe protocol implementation
bufferManagerthe buffer manager
highWaterMarkthe max number of buffers the channel takes before blocking
waitTimethe backoff time in case of failure when connecting
retryTimesthe number of retries before the methods will raise error. Set this to zero to retry indefinitely
versionthe version number that will be used by the receiver to determine if it can already accept messages from this client
abortConnectiona future which which will be checked on every connection retry. By setting a value in the corresponding promise, the calling thread can abort the connection process if the connection is performed asynchronously.
Returns
the network channel or nullptr on error

References backward::details::move(), and protocol.

Referenced by NES::Network::NetworkManager::registerSubpartitionProducer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

NetworkChannel& NES::Network::NetworkChannel::operator= ( const NetworkChannel )
delete

Member Data Documentation

◆ canSendData

constexpr bool NES::Network::NetworkChannel::canSendData = inherited::canSendData
staticconstexpr

Referenced by close().

◆ canSendEvent

constexpr bool NES::Network::NetworkChannel::canSendEvent = inherited::canSendEvent
staticconstexpr

Referenced by close().


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