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

Coordinator RPC server responsible for receiving requests over GRPC interface. More...

#include <CoordinatorRPCServer.hpp>

Collaboration diagram for NES::CoordinatorRPCServer:
[legend]

Public Member Functions

 CoordinatorRPCServer (RequestHandlerServicePtr requestHandlerService, TopologyPtr topology, Catalogs::Query::QueryCatalogPtr queryCatalog, Monitoring::MonitoringManagerPtr monitoringManager, QueryParsingServicePtr queryParsingService, CoordinatorHealthCheckServicePtr coordinatorHealthCheckService)
 Create coordinator RPC server. More...
 
Status RegisterWorker (ServerContext *context, const RegisterWorkerRequest *registrationRequest, RegisterWorkerReply *reply) override
 RPC Call to register a node. More...
 
Status UnregisterWorker (ServerContext *context, const UnregisterWorkerRequest *request, UnregisterWorkerReply *reply) override
 RPC Call to unregister a node. More...
 
Status RegisterPhysicalSource (ServerContext *context, const RegisterPhysicalSourcesRequest *request, RegisterPhysicalSourcesReply *reply) override
 RPC Call to register physical source. More...
 
Status UnregisterPhysicalSource (ServerContext *context, const UnregisterPhysicalSourceRequest *request, UnregisterPhysicalSourceReply *reply) override
 RPC Call to unregister physical source. More...
 
Status RegisterLogicalSource (ServerContext *context, const RegisterLogicalSourceRequest *request, RegisterLogicalSourceReply *reply) override
 RPC Call to register logical source. More...
 
Status UnregisterLogicalSource (ServerContext *context, const UnregisterLogicalSourceRequest *request, UnregisterLogicalSourceReply *reply) override
 RPC Call to unregister logical source. More...
 
Status AddParent (ServerContext *context, const AddParentRequest *request, AddParentReply *reply) override
 RPC Call to add parent. More...
 
Status ReplaceParent (ServerContext *context, const ReplaceParentRequest *request, ReplaceParentReply *reply) override
 RPC Call to replace parent. More...
 
Status RemoveParent (ServerContext *context, const RemoveParentRequest *request, RemoveParentReply *reply) override
 RPC Call to remove parent. More...
 
Status NotifyQueryFailure (ServerContext *context, const QueryFailureNotification *request, QueryFailureNotificationReply *reply) override
 RPC Call to notify the failure of a query. More...
 
Status GetNodesInRange (ServerContext *, const GetNodesInRangeRequest *request, GetNodesInRangeReply *reply) override
 RPC Call to get a list of field nodes within a defined radius around a geographical location. More...
 
Status SendErrors (ServerContext *, const SendErrorsMessage *request, ErrorReply *reply) override
 RPC Call to send errors to the coordinator. More...
 
Status RequestSoftStop (::grpc::ServerContext *context, const ::RequestSoftStopMessage *request, ::StopRequestReply *response) override
 
Status notifySourceStopTriggered (::grpc::ServerContext *context, const ::SoftStopTriggeredMessage *request, ::SoftStopTriggeredReply *response) override
 
Status NotifySoftStopCompleted (::grpc::ServerContext *context, const ::SoftStopCompletionMessage *request, ::SoftStopCompletionReply *response) override
 
Status SendScheduledReconnect (ServerContext *, const SendScheduledReconnectRequest *request, SendScheduledReconnectReply *reply) override
 inform the coordinator that a mobile devices reconnect prediction has changed More...
 
Status SendLocationUpdate (ServerContext *, const LocationUpdateRequest *request, LocationUpdateReply *reply) override
 inform the coordinator that the devices location has changed More...
 
Status GetParents (ServerContext *, const GetParentsRequest *request, GetParentsReply *reply) override
 
Status RelocateTopologyNode (ServerContext *, const NodeRelocationRequest *request, NodeRelocationReply *reply) override
 modify the topology by removing and adding links and then rerun an incremental placement for queries that were sending data over one of the removed links More...
 

Detailed Description

Coordinator RPC server responsible for receiving requests over GRPC interface.

Constructor & Destructor Documentation

◆ CoordinatorRPCServer()

CoordinatorRPCServer::CoordinatorRPCServer ( RequestHandlerServicePtr  requestHandlerService,
TopologyPtr  topology,
Catalogs::Query::QueryCatalogPtr  queryCatalog,
Monitoring::MonitoringManagerPtr  monitoringManager,
QueryParsingServicePtr  queryParsingService,
CoordinatorHealthCheckServicePtr  coordinatorHealthCheckService 
)
explicit

Create coordinator RPC server.

Parameters
requestHandlerServicethe instance of Query Service
topology: the instance of the topology
queryCatalog: the instance of query catalog
monitoringService: the instance of monitoring service
coordinatorHealthCheckService: coordinator health check service

