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

#include <WorkerRPCClient.hpp>

Classes

struct  AsyncClientCall
 

Public Member Functions

bool registerDecomposedQuery (const std::string &address, const DecomposedQueryPlanPtr &decomposedQueryPlan)
 register a query More...
 
void registerDecomposedQueryAsync (const std::string &address, const DecomposedQueryPlanPtr &decomposedQueryPlan, const CompletionQueuePtr &cq)
 register a query asynchronously More...
 
bool unregisterDecomposedQuery (const std::string &address, SharedQueryId sharedQueryId, DecomposedQueryId decomposedQueryId)
 unregisters a decomposed query More...
 
void unregisterDecomposedQueryAsync (const std::string &address, SharedQueryId sharedQueryId, DecomposedQueryId decomposedQueryId, const CompletionQueuePtr &cq)
 un-registers a decomposed query asynchronously More...
 
bool startDecomposedQuery (const std::string &address, SharedQueryId sharedQueryId, DecomposedQueryId decomposedQueryId)
 method to start a already deployed decomposed query More...
 
void startDecomposedQueryAsync (const std::string &address, SharedQueryId sharedQueryId, DecomposedQueryId decomposedQueryId, const CompletionQueuePtr &cq)
 method to start a already deployed query asynchronously More...
 
bool stopDecomposedQuery (const std::string &address, SharedQueryId sharedQueryId, DecomposedQueryId decomposedQueryId, Runtime::QueryTerminationType terminationType)
 method to stop a query More...
 
void stopDecomposedQueryAsync (const std::string &address, SharedQueryId sharedQueryId, DecomposedQueryId decomposedQueryId, Runtime::QueryTerminationType terminationType, const CompletionQueuePtr &cq)
 method to stop a query asynchronously More...
 
void addReconfigurationMarker (const std::string &address, const SharedQueryId &sharedQueryId, const DecomposedQueryId &decomposedQueryId, const ReconfigurationMarkerPtr &reconfigurationMarker, const CompletionQueuePtr &cq)
 method to send reconfiguration marker to the worker for specific decomposed query plan More...
 
bool registerMonitoringPlan (const std::string &address, const Monitoring::MonitoringPlanPtr &plan)
 Registers to a remote worker node its monitoring plan. More...
 
std::string requestMonitoringData (const std::string &address)
 Requests from a remote worker node its monitoring data. More...
 
bool bufferData (const std::string &address, DecomposedQueryId decomposedQueryId, uint64_t uniqueNetworkSinDescriptorId)
 Requests remote worker to start buffering data on a single NetworkSink identified by a query sub plan Id and a global sinkId. Once buffering starts, the Network Sink no longer sends data downstream. More...
 
bool updateNetworkSink (const std::string &address, uint64_t newNodeId, const std::string &newHostname, uint32_t newPort, DecomposedQueryId decomposedQueryId, uint64_t uniqueNetworkSinDescriptorId)
 requests a remote worker to reconfigure a NetworkSink so that the NetworkSink changes where it sends data to (changes downstream node) More...
 
void checkAsyncResult (const std::vector< RpcAsyncRequest > &rpcAsyncRequests)
 This functions loops over all queues and wait for the async calls return. More...
 
bool injectEpochBarrier (uint64_t timestamp, uint64_t queryId, const std::string &address)
 method to propagate new epoch timestamp to source More...
 
bool checkHealth (const std::string &address, std::string healthServiceName)
 method to check the health of the worker More...
 
NES::Spatial::DataTypes::Experimental::Waypoint getWaypoint (const std::string &address)
 method to check the location of any node. If the node is a mobile node, its current location will be returned. If the node is a field node, its fixed location will be returned. If the node does not have a known location, an invalid location will be returned More...
 

Static Public Member Functions

static WorkerRPCClientPtr create ()
 Create instance of worker rpc client. More...
 

Member Function Documentation

◆ addReconfigurationMarker()

void NES::WorkerRPCClient::addReconfigurationMarker ( const std::string &  address,
const SharedQueryId sharedQueryId,
const DecomposedQueryId decomposedQueryId,
const ReconfigurationMarkerPtr reconfigurationMarker,
const CompletionQueuePtr cq 
)

method to send reconfiguration marker to the worker for specific decomposed query plan

Parameters
addressaddress of the worker
sharedQueryIdthe shared query id
decomposedQueryIdthe decomposed query id
reconfigurationMarkerthe reconfiguration marker
cqthe completion queue of grpc server

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), and NES::ReconfigurationMarkerSerializationUtil::serialize().

Here is the call graph for this function:

