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

#include <GridAggregateOnOuterDimension.h>

Inheritance diagram for agg_util::GridAggregateOnOuterDimension:
Inheritance graph
Collaboration diagram for agg_util::GridAggregateOnOuterDimension:
Collaboration graph

Public Member Functions

virtual const AMDList & getDatasetList () const
 
 GridAggregateOnOuterDimension (const Grid &proto, const Dimension &newDim, const AMDList &memberDatasets, const DDSLoader &loaderProto)
 
 GridAggregateOnOuterDimension (const GridAggregateOnOuterDimension &proto)
 
GridAggregateOnOuterDimensionoperator= (const GridAggregateOnOuterDimension &rhs)
 
virtual GridAggregateOnOuterDimensionptr_duplicate ()
 
bool read () override
 
bool serialize (libdap::ConstraintEvaluator &eval, libdap::DDS &dds, libdap::Marshaller &m, bool ce_eval) override
 
void setShapeFrom (const libdap::Grid &protoSubGrid, bool addMaps)
 
void transform_to_dap4 (libdap::D4Group *root, libdap::Constructor *container) override
 

Protected Member Functions

void copyProtoMapsIntoThisGrid (const Dimension &aggDim)
 
virtual const DimensiongetAggregationDimension () const
 
GridgetSubGridTemplate ()
 
void printConstraints (const libdap::Array &fromArray)
 
virtual void readAndAggregateConstrainedMapsHook ()
 
void readProtoSubGrid ()
 
virtual void transferConstraintsToSubGridHook (Grid *pSubGrid)
 

Detailed Description

class GridAggregateOnOuterDimension : public GridAggregationBase

Grid that performs a joinNew aggregation by taking an ordered list of datatsets which contain Grid's with matching signatures (ie array name, dimensions, maps) and creating a new outer dimension with cardinality the number of datasets in the aggregation.

The resulting aggregated grid will be one plus the rank of the array's of the member dataset Grids.

We assume we have created the proper shape of this Grid so that the map vectors in the Grid superclass are correct (as loaded from the first dataset!)

The data itself will be loaded as needed during serialize based on the response.

TODO OPTIMIZE One major issue is we create one of these objects per aggregation variable, even if these vars are in the same dataset. So when we read, we load the dataset for each variable! Does the BES cache them or something? Maybe we can avoid doing this with some smarts? Not sure... I get the feeling the other handlers do the same sort of thing, but can be smarter about seeking, etc.

Definition at line 80 of file GridAggregateOnOuterDimension.h.

Constructor & Destructor Documentation

◆ GridAggregateOnOuterDimension() [1/2]

agg_util::GridAggregateOnOuterDimension::GridAggregateOnOuterDimension ( const Grid & proto,
const Dimension & newDim,
const AMDList & memberDatasets,
const DDSLoader & loaderProto )

Create the new Grid from the template proto... we'll have the same name, dimension and attributes.

Parameters
prototemplate to use, will be the aggVar from the FIRST member dataset!
memberDatasetsdescriptors for the dataset members of the aggregation. ASSUMED that the contained DDS will have a Grid var with name proto.name() that matches rank and maps, etc!!
loaderProtoloaded template to use (borrow dhi from) to load the datasets

Definition at line 65 of file GridAggregateOnOuterDimension.cc.

◆ GridAggregateOnOuterDimension() [2/2]

agg_util::GridAggregateOnOuterDimension::GridAggregateOnOuterDimension ( const GridAggregateOnOuterDimension & proto)

Definition at line 76 of file GridAggregateOnOuterDimension.cc.

◆ ~GridAggregateOnOuterDimension()

agg_util::GridAggregateOnOuterDimension::~GridAggregateOnOuterDimension ( )
virtual

Definition at line 100 of file GridAggregateOnOuterDimension.cc.

Member Function Documentation

◆ copyProtoMapsIntoThisGrid()

void agg_util::GridAggregationBase::copyProtoMapsIntoThisGrid ( const Dimension & aggDim)
protectedinherited

Copy the template's read in subgrid maps into this. Skip any map found in the subgrid named aggDim.name since we handle the aggregation dimension map specially.

Parameters
aggDima map with aggDim.name is NOT copied.

Definition at line 387 of file GridAggregationBase.cc.

◆ getAggregationDimension()

const Dimension & agg_util::GridAggregateOnOuterDimension::getAggregationDimension ( ) const
protectedvirtual

Get the contained aggregation dimension info

Implements agg_util::GridAggregationBase.

