Class FlowThroughLmcServiceHandler

Inheritance Relationships

Base Type

Class Documentation

class FlowThroughLmcServiceHandler : public ska::pst::common::LmcServiceHandler

Class to act as a bridge between the local monitoring and control service of DSP.FT and the ska::pst::dsp::FlowThroughManager.

Public Functions

inline FlowThroughLmcServiceHandler(std::shared_ptr<ska::pst::dsp::FlowThroughManager> dsp)
virtual ~FlowThroughLmcServiceHandler() = default
virtual void validate_beam_configuration(const ska::pst::lmc::BeamConfiguration &configuration) override

Validate a beam configuration.

Validate a beam configuration for correctness but does not apply the configuration.

Throws
  • std::exception – if there is a problem with the beam configuration of the service.

  • ska::pst::common::pst_validation_error – if there are validation errors in the request.

virtual void validate_scan_configuration(const ska::pst::lmc::ScanConfiguration &configuration) override

Validate a scan configuration.

Validate a scan configuration for correctness but does not apply the configuration.

Throws
  • std::exception – if there is a problem with the beam configuration of the service.

  • ska::pst::common::pst_validation_error – if there are validation errors in the request.

virtual void configure_beam(const ska::pst::lmc::BeamConfiguration &resources) override

Handle configuring the service to be a part of a beam.

This implementation expects that there is an dsp_ft sub-field in the resources request and calls the FlowThroughManager::configure_beam method, which expects keys for the data and weights ring buffers.

Parameters

configuration – the configuration for the beam. This message has oneof field should be the dsp_ft sub-field message.

Throws

ska::pst::common::LmcServiceException – if resources had already been assigned.

virtual void deconfigure_beam() override

Handle deconfiguring the service from a beam.

This calls the FlowThroughManager::deconfigure_beam to detach from the ring buffers. This method checks to see the manager has beam configuration.

Throws

ska::pst::common::LmcServiceException – if manager is not beam configured.

virtual void get_beam_configuration(ska::pst::lmc::BeamConfiguration *resources) override

Handle getting the current beam configuration for the service.

This will return the current beam configuration for the flow through manager.

Parameters

resources – the out protobuf message to used to return beam configuration details.

Throws

ska::pst::common::LmcServiceException – if manager is not beam configured.

virtual bool is_beam_configured() const noexcept override

Check if this service is configured for a beam.

Will return true if the FlowThroughManager has beam configuration.

virtual void configure_scan(const ska::pst::lmc::ScanConfiguration &configuration) override

Handle configuring the service for a scan.

This will configure the FlowThroughManager for a scan. This implementation expects that the dsp_ft sub-message is set on the configuration parameter.

Parameters

configuration – a protobuf message that should have the dsp_ft sub-message set.

Throws

ska::pst::common::LmcServiceException – if manager is not beam configured, configuration parameter doesn’t have a a dsp_ft sub-message, or that the flow through manager is already configured for a scan.

virtual void deconfigure_scan() override

Handle deconfiguring service for a scan.

This will deconfigure the FlowThroughManager for a scan.

Throws

ska::pst::common::LmcServiceException – if manager is configured for a scan.

virtual void get_scan_configuration(ska::pst::lmc::ScanConfiguration *configuration) override

Handle getting the current scan configuration for the service.

This will return a dsp_ft sub-field message with the current scan configuration.

Parameters

configuration – the out protobuf message to used to return scan configuration details.

Throws

ska::pst::common::LmcServiceException – if manager is configured for a scan.

virtual bool is_scan_configured() const noexcept override

Check if the service has been configured for a scan.

Returns

This will return true if FlowThroughManager is configured for a scan.

virtual void start_scan(const ska::pst::lmc::StartScanRequest &request) override

Handle initiating a scan.

This will call FlowThroughManager::start_scan that will initiate a scan.

Throws

ska::pst::common::LmcServiceException – if manager is not configured for a scan, or is already scanning.

virtual void stop_scan() override

Handle ending a scan.

This will call FlowThroughManager::stop_scan if the service is already scanning.

Throws

ska::pst::common::LmcServiceException – if service is not scanning.

virtual void reset() override

Handle resetting State into Idle.

This ties the states between LmcService ObsState::EMPTY with ApplicationManager State::Idle

virtual bool is_scanning() const noexcept override

Check if the service is currently performing a scan.

Returns

true if the FlowThroughManager is scanning.

virtual void get_monitor_data(ska::pst::lmc::MonitorData *data) override

Handle getting the monitoring data for the service.

This will get the current monitoring data for DSP.FT. This includes the total capacity, available capacity, the amount of bytes written in as scan, and the current write rate.

Parameters

data – Pointer to the protobuf message to return. This will set the dsp sub-message with the monitoring data.

Throws

ska::pst::common::LmcServiceException – if service is not scanning.

virtual void get_env(ska::pst::lmc::GetEnvironmentResponse *response) noexcept override

Return environment variables back to the client.

TODO - Check this

This implementation returns disk_capacity and disk_available_bytes as unsigned int values. The disk_capacity is the total size of the volumne while disk_available_bytes is amount of disk space left on the volumne

Parameters

data – Pointer to a protobuf message message that includes the a map to populate.

inline virtual ska::pst::common::State get_application_manager_state() override

Get the FlowThroughManager state.

Returns

ska::pst::common::State returns current the enum State of the FlowThroughManager

inline virtual std::exception_ptr get_application_manager_exception() override

Get the FlowThroughManager exception pointer.

Returns

std::exception_ptr returns the current captured exception caught by the FlowThroughManager

virtual void go_to_runtime_error(std::exception_ptr exc) override

Put application into a runtime error state.

Parameters

exception – an exception pointer to store on the application manager.