Class DspDiskLmcServiceHandler

Inheritance Relationships

Base Type

Class Documentation

class DspDiskLmcServiceHandler : public ska::pst::common::LmcServiceHandler

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

Public Functions

inline DspDiskLmcServiceHandler(std::shared_ptr<ska::pst::dsp::DiskManager> dsp)
virtual ~DspDiskLmcServiceHandler() = 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_disk sub-field in the resources request and calls the DiskManager::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_disk 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 DiskManager::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 disk 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 DiskManager 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 DiskManager for a scan. This implementation expects that the dsp_disk sub-message is set on the configuration parameter.

Parameters

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

Throws

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

virtual void deconfigure_scan() override

Handle deconfiguring service for a scan.

This will deconfigure the DiskManager 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_disk 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 DiskManager is configured for a scan.

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

Handle initiating a scan.

This will call DiskManager::start_scan that will initial a scan, including reading the ring buffers and writing voltages to disk.

Throws

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

virtual void stop_scan() override

Handle ending a scan.

This will call DiskManager::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 DiskManger 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.DISK. 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.

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 DiskManager state.

Returns

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

inline virtual std::exception_ptr get_application_manager_exception() override

Get the DiskManager exception pointer.

Returns

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

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.