bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
#include <AggregationUtil.h>
Public Types | |
typedef std::vector< const libdap::DDS * > | ConstDDSList |
Public Member Functions | |
template<class LibdapType> | |
LibdapType * | findTypedVariableAtDDSTopLevel (const libdap::DDS &dds, const string &name) |
Static Public Member Functions | |
static bool | addCopyOfVariableIfNameIsAvailable (libdap::DDS *pOutDDS, const libdap::BaseType &varProto, bool add_at_top=false) |
static void | addDatasetArrayDataToAggregationOutputArray (libdap::Array &oOutputArray, unsigned int atIndex, const libdap::Array &constrainedTemplateArray, const string &varName, AggMemberDataset &dataset, const ArrayGetterInterface &arrayGetter, const string &debugChannel) |
static void | addOrReplaceVariableForName (libdap::DDS *pOutDDS, const libdap::BaseType &varProto) |
static unsigned int | collectVariableArraysInOrder (std::vector< libdap::Array * > &varArrays, const std::string &collectVarName, const ConstDDSList &datasetsInOrder) |
static bool | couldBeCoordinateVariable (libdap::BaseType *pBT) |
static bool | doShapesMatch (const libdap::Array &lhs, const libdap::Array &rhs, bool checkDimNames) |
static bool | doTypesMatch (const libdap::Array &lhs, const libdap::Array &rhs) |
static bool | findAttribute (const libdap::AttrTable &inTable, const string &name, libdap::AttrTable::Attr_iter &attr) |
static const libdap::Array * | findMapByName (const libdap::Grid &inGrid, const std::string &findName) |
template<class LibdapType> | |
static LibdapType * | findTypedVariableAtDDSTopLevel (const libdap::DDS &dds, const string &name) |
static libdap::BaseType * | findVariableAtDDSTopLevel (const libdap::DDS &dds, const string &name) |
static void | gatherMetadataChangesFrom (libdap::BaseType *pIntoVar, const libdap::BaseType &fromVar) |
static libdap::Array * | getAsArrayIfPossible (libdap::BaseType *pBT) |
static libdap::BaseType * | getVariableNoRecurse (const libdap::Constructor &varContainer, const std::string &name) |
static libdap::BaseType * | getVariableNoRecurse (const libdap::DDS &dds, const std::string &name) |
static void | performUnionAggregation (libdap::DDS *pOutputUnion, const ConstDDSList &datasetsInOrder) |
static void | printConstraints (std::ostream &os, const libdap::Array &fromArray) |
static void | printConstraintsToDebugChannel (const std::string &debugChannel, const libdap::Array &fromArray) |
static void | printDimensions (std::ostream &os, const libdap::Array &fromArray) |
static libdap::Array * | readDatasetArrayDataForAggregation (const libdap::Array &constrainedTemplateArray, const std::string &varName, AggMemberDataset &dataset, const ArrayGetterInterface &arrayGetter, const std::string &debugChannel) |
static void | resetCVInsertionPosition () |
static void | transferArrayConstraints (libdap::Array *pToArray, const libdap::Array &fromArray, bool skipFirstFromDim, bool skipFirstToDim, bool printDebug=false, const std::string &debugChannel="agg_util") |
static void | unionAllVariablesInto (libdap::DDS *pOutputUnion, const ConstDDSList &datasetsInOrder) |
static void | unionAllVariablesInto (libdap::DDS *pOutputUnion, const libdap::DDS &fromDDS, bool add_at_top=false) |
static void | unionAttrsInto (libdap::AttrTable *pOut, const libdap::AttrTable &fromTable) |
static bool | validateArrayTypesAndShapesMatch (const std::vector< libdap::Array * > &arrays, bool enforceMatchingDimNames) |
A static class for encapsulating the aggregation functionality on libdap. This class should have references to libdap and STL, but should NOT contain any references to other ncml_module classes. This will allow us to potentially package the aggregation functionality into its own lib or perhaps roll it into libdap.
Definition at line 164 of file AggregationUtil.h.
typedef std::vector<const libdap::DDS*> agg_util::AggregationUtil::ConstDDSList |
Definition at line 179 of file AggregationUtil.h.
|
static |
If a variable does not exist within pOutDDS (top level) with the same name as varProto, then place a clone of varProto (using virtual ctor ptr_duplicate) into pOutDDS.
Definition at line 420 of file AggregationUtil.cc.
|
static |
Load the given dataset's DDS. Find the aggVar of the given name in it, must be Array. Transfer the constraints from the local template to it. Call read() on it. Stream the data into oOutputArray's output buffer at the element index nextElementIndex.
oOutputArray | the Array to output the data into |
atIndex | where in the output buffer of rOutputArray to stream it (note: not byte, element!) |
constrainedTemplateArray | the Array to use as the template for the constraints on loading the dataset. |
name | the name of the aggVar to find in the DDS |
dataset | the dataset to load for this element. |
arrayGetter | the class to use to get the member Array by name from DDS |
debugChannel | if not empty(), BESDEBUG channel to use |
Definition at line 928 of file AggregationUtil.cc.
|
static |
If a variable with the name varProto.name() doesn't exist, add a copy of varProto to pOutDDS. If the variable already exists, REPLACE it with a copy of varProto.
pOutDDS | the DDS to change |
varProto | prototype to clone and add to pOutDDS. |
Definition at line 452 of file AggregationUtil.cc.
|
static |
Fill in varArrays with Array's named collectVarName from each DDS in datasetsInOrder, in that order. In other words, the ordering found in datasetsInOrder will be preserved in varArrays.
varArrays | the array to push the found variables onto. Will NOT be cleared, so can be added to. |
collectVarName | the name of the variable to find at top level DDS in datasetsInOrder |
datasetsInOrder | the datasets to search for the Array's within. |
Definition at line 600 of file AggregationUtil.cc.
|
static |
Definition at line 618 of file AggregationUtil.cc.
|
static |
Do the lhs and rhs have the same shapes? Only use size for dimension compares unless checkDimNames
Definition at line 575 of file AggregationUtil.cc.
|
static |
Do the lhs and rhs have the same data type?
Definition at line 567 of file AggregationUtil.cc.
|
static |
Lookup the attribute with given name in inTable and place a reference in attr.
Definition at line 375 of file AggregationUtil.cc.
|
static |
Find the given map name in the given Grid and return it if found, else NULL
Definition at line 863 of file AggregationUtil.cc.
LibdapType * agg_util::AggregationUtil::findTypedVariableAtDDSTopLevel | ( | const libdap::DDS & | dds, |
const string & | name ) |
Definition at line 484 of file AggregationUtil.cc.
|
static |
Template wrapper for findVariableAtDDSTopLevel() which does the find but only return non-NULL if the found BaseType* can be dynamically cast to template type LibdapType.
dds | the dds to search |
name | the name of the variable to find |
|
static |
Find a variable with name at the top level of the DDS. Do not recurse. DDS::var() will look inside containers, so we can't use that.
Definition at line 466 of file AggregationUtil.cc.
|
static |
Union fromVar's AttrTable (initially) with pIntoVar's AttrTable and replace pIntoVar's AttrTable with this union. Essentially uses fromVar's AttrTable as a set of changes to pIntoVar's table.
pIntoVar | the var whose AttrTable is the output |
fromVar | the var to use as changes to the output |
Definition at line 944 of file AggregationUtil.cc.
|
static |
If pBT is an Array type, cast and return it as the Array. If pBT is a Grid type, return the data Array field. Otherwise, return NULL.
pBT | the variable to adapt |
Definition at line 835 of file AggregationUtil.cc.
|
static |
Return the variable in dds top level (no recursing, no fully qualified name dot notation) if it exists, else 0. The name IS ALLOWED to contain a dot '.', but this is interpreted as PART OF THE NAME and not as a field separator!
Definition at line 817 of file AggregationUtil.cc.
|
static |
Return the variable in dds top level (no recursing, no fully qualified name dot notation) if it exists, else 0. The name IS ALLOWED to contain a dot '.', but this is interpreted as PART OF THE NAME and not as a field separator!
Definition at line 797 of file AggregationUtil.cc.
|
static |
Perform an NCML-type union aggregation on the datasets in datasetsInOrder into pOutputUnion. The first named instance of a variable or attribute in a forward iteration of datasetsInOrder ends up in pOutputUnion. Not that named containers are considered as a unit, so we do not recurse into their children.
Definition at line 305 of file AggregationUtil.cc.
|
static |
Stream out the current constraints for all the dimensions in the Array.
os | the output stream |
fromArray | the array whose dimensions to print. |
Definition at line 715 of file AggregationUtil.cc.
|
static |
Output using BESDEBUG to the debugChannel channel. Prints the constraints on the dimensions of fromArray.
debugChannel | name of the output channel |
fromArray | the Array whose constraints should be printed to the debugChannel |
Definition at line 733 of file AggregationUtil.cc.
|
static |
Print out the dimensions name and size for the given Array into os
Definition at line 699 of file AggregationUtil.cc.
|
static |
Read the data that akes up one 'slice' of an aggregation. This method is used by addDatasetArrayDataToAggregationOutputArray() which calls it and then transfers the data from the DAP Array that holds the slice's data to the result (another DAP Array that will eventually hold the entire collection of slices in a single array). It is also used by specialized versions of serialize() so that data can be read and written 'slice by slice' avoiding the latency of reading in all of the data before transmission starts along with the storage overhead of holding all of the data in memory at one time.
constrainedTemplateArray | |
varName | |
dataset | |
arrayGetter | |
debugChannel |
Definition at line 878 of file AggregationUtil.cc.
|
static |
Used to reset the class field that tracks where Coordinate Variables (CVs) have been inserted into the DDS. This helps ensure that the CVs appear in the order they were listed in the .ncml file.
Definition at line 414 of file AggregationUtil.cc.
|
static |
Copy the constraints from the from Array into the pToArray in Dim_iter order.
if skipFirstFromDim, the first dimension of fromArray will be skipped, for the case of copying from a joinNew aggregated array to a granule subset array
if skipFirstToDim the first dimension of toArray will be skipped, for the case where presumably both first dims are skipped for a joinExisting aggregation where constraints on outer dim will be calculated by the caller.
pToArray | array to put constraints into |
fromArray | array to take constraints from |
skipFirstFromDim | whether the first dim of fromArray is aggregated and should be skipped. |
skipFirstToDim | whether the first dim of toArray is aggregated and should be skipped. |
Definition at line 741 of file AggregationUtil.cc.
|
static |
For each variable within the top level of each dataset in datasetsInOrder (forward iteration) add a clone of it to pOutputUnion if a variable with the same name does not exist in pOutputUnion yet.
Definition at line 382 of file AggregationUtil.cc.
|
static |
For each variable in fromDDS top level, union it into pOutputUnion if a variable with the same name isn't already there
Definition at line 391 of file AggregationUtil.cc.
|
static |
Merge any attributes in tableToMerge whose names do not already exist within *pOut into pOut.
pOut | the table to merge into. On exit it will contain its previous contents plus any new attributes from fromTable |
fromTable |
Definition at line 333 of file AggregationUtil.cc.
|
static |
Scan all the arrays in arrays using the first as a template and make sure that they all have the same data type and they all have the same dimensions. (NOTE: we only use the sizes to validate dimensions, not the "name", unless enforceMatchingDimNames is set)
Definition at line 544 of file AggregationUtil.cc.