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

Remote client to deploy queryIdAndCatalogEntryMapping over the REST API. More...

#include <RemoteClient.hpp>

Classes

struct  QueryStopResult
 

Public Member Functions

 RemoteClient (const std::string &coordinatorHost="127.0.0.1", uint16_t coordinatorPort=8081, std::chrono::seconds requestTimeout=std::chrono::seconds(20), bool disableLogging=false)
 constructor of the client More...
 
bool testConnection ()
 test if a connection to the coordinator can be established More...
 
QueryId submitQuery (const Query &query, QueryConfig config=QueryConfig())
 deploy a new query More...
 
QueryStopResult stopQuery (QueryId queryId)
 stop the query with the given query id More...
 
std::string getQueryPlan (QueryId queryId)
 get a queryIdAndCatalogEntryMapping query plan More...
 
std::string getQueryExecutionPlan (QueryId queryId)
 get a queryIdAndCatalogEntryMapping execution plan More...
 
std::string getQueryStatus (QueryId queryId)
 get query status of a query More...
 
std::string getTopology ()
 get current topology More...
 
std::string getQueries ()
 get all registered queryIdAndCatalogEntryMapping More...
 
std::string getQueries (QueryState status)
 get all registered queryIdAndCatalogEntryMapping in the given status More...
 
bool addLogicalSource (const SchemaPtr schema, const std::string &sourceName)
 add a logical source More...
 
std::string getLogicalSources ()
 get logical sources More...
 
std::string getPhysicalSources (std::string logicalSourceName)
 get physical sources More...
 

Detailed Description

Remote client to deploy queryIdAndCatalogEntryMapping over the REST API.

Constructor & Destructor Documentation

◆ RemoteClient()

NES::Client::RemoteClient::RemoteClient ( const std::string &  coordinatorHost = "127.0.0.1",
uint16_t  coordinatorPort = 8081,
std::chrono::seconds  requestTimeout = std::chrono::seconds(20),
bool  disableLogging = false 
)
explicit

constructor of the client

Parameters
stringcoordinator host e.g. 127.0.0.1
uint16_tcoordinator REST port e.g. 8081
secondsrequest timeout

References NES::LOG_DEBUG, and NES::Logger::setupLogging().

Here is the call graph for this function:

Member Function Documentation

◆ addLogicalSource()

bool NES::Client::RemoteClient::addLogicalSource ( const SchemaPtr  schema,
const std::string &  sourceName 
)

add a logical source

Parameters
SchemaPtrschema of the new logical source
stringname of the new logical source
Returns
successfully added

References NES_DEBUG.

◆ getLogicalSources()

std::string NES::Client::RemoteClient::getLogicalSources ( )

get logical sources

Returns
logical sources

References NES_DEBUG.

◆ getPhysicalSources()

std::string NES::Client::RemoteClient::getPhysicalSources ( std::string  logicalSourceName)

get physical sources

Parameters
logicalSourceNamename of the logical source for which physical source is required
Returns
physical sources

References NES::TestUtils::logicalSourceName(), NES_ASSERT2_FMT, and NES_DEBUG.

Here is the call graph for this function:

◆ getQueries() [1/2]

std::string NES::Client::RemoteClient::getQueries ( )

get all registered queryIdAndCatalogEntryMapping

Returns
query information

References NES_DEBUG.

◆ getQueries() [2/2]

std::string NES::Client::RemoteClient::getQueries ( QueryState  status)

get all registered queryIdAndCatalogEntryMapping in the given status

Parameters
QueryStatusquery status, i.e. registered
Returns
query information

References magic_enum::enum_name().

Here is the call graph for this function:

◆ getQueryExecutionPlan()

std::string NES::Client::RemoteClient::getQueryExecutionPlan ( QueryId  queryId)

get a queryIdAndCatalogEntryMapping execution plan

Parameters
uint64_tquery id
Returns
execution plan

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

Here is the call graph for this function:

◆ getQueryPlan()

std::string NES::Client::RemoteClient::getQueryPlan ( QueryId  queryId)

get a queryIdAndCatalogEntryMapping query plan

Parameters
uint64_tquery id
Returns
query plan

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

Here is the call graph for this function:

◆ getQueryStatus()

std::string NES::Client::RemoteClient::getQueryStatus ( QueryId  queryId)

get query status of a query

Parameters
uint64_tquery id
Returns
query status

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

Here is the call graph for this function:

◆ getTopology()

std::string NES::Client::RemoteClient::getTopology ( )

get current topology

Returns
topology

References NES_DEBUG.

◆ stopQuery()

RemoteClient::QueryStopResult NES::Client::RemoteClient::stopQuery ( QueryId  queryId)

stop the query with the given query id

Parameters
uint64_tquery id
Returns
stop was successfully, if not why

References NES::Client::RemoteClient::QueryStopResult::errorMessage, NES_DEBUG, NES::NESStrongType< T, Tag, invalid, initial >::toString(), and NES::Client::RemoteClient::QueryStopResult::withError.

Here is the call graph for this function:

◆ submitQuery()

QueryId NES::Client::RemoteClient::submitQuery ( const Query query,
QueryConfig  config = QueryConfig() 
)

deploy a new query

Parameters
Queryquery to deploy
QueryConfigquery config
Returns
query id

References magic_enum::enum_name(), NES::Client::QueryConfig::getPlacementType(), NES::Query::getQueryPlan(), NES_DEBUG, and NES_ERROR.

Here is the call graph for this function:

◆ testConnection()

bool NES::Client::RemoteClient::testConnection ( )

test if a connection to the coordinator can be established

Returns
connection test successful

References NES_DEBUG.


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