Class StreamWriter

Inheritance Relationships

Base Type

  • public ska::pst::common::ApplicationManager

Class Documentation

class StreamWriter : public ska::pst::common::ApplicationManager

The Stream Writer class adheres to the StateModel and provides the functionality to write a data stream from a Shared Memory Ring Buffer to a series of files that are stored on disk. It makes use of a DiskMonitor instance to record the data writing performance.

Public Functions

StreamWriter(DiskMonitor &disk_monitor)

Construct a new StreamWriter object.

Parameters

disk_monitorDiskMonitor instance to update with file writer statistics

StreamWriter(DiskMonitor &disk_monitor, bool use_o_direct)

Construct a new StreamWriter object that supports O_DIRECT file access.

Parameters
  • disk_monitorDiskMonitor instance to update with file writer statistics

  • use_o_direct – Flag to enable the O_DIRECT option.

~StreamWriter()

Destroy the StreamWriter object.

void validate_configure_beam(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context)

Validates Beam configuration. Specific validation errors must be set when throwing exceptions.

Parameters
  • config – Beam configuration to validate

  • context – A validation context where errors should be added.

void validate_configure_scan(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context)

Validates Scan configuration. Specific validation errors must be set when throwing exceptions.

Parameters
  • config – Scan configuration to validate

  • context – A validation context where errors should be added.

void validate_start_scan(const ska::pst::common::AsciiHeader &config)

Validates StartScan configuration. Specific validation errors must be set when throwing exceptions.

Parameters

config – StartScan configuration to validate

inline uint64_t get_bufs_written_per_file()

Get the number of ring buffer elements to be written to each file.

Returns

uint64_t number of ring buffer elements to be written to each file

inline void set_bufs_written_per_file(uint64_t bufs_per_file)

Set the number of full ring buffer elements to write to each file.

Parameters

bufs_per_file – number of full ring buffer elements to write to each file

inline std::filesystem::path get_output_path()

Get the output path to which files will be written.

Returns

std::filesystem::path output path to which files will be written

void mark_scan(const std::string &state)

Mark the end of a scan by creating a file based on the state of the end of the perform_scan thread.

Parameters

state – state of the scan. Used as the file name of the marker file. Currently only writes scan_completed