◆ bufferData()

bool NES::WorkerRPCClient::bufferData ( const std::string &  address,
DecomposedQueryId  decomposedQueryId,
uint64_t  uniqueNetworkSinDescriptorId 
)

Requests remote worker to start buffering data on a single NetworkSink identified by a query sub plan Id and a global sinkId. Once buffering starts, the Network Sink no longer sends data downstream.

Parameters
ipAddress
decomposedQueryId: the id of the query sub plan to which the Network Sink belongs
uniqueNetworkSinDescriptorId: unique id of the network sink descriptor. Used to find the Network Sink to buffer data on.
Returns
true if successful, else false

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), NES_DEBUG, and NES_ERROR.

Here is the call graph for this function:

◆ checkAsyncResult()

void NES::WorkerRPCClient::checkAsyncResult ( const std::vector< RpcAsyncRequest > &  rpcAsyncRequests)

This functions loops over all queues and wait for the async calls return.

Parameters
rpcAsyncRequestsrpc requests made
Returns
true if all calls returned
Exceptions
RpcExceptionCreates RPC exception with failedRPCCalls and mode

References NES_DEBUG, NES_NOT_IMPLEMENTED, NES::Register, NES::Start, NES::WorkerRPCClient::AsyncClientCall< ReplayType >::status, NES::Stop, and NES::Unregister.

◆ checkHealth()

bool NES::WorkerRPCClient::checkHealth ( const std::string &  address,
std::string  healthServiceName 
)

method to check the health of the worker

Parameters
addressip address of the source
Returns
bool indicating success

References NES_ERROR, and NES_TRACE.

◆ create()

WorkerRPCClientPtr NES::WorkerRPCClient::create ( )
static

Create instance of worker rpc client.

Returns
shared pointer to the worker RPC client

Referenced by NES::Spatial::TEST_F().

Here is the caller graph for this function:

◆ getWaypoint()

Spatial::DataTypes::Experimental::Waypoint NES::WorkerRPCClient::getWaypoint ( const std::string &  address)

method to check the location of any node. If the node is a mobile node, its current location will be returned. If the node is a field node, its fixed location will be returned. If the node does not have a known location, an invalid location will be returned

Parameters
addressthe ip address of the node
Returns
location representing the nodes location or invalid if no such location exists

References NES::Spatial::DataTypes::Experimental::Waypoint::invalid(), NES_DEBUG, and timestamp.

Here is the call graph for this function:

◆ injectEpochBarrier()

bool NES::WorkerRPCClient::injectEpochBarrier ( uint64_t  timestamp,
uint64_t  queryId,
const std::string &  address 
)

method to propagate new epoch timestamp to source

Parameters
timestampmax timestamp of current epoch
queryIdquery id which sources belong to
addressip address of the source
Returns
bool indicating success

References NES_DEBUG, and timestamp.

◆ registerDecomposedQuery()

bool NES::WorkerRPCClient::registerDecomposedQuery ( const std::string &  address,
const DecomposedQueryPlanPtr decomposedQueryPlan 
)

register a query

Parameters
addressaddress of node where query plan need to be registered
decomposedQueryPlanplan to register
Returns
true if succeeded, else false

References NES_DEBUG, and NES_TRACE.

◆ registerDecomposedQueryAsync()

void NES::WorkerRPCClient::registerDecomposedQueryAsync ( const std::string &  address,
const DecomposedQueryPlanPtr decomposedQueryPlan,
const CompletionQueuePtr cq 
)

register a query asynchronously

Parameters
addressaddress of node where query plan need to be registered
queryplan to register
cqthe completion queue

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), NES_DEBUG, NES_TRACE, and NES::WorkerRPCClient::AsyncClientCall< ReplayType >::responseReader.

Here is the call graph for this function:

◆ registerMonitoringPlan()

bool NES::WorkerRPCClient::registerMonitoringPlan ( const std::string &  address,
const Monitoring::MonitoringPlanPtr plan 
)

Registers to a remote worker node its monitoring plan.

Parameters
ipAddress
themonitoring plan
Returns
bool if successful

References magic_enum::enum_integer(), NES_DEBUG, and NES_THROW_RUNTIME_ERROR.

Here is the call graph for this function:

◆ requestMonitoringData()

std::string NES::WorkerRPCClient::requestMonitoringData ( const std::string &  address)

Requests from a remote worker node its monitoring data.

Parameters
ipAddress
Returns
true if successful, else false

References NES_DEBUG, and NES_THROW_RUNTIME_ERROR.

◆ startDecomposedQuery()

