Resource Tuner
Loading...
Searching...
No Matches
ServerInternal.h File Reference
#include <cstdint>
#include "ErrCodes.h"
#include "Request.h"
#include "RequestQueue.h"
#include "ThreadPool.h"
#include "CocoTable.h"
#include "RateLimiter.h"
#include "RequestManager.h"
#include "ResourceRegistry.h"
#include "PropertiesRegistry.h"
#include "ServerInternal.h"
#include "TargetRegistry.h"

Go to the source code of this file.

Functions

ErrCode fetchProperties ()
 Initializes the Properties store.
 
ErrCode submitResProvisionRequest (void *request)
 Submit a Resource Provisioning Request from a Client for processing.
 
int8_t submitPropGetRequest (const std::string &prop, std::string &buffer, const std::string &defValue)
 Gets a property from the Config Store.
 
int8_t submitPropSetRequest (const std::string &prop, const std::string &value)
 Modifies an already existing property in the Config Store.
 
ErrCode submitPropRequest (void *request)
 Submit an incoming Prop Request from a Client, for processing.
 

Function Documentation

◆ fetchProperties()

ErrCode fetchProperties ( )

Initializes the Properties store.

This function will read and Parse the Property Config YAML file.

Returns
int8_t:
  • RC_SUCCESS: If the Properties were successfully parsed.
  • Non-Zero Status Code indicating an Error: Otherwise

◆ submitPropGetRequest()

int8_t submitPropGetRequest ( const std::string &  prop,
std::string &  buffer,
const std::string &  defValue 
)

Gets a property from the Config Store.

Note: This API is meant to be used internally, i.e. by other Resource Tuner modules like Signals and not the End-Client Directly. Client Facing APIs are provided in Core/Client/APIs/

Parameters
propName of the Property to be fetched.
bufferA buffer to hold the result, i.e. the property value corresponding to the specified name.
defValueValue to return in case a property with the specified Name is not found in the Config Store
Returns
int8_t:
  • 1: If the Property was found in the store
  • 0: Otherwise

◆ submitPropRequest()

ErrCode submitPropRequest ( void *  request)

Submit an incoming Prop Request from a Client, for processing.

This API accepts both Prop Get and Set Requests from the Client, and processes them accordingly.

Parameters
requestEncapsulation type for the the Prop Request
Returns
int8_t:
  • 1: If the Property with the specified name was found in the store, and was updated successfully.
  • 0: Otherwise

◆ submitPropSetRequest()

int8_t submitPropSetRequest ( const std::string &  prop,
const std::string &  value 
)

Modifies an already existing property in the Config Store.

Note: This API is meant to be used internally i.e. by other Resource Tuner modules like Signals and not the End-Client Directly. Client Facing APIs are provided in Core/Client/APIs/

Parameters
propName of the Property to be modified.
valueA buffer holding the new the property value.
Returns
int8_t:
  • 1: If the Property with the specified name was found in the store, and was updated successfully.
  • 0: Otherwise

◆ submitResProvisionRequest()

ErrCode submitResProvisionRequest ( void *  request)

Submit a Resource Provisioning Request from a Client for processing.

Note: This API acts an interface for other Resource Tuner components like Signals to submit a Resource Provisioning Request to the Resource Tuner Server, and subsequently provision the desired Resources.

Parameters
requestA buffer holding the Request.