NebulaStream
0.6.213
NebulaStream is a data and application management framework for the internet of things
|
The NetworkManager manages creation and deletion of subpartition producer and consumer. More...
#include <NetworkManager.hpp>
Public Member Functions | |
NetworkManager (WorkerId nodeEngineId, const std::string &hostname, uint16_t port, ExchangeProtocol &&exchangeProtocol, const Runtime::BufferManagerPtr &bufferManager, int senderHighWatermark, uint16_t numServerThread=DEFAULT_NUM_SERVER_THREADS, bool connectSinksAsync=false, bool connectSourceEventChannelsAsync=false) | |
Creates a new network manager object, which comprises of a zmq server and an exchange protocol. More... | |
~NetworkManager () | |
Destroy the network manager calling destroy() More... | |
bool | registerSubpartitionConsumer (const NesPartition &nesPartition, const NodeLocation &senderLocation, const DataEmitterPtr &emitter) const |
This method is called on the receiver side to register a SubpartitionConsumer, i.e. indicate that the server is ready to receive particular subpartitions. More... | |
bool | unregisterSubpartitionConsumer (const NesPartition &nesPartition) const |
This method is called on the receiver side to remove a SubpartitionConsumer. More... | |
bool | unregisterSubpartitionProducer (const NesPartition &nesPartition) const |
This method is called on the receiver side to remove a SubpartitionConsumer. More... | |
PartitionRegistrationStatus | isPartitionConsumerRegistered (const NesPartition &nesPartition) const |
PartitionRegistrationStatus | isPartitionProducerRegistered (const NesPartition &nesPartition) const |
NetworkChannelPtr | registerSubpartitionProducer (const NodeLocation &nodeLocation, const NesPartition &nesPartition, Runtime::BufferManagerPtr bufferManager, std::chrono::milliseconds waitTime, uint8_t retryTimes, DecomposedQueryPlanVersion version=0) |
This method is called on the sender side to register a SubpartitionProducer. If the connection to the destination server is successful, a pointer to the DataChannel is returned, else nullptr is returned. The DataChannel is not thread safe! More... | |
std::pair< std::future< NetworkChannelPtr >, std::promise< bool > > | registerSubpartitionProducerAsync (const NodeLocation &nodeLocation, const NesPartition &nesPartition, Runtime::BufferManagerPtr bufferManager, std::chrono::milliseconds waitTime, uint8_t retryTimes, Runtime::ReconfigurationMessage reconfigurationMessage, Runtime::QueryManagerPtr queryManager, DecomposedQueryPlanVersion version=0) |
This method is called on the sender side to asynchronously register a SubpartitionProducer. It returns a future that on completion will contain a pointer to the DataChannel if the connection to the destination server is successful, or nullptr otherwise The DataChannel is not thread safe! More... | |
EventOnlyNetworkChannelPtr | registerSubpartitionEventProducer (const NodeLocation &nodeLocation, const NesPartition &nesPartition, Runtime::BufferManagerPtr bufferManager, std::chrono::milliseconds waitTime, uint8_t retryTimes) |
This method is called on the sender side to register a SubpartitionProducer. If the connection to the destination server is successful, a pointer to the DataChannel is returned, else nullptr is returned. The DataChannel is not thread safe! More... | |
bool | registerSubpartitionEventConsumer (const NodeLocation &nodeLocation, const NesPartition &nesPartition, Runtime::RuntimeEventListenerPtr eventListener) |
void | destroy () |
This methods destroys the network manager by stopping the underlying (ZMQ) server. More... | |
NodeLocation | getServerLocation () const |
Returns the FQDN of the network manager. More... | |
uint16_t | getServerDataPort () const |
Returns the server data port. More... | |
std::pair< std::future< EventOnlyNetworkChannelPtr >, std::promise< bool > > | registerSubpartitionEventProducerAsync (const NodeLocation &nodeLocation, const NesPartition &nesPartition, Runtime::BufferManagerPtr bufferManager, std::chrono::milliseconds waitTime, uint8_t retryTimes) |
This method is called to asynchronously register an event produce. It returns a future that on completion will contain a pointer to the EventChannel if the connection to the destination server is successful, or nullptr otherwise. More... | |
bool | getConnectSinksAsync () |
retrieve the value of the connectSinkAsync flag which indicates if a separate thread should be used to establish network channels More... | |
bool | getConnectSourceEventChannelsAsync () |
retrieve the value of the connectSourceEventChannelsAsync flag which indicates if a separate thread should be used to establish event channels from sources to sinks More... | |
Static Public Member Functions | |
static NetworkManagerPtr | create (WorkerId nodeEngineId, const std::string &hostname, uint16_t port, Network::ExchangeProtocol &&exchangeProtocol, const Runtime::BufferManagerPtr &bufferManager, int senderHighWatermark=-1, uint16_t numServerThread=DEFAULT_NUM_SERVER_THREADS, bool connectSinksAsync=false, bool connectSourceEventChannelsAsync=false) |
create method to return a shared pointer of the NetworkManager More... | |
The NetworkManager manages creation and deletion of subpartition producer and consumer.
|
explicit |
Creates a new network manager object, which comprises of a zmq server and an exchange protocol.
nodeEngineId | |
hostname | |
port | |
exchangeProtocol | |
bufferManager | |
senderHighWatermark | |
numServerThread | |
connectSinksAsync | if true, sinks will use a dedicated thread when attempting to establish a network channel |
connectSourceEventChannelsAsync | if true, source will use a dedicated thread when attempting to establish an event channel |
References NES_INFO, and NES_THROW_RUNTIME_ERROR.
NES::Network::NetworkManager::~NetworkManager | ( | ) |
|
static |
create method to return a shared pointer of the NetworkManager
nodeEngineId |
References backward::details::move().
void NES::Network::NetworkManager::destroy | ( | ) |
This methods destroys the network manager by stopping the underlying (ZMQ) server.
Referenced by ~NetworkManager().
bool NES::Network::NetworkManager::getConnectSinksAsync | ( | ) |
retrieve the value of the connectSinkAsync flag which indicates if a separate thread should be used to establish network channels
bool NES::Network::NetworkManager::getConnectSourceEventChannelsAsync | ( | ) |
retrieve the value of the connectSourceEventChannelsAsync flag which indicates if a separate thread should be used to establish event channels from sources to sinks
uint16_t NES::Network::NetworkManager::getServerDataPort | ( | ) | const |
Returns the server data port.
NodeLocation NES::Network::NetworkManager::getServerLocation | ( | ) | const |
Returns the FQDN of the network manager.
PartitionRegistrationStatus NES::Network::NetworkManager::isPartitionConsumerRegistered | ( | const NesPartition & | nesPartition | ) | const |
Checks if a partition is registered
nesPartition | the id of the logical channel between sender and receiver |
PartitionRegistrationStatus NES::Network::NetworkManager::isPartitionProducerRegistered | ( | const NesPartition & | nesPartition | ) | const |
Checks if a partition is registered
nesPartition | the id of the logical channel between sender and receiver |
bool NES::Network::NetworkManager::registerSubpartitionConsumer | ( | const NesPartition & | nesPartition, |
const NodeLocation & | senderLocation, | ||
const DataEmitterPtr & | emitter | ||
) | const |
This method is called on the receiver side to register a SubpartitionConsumer, i.e. indicate that the server is ready to receive particular subpartitions.
nesPartition | the id of the logical channel between sender and receiver |
senderLocation | the network location of the sender |
emitter | underlying network source |
References NES_ASSERT2_FMT, and NES_DEBUG.
bool NES::Network::NetworkManager::registerSubpartitionEventConsumer | ( | const NodeLocation & | nodeLocation, |
const NesPartition & | nesPartition, | ||
Runtime::RuntimeEventListenerPtr | eventListener | ||
) |
EventOnlyNetworkChannelPtr NES::Network::NetworkManager::registerSubpartitionEventProducer | ( | const NodeLocation & | nodeLocation, |
const NesPartition & | nesPartition, | ||
Runtime::BufferManagerPtr | bufferManager, | ||
std::chrono::milliseconds | waitTime, | ||
uint8_t | retryTimes | ||
) |
This method is called on the sender side to register a SubpartitionProducer. If the connection to the destination server is successful, a pointer to the DataChannel is returned, else nullptr is returned. The DataChannel is not thread safe!
nodeLocation | is the destination |
nesPartition | indicates the partition |
waitTime | time in seconds to wait until a retry is called |
retryTimes | times to retry a connection |
References NES::Network::EventOnlyNetworkChannel::create(), backward::details::move(), and NES_DEBUG.
std::pair< std::future< EventOnlyNetworkChannelPtr >, std::promise< bool > > NES::Network::NetworkManager::registerSubpartitionEventProducerAsync | ( | const NodeLocation & | nodeLocation, |
const NesPartition & | nesPartition, | ||
Runtime::BufferManagerPtr | bufferManager, | ||
std::chrono::milliseconds | waitTime, | ||
uint8_t | retryTimes | ||
) |
This method is called to asynchronously register an event produce. It returns a future that on completion will contain a pointer to the EventChannel if the connection to the destination server is successful, or nullptr otherwise.
nodeLocation | is the destination |
nesPartition | indicates the partition |
bufferManager | a pointer the buffer manager |
waitTime | time in seconds to wait until a retry is called |
retryTimes | times to retry a connectio. |
version | the version number which will be used by the receiver to determine if this channel will be accepted |
References backward::details::move(), NES_DEBUG, and protocol.
NetworkChannelPtr NES::Network::NetworkManager::registerSubpartitionProducer | ( | const NodeLocation & | nodeLocation, |
const NesPartition & | nesPartition, | ||
Runtime::BufferManagerPtr | bufferManager, | ||
std::chrono::milliseconds | waitTime, | ||
uint8_t | retryTimes, | ||
DecomposedQueryPlanVersion | version = 0 |
||
) |
This method is called on the sender side to register a SubpartitionProducer. If the connection to the destination server is successful, a pointer to the DataChannel is returned, else nullptr is returned. The DataChannel is not thread safe!
nodeLocation | is the destination |
nesPartition | indicates the partition |
waitTime | time in seconds to wait until a retry is called |
retryTimes | times to retry a connection |
version | the version number which will be used by the receiver to determine if this channel will be accepted |
References NES::Network::NetworkChannel::create(), backward::details::move(), and NES_DEBUG.
std::pair< std::future< NetworkChannelPtr >, std::promise< bool > > NES::Network::NetworkManager::registerSubpartitionProducerAsync | ( | const NodeLocation & | nodeLocation, |
const NesPartition & | nesPartition, | ||
Runtime::BufferManagerPtr | bufferManager, | ||
std::chrono::milliseconds | waitTime, | ||
uint8_t | retryTimes, | ||
Runtime::ReconfigurationMessage | reconfigurationMessage, | ||
Runtime::QueryManagerPtr | queryManager, | ||
DecomposedQueryPlanVersion | version = 0 |
||
) |
This method is called on the sender side to asynchronously register a SubpartitionProducer. It returns a future that on completion will contain a pointer to the DataChannel if the connection to the destination server is successful, or nullptr otherwise The DataChannel is not thread safe!
nodeLocation | is the destination |
nesPartition | indicates the partition |
waitTime | time in seconds to wait until a retry is called |
retryTimes | times to retry a connectio. Set this to zero to retry indefinitely. |
reconfigurationMessage | a message to be inserted into the query manager on completion, to inform the caller about the completion of the operation |
queryManager | a pointer to the query manager which will hand over the reconfiguration message to the caller |
version | the version number which will be used by the receiver to determine if this channel will be accepted |
References backward::details::move(), NES_DEBUG, and protocol.
bool NES::Network::NetworkManager::unregisterSubpartitionConsumer | ( | const NesPartition & | nesPartition | ) | const |
This method is called on the receiver side to remove a SubpartitionConsumer.
nesPartition | the id of the logical channel between sender and receiver |
References NES_DEBUG.
bool NES::Network::NetworkManager::unregisterSubpartitionProducer | ( | const NesPartition & | nesPartition | ) | const |
This method is called on the receiver side to remove a SubpartitionConsumer.
nesPartition | the id of the logical channel between sender and receiver |
References NES_DEBUG.