bool NES::WorkerRPCClient::startDecomposedQuery ( const std::string &  address,
SharedQueryId  sharedQueryId,
DecomposedQueryId  decomposedQueryId 
)

method to start a already deployed decomposed query

Note
if query is not deploy, false is returned
Parameters
sharedQueryIdid of the shared query plan to which the decomposed query plan serves
decomposedQueryIdid of the decomposed query to start
Returns
bool indicating success

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), and NES_DEBUG.

Here is the call graph for this function:

◆ startDecomposedQueryAsync()

void NES::WorkerRPCClient::startDecomposedQueryAsync ( const std::string &  address,
SharedQueryId  sharedQueryId,
DecomposedQueryId  decomposedQueryId,
const CompletionQueuePtr cq 
)

method to start a already deployed query asynchronously

Note
if query is not deploy, false is returned
Parameters
addressthe address of the worker
sharedQueryIdid of the shared query plan to which the decomposed query plan serves
decomposedQueryIdid of the decomposed query to start
cqthe completion queue

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), NES_DEBUG, and NES::WorkerRPCClient::AsyncClientCall< ReplayType >::responseReader.

Here is the call graph for this function:

◆ stopDecomposedQuery()

bool NES::WorkerRPCClient::stopDecomposedQuery ( const std::string &  address,
SharedQueryId  sharedQueryId,
DecomposedQueryId  decomposedQueryId,
Runtime::QueryTerminationType  terminationType 
)

method to stop a query

Parameters
addressaddress of the new worker
sharedQueryIdto stop
sharedQueryIdid of the shared query plan to which the decomposed query plan serves
decomposedQueryIdid of the decomposed query to stop
Returns
bool indicating success

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), NES_DEBUG, and NES_ERROR.

Here is the call graph for this function:

◆ stopDecomposedQueryAsync()

void NES::WorkerRPCClient::stopDecomposedQueryAsync ( const std::string &  address,
SharedQueryId  sharedQueryId,
DecomposedQueryId  decomposedQueryId,
Runtime::QueryTerminationType  terminationType,
const CompletionQueuePtr cq 
)

method to stop a query asynchronously

Parameters
address: address of the worker
sharedQueryIdid of the shared query plan to which the decomposed query plan serves
decomposedQueryIdid of the decomposed query to stop
terminationTypethe termination type
cqcompletion queue of grpc requests

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), NES_DEBUG, and NES::WorkerRPCClient::AsyncClientCall< ReplayType >::responseReader.

Here is the call graph for this function:

◆ unregisterDecomposedQuery()

bool NES::WorkerRPCClient::unregisterDecomposedQuery ( const std::string &  address,
SharedQueryId  sharedQueryId,
DecomposedQueryId  decomposedQueryId 
)

unregisters a decomposed query

Parameters
sharedQueryIdid of the shared query plan to which the decomposed query plan serves
decomposedQueryIdid of the decomposed query to unregister
Returns
true if succeeded, else false

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), and NES_DEBUG.

Here is the call graph for this function:

◆ unregisterDecomposedQueryAsync()

void NES::WorkerRPCClient::unregisterDecomposedQueryAsync ( const std::string &  address,
SharedQueryId  sharedQueryId,
DecomposedQueryId  decomposedQueryId,
const CompletionQueuePtr cq 
)

un-registers a decomposed query asynchronously

Parameters
sharedQueryIdid of the shared query plan to which the decomposed query plan serves
decomposedQueryIdid of the decomposed query to unregister

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), NES_DEBUG, and NES::WorkerRPCClient::AsyncClientCall< ReplayType >::responseReader.

Here is the call graph for this function:

◆ updateNetworkSink()

bool NES::WorkerRPCClient::updateNetworkSink ( const std::string &  address,
uint64_t  newNodeId,
const std::string &  newHostname,
uint32_t  newPort,
DecomposedQueryId  decomposedQueryId,
uint64_t  uniqueNetworkSinDescriptorId 
)

requests a remote worker to reconfigure a NetworkSink so that the NetworkSink changes where it sends data to (changes downstream node)

Parameters
ipAddress
newNodeId: the id of the node that the Network Sink will send data to after reconfiguration
newHostname: the hostname of the node that the NetworkSink should send data to
newPort: the port of the node that the NetworkSink should send data to
decomposedQueryId: the id of the query sub plan to which the Network Sink belongs
uniqueNetworkSinDescriptorId: unique id of the network sink descriptor. Used to find the Network Sink to buffer data on.
Returns
true if successful, else false

References NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), NES_DEBUG, and NES_ERROR.

Here is the call graph for this function:

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