Accelerated Computation Engine
Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Ace::Analytic::Chunk Class Reference

#include <ace_analytic_chunk.h>

Inheritance diagram for Ace::Analytic::Chunk:
Ace::Analytic::AbstractManager Ace::Analytic::AbstractInput

Public Member Functions

virtual bool isFinished () const override final
 
 Chunk (quint16 type, int index, int size)
 
virtual ~Chunk () override final
 
- Public Member Functions inherited from Ace::Analytic::AbstractManager
quint16 analyticType () const
 
int size () const
 
EAbstractAnalytic::Input::Type type (int index) const
 
QVariant data (int index, EAbstractAnalytic::Input::Role role) const
 
QList< QString > commandLineArguments () const
 
void set (int index, const QVariant &value)
 
- Public Member Functions inherited from Ace::Analytic::AbstractInput
 AbstractInput ()=default
 
 ~AbstractInput ()
 

Protected Slots

virtual void start () override final
 
void process ()
 
- Protected Slots inherited from Ace::Analytic::AbstractManager
virtual void start ()
 

Protected Member Functions

virtual QFile * addOutputFile (const QString &path) override final
 
virtual Ace::DataObjectaddOutputData (const QString &path, quint16 type, const EMetadata &system) override final
 
virtual void saveResult (std::unique_ptr< EAbstractAnalytic::Block > &&result) override final
 
- Protected Member Functions inherited from Ace::Analytic::AbstractManager
 AbstractManager (quint16 type)
 
std::unique_ptr< EAbstractAnalytic::BlockmakeWork (int index)
 
void writeResult (std::unique_ptr< EAbstractAnalytic::Block > &&result, int expectedIndex)
 
EAbstractAnalyticanalytic ()
 
const EAbstractAnalyticanalytic () const
 
- Protected Member Functions inherited from Ace::Analytic::AbstractInput
virtual int index () const
 
virtual void writeResult (std::unique_ptr< EAbstractAnalytic::Block > &&result)
 

Additional Inherited Members

- Public Slots inherited from Ace::Analytic::AbstractManager
void initialize ()
 
void terminationRequested ()
 
void finish ()
 
- Signals inherited from Ace::Analytic::AbstractManager
void progressed (int percentComplete)
 
void done ()
 
void finished ()
 
- Static Public Member Functions inherited from Ace::Analytic::AbstractManager
static std::unique_ptr< Ace::Analytic::AbstractManagermakeManager (quint16 type, int index, int size)
 

Detailed Description

This is the chunk run manager. This manager is used to execute only a portion of the blocks for an analytic, temporarily saving them in a binary file. The function of this class is to determine which part of the work blocks it must process into result blocks based off the index and size it is given. From there it processes the chunk of blocks and saved them into a temporary binary file. The location and file name of the chunk is determined by global settings and the index of this chunk manager.

Constructor & Destructor Documentation

◆ Chunk()

Chunk::Chunk ( quint16  type,
int  index,
int  size 
)
explicit

Constructs a new chunk manager with the given analytic type, chunk index, and chunk size.

Parameters
typeThe analytic type that is used.
indexThe chunk index for this process.
sizeThe chunk size which is the total number of chunks the analytic is split into.

◆ ~Chunk()

Chunk::~Chunk ( )
finaloverridevirtual

Deletes the qt data stream used for saved data to the chunk file.

Member Function Documentation

◆ addOutputData()

Ace::DataObject * Chunk::addOutputData ( const QString &  path,
quint16  type,
const EMetadata system 
)
finaloverrideprotectedvirtual

This interface opens a new data object with the given path, erasing any data the file may have contained and returning a pointer to the new data object. This implementation does nothing and returns a null pointer because a chunk manager saved result blocks to a special binary file.

Parameters
pathUnused path to data object file.
typeUnused data object type.
systemUnused system metadata for new data objects.

Reimplemented from Ace::Analytic::AbstractManager.

◆ addOutputFile()

QFile * Chunk::addOutputFile ( const QString &  path)
finaloverrideprotectedvirtual

Implements the interface that opens a new file set to write only and truncate with the given path. This implementation does nothing and returns a null pointer because a chunk manager saves result blocks to a special binary file.

Parameters
pathUnused path to file.

Reimplemented from Ace::Analytic::AbstractManager.

◆ isFinished()

bool Chunk::isFinished ( ) const
finaloverridevirtual

Implements the interface that tests if this abstract input is finished and received all result blocks for its analytic. This implementation is special in that it only processes a chunk of its analytic work blocks therefore it is finished once it has received all of its portion of result blocks.

Returns
True if this abstract input is finished or false otherwise.

Implements Ace::Analytic::AbstractInput.

◆ process

void Chunk::process ( )
protectedslot

Processes the work blocks this chunk manager is responsible for saving, adding them to this manager's abstract run object for processing.

◆ saveResult()

void Chunk::saveResult ( std::unique_ptr< EAbstractAnalytic::Block > &&  result)
finaloverrideprotectedvirtual

Implements the interface that saves the given result block to its underlying analytic and assumes the order of indexes given is not sorted and random. This implementation simply saves the raw result block to a temporary binary file.

Parameters
resultThe result block that is saved to a temporary binary file.

Reimplemented from Ace::Analytic::AbstractInput.

◆ start

void Chunk::start ( )
finaloverrideprotectedvirtualslot

Implements the interface that is called once to begin the analytic run for this manager after all argument input has been set. This implementation initializes the chunk file, indexes, and schedules the process slot to be called.


The documentation for this class was generated from the following files: