Class FSWriteTask¶
Defined in File stage.py
Inheritance Relationships¶
Base Type¶
public stage.Task(Class Task)
Class Documentation¶
- stage.FSWriteTask : public stage.Task
A Class representing a task flushing data in the specified output directory Attributes: i_queue: The input queue to read data from. o_queue: The output queue to write the path of the saved file. writer_cls: A child class inheriting from FileWriter that writes to the specified file. out_dir: The directory to write data to.
Public Functions
- __init__(self, i_queue, o_queue, writer_cls, out_dir)¶
initializes the writer task to read data from the i_queue write them using the writer_cls and store the data in the out_dir.
- process_request(self, data_files, item)¶
Function that process a request for FSwriteTask and write the file on disk
- __call__(self)¶
A busy loop reading messages from the i_queue, writting the input,output data in a file using the instances 'writer_cls' and inform the task waiting on the output_q about the path of the file.
Public Members
- data_writer_cls = writer_cls¶
- out_dir = out_dir¶
- i_queue = i_queue¶
- o_queue = o_queue¶
- suffix = writer_cls.get_file_format_suffix()¶
- max_size_file = os.getenv("AMS_MAX_FILE_SIZE", 2*1024*1024*1024)¶
- print_message = os.getenv("AMS_MAX_PRINT_MESSAGE", 1000)¶
- total_bytes_written = 0¶
- total_messages = 0¶
- datasize_byte = self.total_bytes_written¶