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

this class keeps track of all ready partitions (and their subpartitions) It keeps track of the ref cnt for each partition and associated data emitter A data emitter is notified once there is data for its partition. Pinning a partition for a Consumer/Producer means increasing its reference counter to n: Consumer: there are n "listeners" that are to consume the data of a partition Producer: there are n "emitters" that are to produce the data for a partition When the reference counter reaches 0, it means that none requires a partition. More...

#include <PartitionManager.hpp>

Public Member Functions

 PartitionManager ()=default
 
 ~PartitionManager ()
 
bool registerSubpartitionConsumer (NesPartition partition, NodeLocation nodeLocation, DataEmitterPtr emitter)
 Registers a subpartition in the PartitionManager. If the subpartition does not exist a new entry is added in the partition table, otherwise the counter is incremented. More...
 
void pinSubpartitionConsumer (NesPartition partition)
 Increment the subpartition counter. More...
 
bool unregisterSubpartitionConsumer (NesPartition partition)
 Unregisters a subpartition in the PartitionManager. If the subpartition does not exist or the current counter is 0 an error is thrown. More...
 
std::optional< uint64_t > getSubpartitionConsumerCounter (NesPartition partition)
 Returns the current counter of a given partition. Throws error if not existing. More...
 
DecomposedQueryPlanVersion getVersion (NesPartition partition)
 get the current version number of the operator associated with this partition More...
 
PartitionRegistrationStatus getConsumerRegistrationStatus (NesPartition partition) const
 checks if a partition is registered More...
 
bool registerSubpartitionProducer (NesPartition partition, NodeLocation nodeLocation)
 Registers a subpartition in the PartitionManager. If the subpartition does not exist a new entry is added in the partition table, otherwise the counter is incremented. More...
 
void pinSubpartitionProducer (NesPartition partition)
 Increment the subpartition counter. More...
 
bool unregisterSubpartitionProducer (NesPartition partition)
 Unregisters a subpartition in the PartitionManager. If the subpartition does not exist or the current counter is 0 an error is thrown. More...
 
std::optional< uint64_t > getSubpartitionProducerCounter (NesPartition partition)
 Returns the current counter of a given partition. Throws error if not existing. More...
 
PartitionRegistrationStatus getProducerRegistrationStatus (NesPartition partition) const
 checks if a partition is registered More...
 
DataEmitterPtr getDataEmitter (NesPartition partition)
 Returns the data emitter of a partition. More...
 
bool addSubpartitionEventListener (NesPartition partition, NodeLocation nodeLocation, Runtime::RuntimeEventListenerPtr eventListener)
 This method adds a new event listener for a partition. More...
 
Runtime::RuntimeEventListenerPtr getEventListener (NesPartition partition) const
 Retrieve event listener for a partition. More...
 
void clear ()
 clears all registered partitions More...
 

Detailed Description

this class keeps track of all ready partitions (and their subpartitions) It keeps track of the ref cnt for each partition and associated data emitter A data emitter is notified once there is data for its partition. Pinning a partition for a Consumer/Producer means increasing its reference counter to n: Consumer: there are n "listeners" that are to consume the data of a partition Producer: there are n "emitters" that are to produce the data for a partition When the reference counter reaches 0, it means that none requires a partition.

Constructor & Destructor Documentation

◆ PartitionManager()

NES::Network::PartitionManager::PartitionManager ( )
default

◆ ~PartitionManager()

NES::Network::PartitionManager::~PartitionManager ( )

Member Function Documentation

◆ addSubpartitionEventListener()

bool NES::Network::PartitionManager::addSubpartitionEventListener ( NesPartition  partition,
NodeLocation  nodeLocation,
Runtime::RuntimeEventListenerPtr  eventListener 
)

This method adds a new event listener for a partition.

Parameters
partition
eventListener
Returns
true if successful

References backward::details::move(), NES_DEBUG, and NES::Util::partition().

Here is the call graph for this function:

◆ clear()

void NES::Network::PartitionManager::clear ( )

clears all registered partitions

References NES_ASSERT2_FMT, NES_DEBUG, and NES::Util::partition().

Here is the call graph for this function:

◆ getConsumerRegistrationStatus()

PartitionRegistrationStatus NES::Network::PartitionManager::getConsumerRegistrationStatus ( NesPartition  partition) const

checks if a partition is registered

Parameters
thepartition
Returns
a PartitionRegistrationStatus

References NES::Util::partition().

Here is the call graph for this function:

◆ getDataEmitter()

DataEmitterPtr NES::Network::PartitionManager::getDataEmitter ( NesPartition  partition)

