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

#include <ArrayAggregateOnOuterDimension.h>

Inheritance diagram for agg_util::ArrayAggregateOnOuterDimension:
Inheritance graph
Collaboration diagram for agg_util::ArrayAggregateOnOuterDimension:
Collaboration graph

Public Member Functions

 ArrayAggregateOnOuterDimension (const ArrayAggregateOnOuterDimension &proto)
 
 ArrayAggregateOnOuterDimension (const libdap::Array &proto, AMDList memberDatasets, std::unique_ptr< ArrayGetterInterface > arrayGetter, const Dimension &newDim)
 
const AMDList & getDatasetList () const
 
ArrayAggregateOnOuterDimensionoperator= (const ArrayAggregateOnOuterDimension &rhs)
 
ArrayAggregateOnOuterDimensionptr_duplicate () override
 
bool read () override
 
bool serialize (libdap::ConstraintEvaluator &eval, libdap::DDS &dds, libdap::Marshaller &m, bool ce_eval) override
 
 ~ArrayAggregateOnOuterDimension () override
 

Protected Member Functions

const ArrayGetterInterfacegetArrayGetterInterface () const
 
libdap::Array & getGranuleTemplateArray ()
 
void printConstraints (const Array &fromArray)
 
void readConstrainedGranuleArraysAndAggregateDataHook () override
 
void transferOutputConstraintsIntoGranuleTemplateHook () override
 

Detailed Description

class ArrayAggregateOnOuterDimension

Array variable which contains information for performing a joinNew (new outer dimension) aggregation of an Array variable using samples of this variable in a specified list of member datasets.

The list is specified as a list of RCPtr<AggMemberDataset>, i.e. reference-counted AggMemberDataset's (AMD). The AMD is in charge of lazy-loading it's contained DataDDS as needed as well as for only loading the required data for a read() call. In other words, read() on this subclass will respect the constraints given to the superclass Array.