Member Function Documentation

◆ AddParent()

Status CoordinatorRPCServer::AddParent ( ServerContext *  context,
const AddParentRequest *  request,
AddParentReply *  reply 
)
override

RPC Call to add parent.

Parameters
contextthe server context
requestadd parent request
replyadd parent reply
Returns
success

References NES_DEBUG, and NES_ERROR.

◆ GetNodesInRange()

Status CoordinatorRPCServer::GetNodesInRange ( ServerContext *  ,
const GetNodesInRangeRequest *  request,
GetNodesInRangeReply *  reply 
)
override

RPC Call to get a list of field nodes within a defined radius around a geographical location.

Parameters
contextthe server context
requestthat is sent from worker to the coordinator containing the center of the query area and the radius
replythat is sent back from the coordinator to the worker containing the ids of all nodes in the defined area and their corresponding locations
Returns
success

◆ GetParents()

Status CoordinatorRPCServer::GetParents ( ServerContext *  ,
const GetParentsRequest *  request,
GetParentsReply *  reply 
)
override

References nodeId, and NES::TestUtils::parentId().

Here is the call graph for this function:

◆ NotifyQueryFailure()

Status CoordinatorRPCServer::NotifyQueryFailure ( ServerContext *  context,
const QueryFailureNotification *  request,
QueryFailureNotificationReply *  reply 
)
override

RPC Call to notify the failure of a query.

Parameters
contextthe server context
requestthat is sent from worker to the coordinator and filled with information of the failed query (Ids of query, worker, etc. and error message)
replythat is sent back from the coordinator to the worker to confirm that notification was successful
Returns
success

References NES_ASSERT2_FMT, and NES_ERROR.

◆ NotifySoftStopCompleted()

Status CoordinatorRPCServer::NotifySoftStopCompleted ( ::grpc::ServerContext *  context,
const ::SoftStopCompletionMessage *  request,
::SoftStopCompletionReply *  response 
)
override

Notify coordinator that for a subquery plan the soft stop is completed or not

Parameters
context: the server context
request: that is sent from worker to the coordinator and containing the query id, sub query id, and if soft stop is completed
response: that is sent back from the coordinator to the worker if request is processed
Returns
true if the request is acknowledged

References NES::SOFT_STOP_COMPLETED.

◆ notifySourceStopTriggered()

Status CoordinatorRPCServer::notifySourceStopTriggered ( ::grpc::ServerContext *  context,
const ::SoftStopTriggeredMessage *  request,
::SoftStopTriggeredReply *  response 
)
override

Notify coordinator that for a subquery plan the soft stop is triggered or not

Parameters
context: the server context
request: that is sent from worker to the coordinator and containing the query id, sub query id, and if soft stop is triggered
response: that is sent back from the coordinator to the worker if request is processed
Returns
true if coordinator successfully recorded the information else false

References NES_INFO, and NES::SOFT_STOP_TRIGGERED.

◆ RegisterLogicalSource()

Status CoordinatorRPCServer::RegisterLogicalSource ( ServerContext *  context,
const RegisterLogicalSourceRequest *  request,
RegisterLogicalSourceReply *  reply 
)
override

RPC Call to register logical source.

Parameters
contextthe server context
requestregister logical source request
replyregister logical source response
Returns
success

References NES_DEBUG, and NES_ERROR.

◆ RegisterPhysicalSource()

Status CoordinatorRPCServer::RegisterPhysicalSource ( ServerContext *  context,
const RegisterPhysicalSourcesRequest *  request,
RegisterPhysicalSourcesReply *  reply 
)
override

RPC Call to register physical source.

Parameters
contextthe server context
requestregister physical source request
replyregister physical source response
Returns
success

References NES_DEBUG, NES_ERROR, and NES_WARNING.

◆ RegisterWorker()

Status CoordinatorRPCServer::RegisterWorker ( ServerContext *  context,
const RegisterWorkerRequest *  registrationRequest,
RegisterWorkerReply *  reply 
)
override

RPC Call to register a node.

Parameters
contextthe server context
registrationRequestnode registration request
replythe node registration reply
Returns
success

References NES::TestUtils::dataPort(), deserializeOpenCLDeviceInfo(), NES::NESStrongType< T, Tag, invalid, initial >::getRawValue(), backward::details::move(), NES_DEBUG, NES_ERROR, NES_TRACE, nodeId, NES::Spatial::Util::SpatialTypeUtility::protobufEnumToNodeType(), and NES::Monitoring::RegistrationMetric.

Here is the call graph for this function:

◆ RelocateTopologyNode()

Status CoordinatorRPCServer::RelocateTopologyNode ( ServerContext *  ,
const NodeRelocationRequest *  request,
NodeRelocationReply *  reply 
)
override