Definition at line 153 of file GridAggregateOnOuterDimension.cc.

◆ getDatasetList()

const AMDList & agg_util::GridAggregationBase::getDatasetList ( ) const
virtualinherited

Accessor for the dataset description list that describes this aggregation.

Returns
a reference to the AggMemberDataset list.

Definition at line 163 of file GridAggregationBase.cc.

◆ getSubGridTemplate()

Grid * agg_util::GridAggregationBase::getSubGridTemplate ( )
protectedinherited

Reveals the raw ptr, but only to subclasses. Don't delete it, but can be changed etc.

Definition at line 321 of file GridAggregationBase.cc.

◆ operator=()

GridAggregateOnOuterDimension & agg_util::GridAggregateOnOuterDimension::operator= ( const GridAggregateOnOuterDimension & rhs)

Definition at line 90 of file GridAggregateOnOuterDimension.cc.

◆ printConstraints()

void agg_util::GridAggregationBase::printConstraints ( const libdap::Array & fromArray)
protectedinherited

Definition at line 361 of file GridAggregationBase.cc.

◆ ptr_duplicate()

GridAggregateOnOuterDimension * agg_util::GridAggregateOnOuterDimension::ptr_duplicate ( )
virtual

Definition at line 84 of file GridAggregateOnOuterDimension.cc.

◆ read()

bool agg_util::GridAggregationBase::read ( )
overrideinherited

Read in only those datasets that are in the constrained output making sure to apply the internal dimension constraints to the member datasets properly before reading them! Stream the data into the output buffer correctly.

NOTE: Subclasses should implement the protected hooks if possible rather than overriding this function!

Returns
success.

Definition at line 169 of file GridAggregationBase.cc.

◆ readAndAggregateConstrainedMapsHook()

void agg_util::GridAggregationBase::readAndAggregateConstrainedMapsHook ( )
protectedvirtualinherited

Called from read()! Invokes the user hooks eventually. Can be overridden, but default calls should suffice for now.

Definition at line 344 of file GridAggregationBase.cc.

◆ readProtoSubGrid()

void agg_util::GridAggregationBase::readProtoSubGrid ( )
protectedinherited

Transfer constraints properly from this object's maps and read in the proto subgrid entirely (respecting constraints)

Definition at line 368 of file GridAggregationBase.cc.

◆ serialize()

bool agg_util::GridAggregationBase::serialize ( libdap::ConstraintEvaluator & eval,
libdap::DDS & dds,
libdap::Marshaller & m,
bool ce_eval )
overrideinherited

Pipelining data reads and network writes. This version of serialize(), like the versions in ArrayAggregation... also here in the NCML module, handles interleaved data reads and network write operations.

Note
The read() method for this class reads the entire Aggregated Grid variable into memory, so code that depends on that behavior will continue to work. When this serialize() code is called and the variable is 'loaded' with data, the libdap::Grid::serialize() code is called, so that will work as well. When this method is called and the data still need to be read, the new behavior will take over and latency, from the client program's perspective, will be small compared to reading then entire variable and then transmitting its values.
Parameters
eval
dds
m
ce_eval
Returns

Definition at line 219 of file GridAggregationBase.cc.

◆ setShapeFrom()

void agg_util::GridAggregationBase::setShapeFrom ( const libdap::Grid & protoSubGrid,
bool addMaps )
inherited

Use the data array and maps from protoSubGrid as the initial point for the shape of the Grid. It may still not be complete until the callers adds maps, etc.

Parameters
protoSubGriddescribes the data array and map templates to use for the granules (modulo any agg subclass changes).
addMapsif true, add's all the maps in protoSubGrid into this. if false, does not.

Definition at line 135 of file GridAggregationBase.cc.

◆ transferConstraintsToSubGridHook()

void agg_util::GridAggregateOnOuterDimension::transferConstraintsToSubGridHook ( Grid * pSubGrid)
protectedvirtual

For the data array and all maps, transfer the constraints from the super grid (ie this) to all the grids in the given prototype subgrid.

Note that this Grid has one more outer dimension than the subgrid, so the first one on this will clearly be skipped.

Parameters
pToGrid

Reimplemented from agg_util::GridAggregationBase.

Definition at line 144 of file GridAggregateOnOuterDimension.cc.

◆ transform_to_dap4()

void agg_util::GridAggregationBase::transform_to_dap4 ( libdap::D4Group * root,
libdap::Constructor * container )
overrideinherited

Definition at line 94 of file GridAggregationBase.cc.


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