Note
This class is designed to lazy-load the member datasets only if there are needed for the actual serialization at read() call time. Also note that this class specializes the BaseType::serialize() method such that data reads (from datasets and writes (to the network) are interleaved, reducing latency. In addition, the data for the response is not stored in the object; only the parts about to be serialized are even held in memory and then only until they are sent to the client. Calls to the read() method still read all of the data in to the variable's local storage so that code that depends on that behavior will still work. If all of the data are in memory, the overloaded serialize() method will call libdap::Array::serialize(), preserving the expected behavior in that case.
The member datasets might be external files or might be wrapped virtual datasets (specified in NcML) or nested aggregation's.

Definition at line 77 of file ArrayAggregateOnOuterDimension.h.

Constructor & Destructor Documentation

◆ ArrayAggregateOnOuterDimension() [1/2]

agg_util::ArrayAggregateOnOuterDimension::ArrayAggregateOnOuterDimension ( const libdap::Array & proto,
AMDList memberDatasets,
std::unique_ptr< ArrayGetterInterface > arrayGetter,
const Dimension & newDim )

Construct a joinNew Array aggregation given the parameters.

Parameters
protothe Array to use as a prototype for the UNaggregated Array (ie module the new dimension). It is the object for the aggVar as loaded from memberDatasets[0].
memberDatasetslist of the member datasets forming the aggregation. this list will be copied internally so memberDatasets may be destroyed after this call (though the element AggMemberDataset objects will be ref()'d in our copy).
arrayGettersmart ptr to the algorithm for getting out the constrained array from each individual AMDList DataDDS. Ownership transferred to this (clearly).
newDimthe new outer dimension this instance will add to the proto Array template

◆ ArrayAggregateOnOuterDimension() [2/2]

agg_util::ArrayAggregateOnOuterDimension::ArrayAggregateOnOuterDimension ( const ArrayAggregateOnOuterDimension & proto)

Construct from a copy

Definition at line 60 of file ArrayAggregateOnOuterDimension.cc.

◆ ~ArrayAggregateOnOuterDimension()

agg_util::ArrayAggregateOnOuterDimension::~ArrayAggregateOnOuterDimension ( )
override

Destroy any local memory

Definition at line 67 of file ArrayAggregateOnOuterDimension.cc.

Member Function Documentation

◆ getArrayGetterInterface()

const ArrayGetterInterface & agg_util::ArrayAggregationBase::getArrayGetterInterface ( ) const
protectedinherited

Accessor for subclasses Note this is protected, so not const! Subclasses may mutate the return hence this, but should not delete it, hence the reference.

Definition at line 168 of file ArrayAggregationBase.cc.

◆ getDatasetList()

const AMDList & agg_util::ArrayAggregationBase::getDatasetList ( ) const
inherited

Get the list of AggMemberDataset's that comprise this aggregation

Definition at line 146 of file ArrayAggregationBase.cc.

◆ getGranuleTemplateArray()

libdap::Array & agg_util::ArrayAggregationBase::getGranuleTemplateArray ( )
protectedinherited

Accessor for subclasses Note this is protected, so not const! Subclasses may mutate the return hence this, but should not delete it, hence the reference.

Definition at line 161 of file ArrayAggregationBase.cc.

◆ operator=()

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

Assign this from rhs object.

Parameters
rhsthe object to copy from
Returns
*this

Definition at line 80 of file ArrayAggregateOnOuterDimension.cc.

◆ printConstraints()

void agg_util::ArrayAggregationBase::printConstraints ( const Array & fromArray)
protectedinherited

Print out the constraints on fromArray to the debug channel

Definition at line 153 of file ArrayAggregationBase.cc.

◆ ptr_duplicate()

ArrayAggregateOnOuterDimension * agg_util::ArrayAggregateOnOuterDimension::ptr_duplicate ( )
override

Virtual Constructor: Make a deep copy (clone) of the object and return it.

Returns
ptr to the cloned object.

Definition at line 74 of file ArrayAggregateOnOuterDimension.cc.

◆ read()

bool agg_util::ArrayAggregationBase::read ( )
overrideinherited

Base implementation that works for both joinNew and joinExisting. Sets ups constraints and things and then calls the subclass helper readAndAggregateGranules() for the specialized subclass behaviors.

Note
This implementation of read() will read all of the data for an aggregated variable. Child classes of this class can use specialized versions of serialize() to implement a different behavior so that data that are read in parts (e.g. slices of an Array) can also be written in parts. This can reduce access latency.
Exceptions
Canthrow BESError, minimally
Returns
whether it works

Definition at line 101 of file ArrayAggregationBase.cc.

◆ readConstrainedGranuleArraysAndAggregateDataHook()

void agg_util::ArrayAggregateOnOuterDimension::readConstrainedGranuleArraysAndAggregateDataHook ( )
overrideprotectedvirtual

Actually go through the constraints and stream the correctly constrained data into the superclass's output buffer for serializing out.

Reimplemented from agg_util::ArrayAggregationBase.

Definition at line 243 of file ArrayAggregateOnOuterDimension.cc.

◆ serialize()

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

Specialization that implements a simple pipelining scheme. If an aggregation is made up from many 'slices' of different arrays, each will be read individually. This version sends each part as soon as it is read instead of building the entire response in memory and then sending it.

If this method is called and the variable has read_p set to true, then libdap::Array::serialize() will be called.

Note
The read() method of ArrayAggregationBase can be used to read all of the data in one shot.
Parameters
eval
dds
m
ce_eval
Returns
true

Definition at line 114 of file ArrayAggregateOnOuterDimension.cc.

◆ transferOutputConstraintsIntoGranuleTemplateHook()

void agg_util::ArrayAggregateOnOuterDimension::transferOutputConstraintsIntoGranuleTemplateHook ( )
overrideprotectedvirtual

Subclass hook for read() to copy granule constraints properly (inner dim ones).

Reimplemented from agg_util::ArrayAggregationBase.

Definition at line 226 of file ArrayAggregateOnOuterDimension.cc.


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