bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
dmrpp::SuperChunk Class Reference

A SuperChunk is a collection of contiguous Chunk objects along with optimized methods for data retrieval and inflation. More...

#include <SuperChunk.h>

Collaboration diagram for dmrpp::SuperChunk:
Collaboration graph

Public Member Functions

virtual bool add_chunk (std::shared_ptr< Chunk > candidate_chunk)
 Attempts to add a new Chunk to this SuperChunk.
 
virtual bool add_chunk_non_contiguous (std::shared_ptr< Chunk > candidate_chunk, unsigned long long &end_pos)
 
virtual void dump (std::ostream &strm) const
 Writes the to_string() output to the stream strm.
 
virtual bool empty () const
 
std::shared_ptr< http::urlget_data_url ()
 
bool get_non_contiguous_chunk_flag () const
 
virtual unsigned long long get_offset () const
 
virtual unsigned long long get_size () const
 
virtual std::string id () const
 
virtual void process_child_chunks ()
 Reads the SuperChunk, inflates/de-shuffles the subordinate chunks as required and copies the values into array.
 
virtual void process_child_chunks_unconstrained ()
 Reads the SuperChunk, inflates/deshuffles the subordinate chunks as required and copies the values into array.
 
virtual void read ()
 
virtual void read_unconstrained ()
 
virtual void read_unconstrained_dio ()
 
virtual void retrieve_data ()
 Cause the SuperChunk and all of it's subordinate Chunks to be read.
 
virtual void retrieve_data_dio ()
 
void set_non_contiguous_chunk_flag (bool flag)
 
 SuperChunk (const std::string &sc_id, DmrppArray *parent=nullptr)
 
std::string to_string (bool verbose) const
 Makes a string representation of the SuperChunk.
 

Friends

class SuperChunkTest
 

Detailed Description

A SuperChunk is a collection of contiguous Chunk objects along with optimized methods for data retrieval and inflation.

Definition at line 44 of file SuperChunk.h.

Constructor & Destructor Documentation

◆ SuperChunk()

dmrpp::SuperChunk::SuperChunk ( const std::string & sc_id,
DmrppArray * parent = nullptr )
inlineexplicit

Definition at line 69 of file SuperChunk.h.

◆ ~SuperChunk()

virtual dmrpp::SuperChunk::~SuperChunk ( )
inlinevirtual

Definition at line 73 of file SuperChunk.h.

Member Function Documentation

◆ add_chunk()

bool dmrpp::SuperChunk::add_chunk ( std::shared_ptr< Chunk > candidate_chunk)
virtual

Attempts to add a new Chunk to this SuperChunk.

The candidate_chunk is added to this SuperChunk if: it is contiguous with the end of the this SuperChunk and has the same data_url. Note that if the SuperChunk is empty, candidate_chunk meets those criteria by default.

Note
This method was modified to support fill value chunks as part of the work on HYRAX-635. As a stop-gap implementation, each fill value chunk will get its own SuperChunk, even though that is not the most efficient way forward. See HYRAX-713 for a bit more on this. To add FV chunk support, FV chunks can ony be added when d_chunks is empty. Thus, the is_contiguous(...) test must fail if the chunk uses fill values. To make this hack easier to unwind later on, I'm going to make that test right here - so it's obvious. jhrg 5/7/22
Todo
Should candidate_chunk be passed by reference? Maybe calls to this method should use move()? jhrg 5/7/22
Todo
Should this only be called when d_chunks is not empty? jhrg 5/7/22
Parameters
candidate_chunkThe Chunk to add.
Returns
True when the chunk is added, false otherwise.

Definition at line 524 of file SuperChunk.cc.

◆ add_chunk_non_contiguous()

bool dmrpp::SuperChunk::add_chunk_non_contiguous ( std::shared_ptr< Chunk > candidate_chunk,
unsigned long long & end_pos )
virtual

Definition at line 548 of file SuperChunk.cc.

◆ dump()

void dmrpp::SuperChunk::dump ( std::ostream & strm) const
virtual

Writes the to_string() output to the stream strm.

Parameters
strm

Definition at line 895 of file SuperChunk.cc.

◆ empty()

virtual bool dmrpp::SuperChunk::empty ( ) const
inlinevirtual

Definition at line 102 of file SuperChunk.h.

◆ get_data_url()

std::shared_ptr< http::url > dmrpp::SuperChunk::get_data_url ( )
inline

Definition at line 81 of file SuperChunk.h.

◆ get_non_contiguous_chunk_flag()

bool dmrpp::SuperChunk::get_non_contiguous_chunk_flag ( ) const
inline

Definition at line 105 of file SuperChunk.h.

◆ get_offset()

virtual unsigned long long dmrpp::SuperChunk::get_offset ( ) const
inlinevirtual

Definition at line 83 of file SuperChunk.h.

◆ get_size()

virtual unsigned long long dmrpp::SuperChunk::get_size ( ) const
inlinevirtual

Definition at line 82 of file SuperChunk.h.

◆ id()

virtual std::string dmrpp::SuperChunk::id ( ) const
inlinevirtual

Definition at line 77 of file SuperChunk.h.

◆ process_child_chunks()

void dmrpp::SuperChunk::process_child_chunks ( )
virtual

Reads the SuperChunk, inflates/de-shuffles the subordinate chunks as required and copies the values into array.

Parameters
target_arrayThe array into which to write the data.

Definition at line 800 of file SuperChunk.cc.

◆ process_child_chunks_unconstrained()

void dmrpp::SuperChunk::process_child_chunks_unconstrained ( )
virtual

Reads the SuperChunk, inflates/deshuffles the subordinate chunks as required and copies the values into array.

Parameters
target_arrayThe array into which to write the data.

Definition at line 836 of file SuperChunk.cc.

◆ read()

virtual void dmrpp::SuperChunk::read ( )
inlinevirtual

Definition at line 85 of file SuperChunk.h.

◆ read_unconstrained()

virtual void dmrpp::SuperChunk::read_unconstrained ( )
inlinevirtual

Definition at line 89 of file SuperChunk.h.

◆ read_unconstrained_dio()

void dmrpp::SuperChunk::read_unconstrained_dio ( )
virtual

Definition at line 900 of file SuperChunk.cc.

◆ retrieve_data()

void dmrpp::SuperChunk::retrieve_data ( )
virtual

Cause the SuperChunk and all of it's subordinate Chunks to be read.

Definition at line 708 of file SuperChunk.cc.

◆ retrieve_data_dio()

void dmrpp::SuperChunk::retrieve_data_dio ( )
virtual

Definition at line 757 of file SuperChunk.cc.

◆ set_non_contiguous_chunk_flag()

void dmrpp::SuperChunk::set_non_contiguous_chunk_flag ( bool flag)
inline

Definition at line 104 of file SuperChunk.h.

◆ to_string()

string dmrpp::SuperChunk::to_string ( bool verbose = false) const

Makes a string representation of the SuperChunk.

Parameters
verboseIf set true then details of the subordinate Chunks will be included.
Returns
A string representation of the SuperChunk.

Definition at line 874 of file SuperChunk.cc.

Friends And Related Symbol Documentation

◆ SuperChunkTest

friend class SuperChunkTest
friend

Definition at line 46 of file SuperChunk.h.


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