modify the topology by removing and adding links and then rerun an incremental placement for queries that were sending data over one of the removed links

Parameters
requestcontains a list of topology links to remvoe and a list of topology links to add
replycontains a boolean which is set to true if the operation succeeded
Returns
OK on success, CANCELLED otherwise

References NES::RequestProcessor::ISQPAddLinkEvent::create(), and NES::RequestProcessor::ISQPRemoveLinkEvent::create().

Here is the call graph for this function:

◆ RemoveParent()

Status CoordinatorRPCServer::RemoveParent ( ServerContext *  context,
const RemoveParentRequest *  request,
RemoveParentReply *  reply 
)
override

RPC Call to remove parent.

Parameters
contextthe server context
requestremove parent request
replyremove parent response
Returns
success

References NES_DEBUG, and NES_ERROR.

◆ ReplaceParent()

Status CoordinatorRPCServer::ReplaceParent ( ServerContext *  context,
const ReplaceParentRequest *  request,
ReplaceParentReply *  reply 
)
override

RPC Call to replace parent.

Parameters
contextthe server context
requestreplace parent request
replyreplace parent reply
Returns
success

References NES_DEBUG, and NES_ERROR.

◆ RequestSoftStop()

Status CoordinatorRPCServer::RequestSoftStop ( ::grpc::ServerContext *  context,
const ::RequestSoftStopMessage *  request,
::StopRequestReply *  response 
)
override

Request if soft stop can be performed for the query

Parameters
context: the server context
request: that is sent from worker to the coordinator and containing the query id for which the soft stop to request
response: that is sent back from the coordinator to the worker if soft stop can be processed or not
Returns
true if soft stop can be performed else false

References NES::MARKED_FOR_SOFT_STOP, and NES_WARNING.

◆ SendErrors()

Status CoordinatorRPCServer::SendErrors ( ServerContext *  ,
const SendErrorsMessage *  request,
ErrorReply *  reply 
)
override

RPC Call to send errors to the coordinator.

Parameters
contextthe server context
requestthat is sent from worker to the coordinator and filled with information of errors
replythat is sent back from the coordinator to the worker to confirm that notification was successful
Returns
success

References NES_ERROR.

◆ SendLocationUpdate()

Status CoordinatorRPCServer::SendLocationUpdate ( ServerContext *  ,
const LocationUpdateRequest *  request,
LocationUpdateReply *  reply 
)
override

inform the coordinator that the devices location has changed

Parameters
request: sent from worker to coordinator containing the id of the mobile device, its new location and the time when this location was recorded
reply: sent from coordinator to worker containing no data
Returns
OK in any case

References backward::details::move(), NES_DEBUG, and timestamp.

Here is the call graph for this function:

◆ SendScheduledReconnect()

Status CoordinatorRPCServer::SendScheduledReconnect ( ServerContext *  ,
const SendScheduledReconnectRequest *  request,
SendScheduledReconnectReply *  reply 
)
override

inform the coordinator that a mobile devices reconnect prediction has changed

Parameters
request: sent from worker to coordinator containing the id of the mobile device and a list of the old scheduled reconnects to be removed as well as the new scheduled reconnects to be added. With each reconnect consisting of the id of the node which the mobile device expects to connect to and the location and time at which the reconnect is expected to happen
reply: sent from coordinator to worker not containing any data
Returns
OK if the coordinator succesfully recorded the data, CANCELLED otherwise

◆ UnregisterLogicalSource()

Status CoordinatorRPCServer::UnregisterLogicalSource ( ServerContext *  context,
const UnregisterLogicalSourceRequest *  request,
UnregisterLogicalSourceReply *  reply 
)
override

RPC Call to unregister logical source.

Parameters
contextthe server context
requestunregister logical source request
replyunregister logical source response
Returns
success

References NES_DEBUG, and NES_ERROR.

◆ UnregisterPhysicalSource()

Status CoordinatorRPCServer::UnregisterPhysicalSource ( ServerContext *  context,
const UnregisterPhysicalSourceRequest *  request,
UnregisterPhysicalSourceReply *  reply 
)
override

RPC Call to unregister physical source.

Parameters
contextthe server context
requestunregister physical source request
replyunregister physical source reply
Returns
success

References NES_DEBUG, and NES_ERROR.

◆ UnregisterWorker()

Status CoordinatorRPCServer::UnregisterWorker ( ServerContext *  context,
const UnregisterWorkerRequest *  request,
UnregisterWorkerReply *  reply 
)
override

RPC Call to unregister a node.

Parameters
contextthe server context
requestnode unregistration request
replythe node unregistration reply
Returns
success

References NES_DEBUG, and NES_ERROR.


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