Returns the data emitter of a partition.

Parameters
partition
Returns
the data emitter of a partition

References NES::Util::partition().

Here is the call graph for this function:

◆ getEventListener()

Runtime::RuntimeEventListenerPtr NES::Network::PartitionManager::getEventListener ( NesPartition  partition) const

Retrieve event listener for a partition.

Parameters
partitionthe partition to lookup
Returns
the event listener for a partition

References NES::Util::partition().

Here is the call graph for this function:

◆ getProducerRegistrationStatus()

PartitionRegistrationStatus NES::Network::PartitionManager::getProducerRegistrationStatus ( NesPartition  partition) const

checks if a partition is registered

Parameters
partition
Returns
a PartitionRegistrationStatus

References NES::Util::partition().

Here is the call graph for this function:

◆ getSubpartitionConsumerCounter()

std::optional< uint64_t > NES::Network::PartitionManager::getSubpartitionConsumerCounter ( NesPartition  partition)

Returns the current counter of a given partition. Throws error if not existing.

Parameters
thepartition
Returns
the counter of the partition
Exceptions
std::out_of_rangeIf no such data is present.

References NES::Util::partition().

Here is the call graph for this function:

◆ getSubpartitionProducerCounter()

std::optional< uint64_t > NES::Network::PartitionManager::getSubpartitionProducerCounter ( NesPartition  partition)

Returns the current counter of a given partition. Throws error if not existing.

Parameters
thepartition
Returns
the counter of the partition
Exceptions
std::out_of_rangeIf no such data is present.

References NES::Util::partition().

Here is the call graph for this function:

◆ getVersion()

DecomposedQueryPlanVersion NES::Network::PartitionManager::getVersion ( NesPartition  partition)

get the current version number of the operator associated with this partition

Parameters
partitionthe partition for which to get the version number
Returns
the currrent version number

References NES_ASSERT, and NES::Util::partition().

Here is the call graph for this function:

◆ pinSubpartitionConsumer()

void NES::Network::PartitionManager::pinSubpartitionConsumer ( NesPartition  partition)

Increment the subpartition counter.

Parameters
partitionthe partition

References NES_ASSERT2_FMT, and NES::Util::partition().

Here is the call graph for this function:

◆ pinSubpartitionProducer()

void NES::Network::PartitionManager::pinSubpartitionProducer ( NesPartition  partition)

Increment the subpartition counter.

Parameters
partitionthe partition

References NES::Util::partition().

Here is the call graph for this function:

◆ registerSubpartitionConsumer()

bool NES::Network::PartitionManager::registerSubpartitionConsumer ( NesPartition  partition,
NodeLocation  nodeLocation,
DataEmitterPtr  emitter 
)

Registers a subpartition in the PartitionManager. If the subpartition does not exist a new entry is added in the partition table, otherwise the counter is incremented.

Parameters
thepartition @emitter
Returns
true if this is the first time the partition was registered, false otherwise

References backward::details::move(), NES_DEBUG, and NES::Util::partition().

Here is the call graph for this function:

◆ registerSubpartitionProducer()

bool NES::Network::PartitionManager::registerSubpartitionProducer ( NesPartition  partition,
NodeLocation  nodeLocation 
)

Registers a subpartition in the PartitionManager. If the subpartition does not exist a new entry is added in the partition table, otherwise the counter is incremented.

Parameters
thepartition @emitter
Returns
true if this is the first time the partition was registered, false otherwise

References backward::details::move(), NES_DEBUG, and NES::Util::partition().

Here is the call graph for this function:

◆ unregisterSubpartitionConsumer()

bool NES::Network::PartitionManager::unregisterSubpartitionConsumer ( NesPartition  partition)

Unregisters a subpartition in the PartitionManager. If the subpartition does not exist or the current counter is 0 an error is thrown.

Parameters
partitionthe partition of the consumer
Returns
true if the partition counter got to zero, false otherwise

References NES_ASSERT2_FMT, NES_DEBUG, NES_INFO, and NES::Util::partition().

Here is the call graph for this function:

◆ unregisterSubpartitionProducer()

bool NES::Network::PartitionManager::unregisterSubpartitionProducer ( NesPartition  partition)

Unregisters a subpartition in the PartitionManager. If the subpartition does not exist or the current counter is 0 an error is thrown.

Parameters
thepartition
Returns
true if the partition counter got to zero, false otherwise

References NES_ASSERT2_FMT, NES_DEBUG, NES_INFO, and NES::Util::partition().

Here is the call graph for this function:

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