From 8c5457bfa5b9b3241c592404bb42f4037fee3ab7 Mon Sep 17 00:00:00 2001 From: Samuel Lloyd Date: Tue, 13 Jan 2026 12:35:56 -0700 Subject: [PATCH 01/10] added alt_access(), build errors --- dispatch/BESRequestHandlerList.cc | 3 +- modules/dmrpp_module/DmrppRequestHandler.cc | 4 ++- .../ngap_container/NgapOwnedContainer.cc | 33 +++++++++++++++++-- .../ngap_container/NgapOwnedContainer.h | 1 + 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/dispatch/BESRequestHandlerList.cc b/dispatch/BESRequestHandlerList.cc index 1537ac9b74..b9fd79811a 100644 --- a/dispatch/BESRequestHandlerList.cc +++ b/dispatch/BESRequestHandlerList.cc @@ -240,7 +240,8 @@ void BESRequestHandlerList::execute_current(BESDataHandlerInterface &dhi) { // expensive, even when the container is intelligently written (DMR++ documents // can be many megabytes in size). Fix this mess so that get_container_type() // works without all of the handlers calling access() twice. jhrg 2/18/25 - dhi.container->access(); + // temporary disable to see what breaks SBL - 12.20.25 + // dhi.container->access(); // Given the kind of thing in the DHI's container (netcdf file, ...) find the // RequestHandler that understands that and then find the method in that handler diff --git a/modules/dmrpp_module/DmrppRequestHandler.cc b/modules/dmrpp_module/DmrppRequestHandler.cc index 2dbc73db0c..fee7318e3a 100644 --- a/modules/dmrpp_module/DmrppRequestHandler.cc +++ b/modules/dmrpp_module/DmrppRequestHandler.cc @@ -80,6 +80,7 @@ using namespace bes; using namespace http; using namespace libdap; using namespace std; +using namespace ngap; // These should be set in the Makefile.am. jhrg 11/23/24 #ifndef MODULE_NAME @@ -323,6 +324,7 @@ catch (...) { */ void DmrppRequestHandler::get_dmrpp_from_container_or_cache(BESContainer *container, DMR *dmr) { try { + auto ngo_cont = dynamic_cast(container); // If the container is an NGAP container (or maybe other types in the future), // the DMR++ itself might be returned as a string by access(). If the container // did not come from the NGAP handler, the return value might be a string that @@ -339,7 +341,7 @@ void DmrppRequestHandler::get_dmrpp_from_container_or_cache(BESContainer *contai DmrppTypeFactory factory(dmz); dmr->set_factory(&factory); - string dmrpp_content = container->access(); + string dmrpp_content = ngo_cont->alt_access(); dmz->parse_xml_string(dmrpp_content); diff --git a/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc b/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc index 5b90362860..9981b79bac 100644 --- a/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc +++ b/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc @@ -570,7 +570,9 @@ bool NgapOwnedContainer::get_dmrpp_from_cache_or_remote_source(string &dmrpp_str * @throws BESError if there is a problem making the remote request */ string NgapOwnedContainer::access() { - +#if 0 + // changed function to only set the container type, SBL 1.13.26 + // ticket: https://bugs.earthdata.nasa.gov/browse/HYRAX-1670 string dmrpp_string; // Get the DMR++ from the S3 bucket or the cache. @@ -579,13 +581,40 @@ string NgapOwnedContainer::access() { get_dmrpp_from_cache_or_remote_source(dmrpp_string); set_attributes("as-string"); // This means access() returns a string. jhrg 10/19/23 +#endif // Originally, this was either hard-coded (as it is now) or was set using the 'extension' // on the URL. But it's always a DMR++. jhrg 11/16/23 set_container_type("dmrpp"); - return dmrpp_string; + return ""; } +/** + * @brief alternate version of ::access() that get the DMR++ + * + * @note alternate version of ::access() that retrieve the dmrpp data, + * used in the RequestHandler + * + * @return The DMR++ as a string. + * @throws BESError if there is a problem making the remote request + */ +string NgapOwnedContainer::alt_access() { + string dmrpp_string; + + // Get the DMR++ from the S3 bucket or the cache. + // get_dmrpp...() returns false for various caching errors, but throws if it cannot + // get the remote DMR++. jhrg 4/29/24 + get_dmrpp_from_cache_or_remote_source(dmrpp_string); + + set_attributes("as-string"); // This means access() returns a string. jhrg 10/19/23 + + // Originally, this was either hard-coded (as it is now) or was set using the 'extension' + // on the URL. But it's always a DMR++. jhrg 11/16/23 + set_container_type("dmrpp"); + + return dmrpp_string; + } + /** @brief dumps information about this object * * Displays the pointer value of this instance along with information about diff --git a/modules/dmrpp_module/ngap_container/NgapOwnedContainer.h b/modules/dmrpp_module/ngap_container/NgapOwnedContainer.h index 3be72acd60..0da283ee9d 100644 --- a/modules/dmrpp_module/ngap_container/NgapOwnedContainer.h +++ b/modules/dmrpp_module/ngap_container/NgapOwnedContainer.h @@ -137,6 +137,7 @@ class NgapOwnedContainer: public BESContainer { static std::string get_data_source_location() { return d_data_source_location; } std::string access() override; + std::string alt_access(); bool release() override { return true; From 5784b9d955b8b007ae8ef3ecc3d735aeead3b1db Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 13 Jan 2026 17:01:04 -0700 Subject: [PATCH 02/10] Fix for the link of build_dmrpp_h4 and the dmrpp_module.so --- modules/dmrpp_module/Makefile.am | 8 ++++---- modules/dmrpp_module/build_dmrpp_h4/Makefile.am | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/dmrpp_module/Makefile.am b/modules/dmrpp_module/Makefile.am index 4ee7d73031..333f770d92 100644 --- a/modules/dmrpp_module/Makefile.am +++ b/modules/dmrpp_module/Makefile.am @@ -73,10 +73,10 @@ h5common.h: Makefile build_dmrpp_CPPFLAGS = $(AM_CPPFLAGS) $(H5_CPPFLAGS) -I$(top_srcdir)/modules/hdf5_handler build_dmrpp_SOURCES = $(BES_SRCS) $(BES_HDRS) DmrppRequestHandler.cc DmrppRequestHandler.h \ build_dmrpp.cc build_dmrpp_util.cc build_dmrpp_util.h h5common.cc h5common.h -build_dmrpp_LDFLAGS = $(top_builddir)/dap/.libs/libdap_module.a -build_dmrpp_LDADD = $(BES_DISPATCH_LIB) $(BES_HTTP_LIB) $(H5_LDFLAGS) \ - $(H5_LIBS) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) \ - $(XML2_LIBS) $(BYTESWAP_LIBS) -lz +build_dmrpp_LDFLAGS = +build_dmrpp_LDADD = $(top_builddir)/dap/.libs/libdap_module.a -L$(builddir)/ngap_container -lngap \ +$(BES_DISPATCH_LIB) $(BES_HTTP_LIB) $(H5_LDFLAGS) $(H5_LIBS) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) \ +$(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) $(XML2_LIBS) $(BYTESWAP_LIBS) -lz # jhrg 6/2/23 $(BES_EXTRA_LIBS) diff --git a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am index 6b52380ee3..f6afd4609a 100644 --- a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am +++ b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am @@ -50,8 +50,9 @@ build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAG # jhrg 12/18/23 $(top_builddir)/dap/.libs/libdap_module.a -build_dmrpp_h4_LDADD = $(BES_DISPATCH_LIB) $(BES_HTTP_LIB) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) \ - $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) $(XML2_LIBS) $(BYTESWAP_LIBS) $(HDFEOS2_LIBS) $(HDF4_LIBS) +build_dmrpp_h4_LDADD = -L$(builddir)/../ngap_container -lngap $(BES_DISPATCH_LIB) $(BES_HTTP_LIB) \ +$(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) $(XML2_LIBS) $(BYTESWAP_LIBS) \ +$(HDFEOS2_LIBS) $(HDF4_LIBS) lib_besdir=$(libdir)/bes From fabe3fc1af5ec39e4244ba7ddfabd346bb4ddcc6 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 13 Jan 2026 17:09:19 -0700 Subject: [PATCH 03/10] Minor cleanup and build order tweak. --- modules/dmrpp_module/Makefile.am | 2 +- modules/dmrpp_module/build_dmrpp_h4/Makefile.am | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/modules/dmrpp_module/Makefile.am b/modules/dmrpp_module/Makefile.am index 333f770d92..cfbbe28a40 100644 --- a/modules/dmrpp_module/Makefile.am +++ b/modules/dmrpp_module/Makefile.am @@ -30,7 +30,7 @@ CXXFLAGS_DEBUG = -g3 -O0 -Wall -W -Wcast-align AM_LDFLAGS = include $(top_srcdir)/coverage.mk -SUBDIRS = ngap_container dmrpp_transmitter build_dmrpp_h4 . unit-tests tests data tests_build_dmrpp get_dmrpp +SUBDIRS = ngap_container dmrpp_transmitter . build_dmrpp_h4 unit-tests tests data tests_build_dmrpp get_dmrpp lib_besdir=$(libdir)/bes lib_bes_LTLIBRARIES = libdmrpp_module.la diff --git a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am index f6afd4609a..408f7a1289 100644 --- a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am +++ b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am @@ -22,11 +22,6 @@ AM_CXXFLAGS= AM_LDFLAGS = include $(top_srcdir)/coverage.mk -# SUBDIRS = . unit-tests tests - -# These tests will fail if the DmrApiTest also fails: tests jhrg 6/29/23 - -#noinst_PROGRAMS = build_dmrpp_h4 bin_PROGRAMS = build_dmrpp_h4 build_dmrpp_h4_SOURCES = $(SRC) $(HDR) @@ -48,21 +43,12 @@ build_dmrpp_h4_CPPFLAGS = $(AM_CPPFLAGS) #build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDFEOS2_LIBS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAGS) build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAGS) -# jhrg 12/18/23 $(top_builddir)/dap/.libs/libdap_module.a - build_dmrpp_h4_LDADD = -L$(builddir)/../ngap_container -lngap $(BES_DISPATCH_LIB) $(BES_HTTP_LIB) \ $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) $(XML2_LIBS) $(BYTESWAP_LIBS) \ $(HDFEOS2_LIBS) $(HDF4_LIBS) lib_besdir=$(libdir)/bes -# lib_bes_LTLIBRARIES = libcmr_module.la - -# libcmr_module_la_SOURCES = $(CMR_SRC) $(CMR_HDR) -# libcmr_module_la_LDFLAGS = -avoid-version -module -# libcmr_module_la_LIBADD = $(LIBADD) - - EXTRA_DIST = get_dmrpp_h4 CLEANFILES = *~ From 1a4c69505c21b865318929fa90c0f1f06d466684 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 13 Jan 2026 17:27:51 -0700 Subject: [PATCH 04/10] I removed the doble build of the DMR++ type classes I also added a ticket (HYRAX-1987) to address the larger issue regarding how the module's code is built. --- .../dmrpp_module/build_dmrpp_h4/Makefile.am | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am index 408f7a1289..6ddd3245ed 100644 --- a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am +++ b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am @@ -26,26 +26,22 @@ bin_PROGRAMS = build_dmrpp_h4 build_dmrpp_h4_SOURCES = $(SRC) $(HDR) -SRC = build_dmrpp_h4.cc build_dmrpp_util_h4.cc ../Chunk.cc ../DMRpp.cc ../DMZ.cc ../DmrppArray.cc ../DmrppByte.cc ../DmrppCommon.cc \ - ../DmrppD4Enum.cc ../DmrppD4Group.cc ../DmrppD4Opaque.cc ../DmrppD4Sequence.cc ../DmrppFloat32.cc ../DmrppFloat64.cc \ - ../DmrppInt16.cc ../DmrppInt32.cc ../DmrppInt64.cc ../DmrppInt8.cc ../DmrppStr.cc ../DmrppStructure.cc \ - ../DmrppTypeFactory.cc ../DmrppUInt16.cc ../DmrppUInt32.cc ../DmrppUInt64.cc ../DmrppUrl.cc ../SuperChunk.cc \ - ../DmrppRequestHandler.cc ../CurlHandlePool.cc ../vlsa_util.cc ../float_byteswap.cc - -HDR = build_dmrpp_util_h4.h ../Chunk.h ../DMRpp.h ../DMZ.h ../DmrppArray.h ../DmrppByte.h ../DmrppCommon.h \ - ../DmrppD4Enum.h ../DmrppD4Group.h ../DmrppD4Opaque.h ../DmrppD4Sequence.h ../DmrppFloat32.h ../DmrppFloat64.h \ - ../DmrppInt16.h ../DmrppInt32.h ../DmrppInt64.h ../DmrppInt8.h ../DmrppStr.h ../DmrppStructure.h \ - ../DmrppTypeFactory.h ../DmrppUInt16.h ../DmrppUInt32.h ../DmrppUInt64.h ../DmrppUrl.h ../SuperChunk.h \ - ../DmrppRequestHandler.h ../CurlHandlePool.h ../vlsa_util.h ../byteswap_compat.h ../float_byteswap.h +SRC = build_dmrpp_h4.cc build_dmrpp_util_h4.cc + +HDR = build_dmrpp_util_h4.h build_dmrpp_h4_CPPFLAGS = $(AM_CPPFLAGS) -#build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDFEOS2_LIBS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAGS) build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAGS) -build_dmrpp_h4_LDADD = -L$(builddir)/../ngap_container -lngap $(BES_DISPATCH_LIB) $(BES_HTTP_LIB) \ -$(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) $(XML2_LIBS) $(BYTESWAP_LIBS) \ -$(HDFEOS2_LIBS) $(HDF4_LIBS) +# TODO Fix this kludge: $(builddir)/../.libs/libdmrpp_module.a. The code above in dmrpp_module +# should build the various type classes into a convenience library and then link that with +# DmrppRequestHandler and DmrppModule to make the module so file. That convenience library +# should then be used here to make build_dmrpp_h4 (and likely to make other programs). jhrg 1/13/26 + +build_dmrpp_h4_LDADD = $(builddir)/../.libs/libdmrpp_module.a -L$(builddir)/../ngap_container -lngap \ +$(BES_DISPATCH_LIB) $(BES_HTTP_LIB) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) \ +$(XML2_LIBS) $(BYTESWAP_LIBS) $(HDFEOS2_LIBS) $(HDF4_LIBS) lib_besdir=$(libdir)/bes From 9569277af2938c832f1bbfc94c215b75ff0e79f3 Mon Sep 17 00:00:00 2001 From: Samuel Lloyd Date: Tue, 20 Jan 2026 09:42:52 -0700 Subject: [PATCH 05/10] pre-master merge commit --- dispatch/BESRequestHandlerList.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispatch/BESRequestHandlerList.cc b/dispatch/BESRequestHandlerList.cc index b9fd79811a..6e99946032 100644 --- a/dispatch/BESRequestHandlerList.cc +++ b/dispatch/BESRequestHandlerList.cc @@ -241,7 +241,7 @@ void BESRequestHandlerList::execute_current(BESDataHandlerInterface &dhi) { // can be many megabytes in size). Fix this mess so that get_container_type() // works without all of the handlers calling access() twice. jhrg 2/18/25 // temporary disable to see what breaks SBL - 12.20.25 - // dhi.container->access(); + dhi.container->access(); // Given the kind of thing in the DHI's container (netcdf file, ...) find the // RequestHandler that understands that and then find the method in that handler From 7b08672865b66d3ddb4631f9ee287d8696783f92 Mon Sep 17 00:00:00 2001 From: ndp-opendap Date: Thu, 22 Jan 2026 13:13:54 -0800 Subject: [PATCH 06/10] Makefile fiddlin... --- modules/dmrpp_module/build_dmrpp_h4/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am index 6ddd3245ed..03adcc2e23 100644 --- a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am +++ b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am @@ -39,7 +39,8 @@ build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAG # DmrppRequestHandler and DmrppModule to make the module so file. That convenience library # should then be used here to make build_dmrpp_h4 (and likely to make other programs). jhrg 1/13/26 -build_dmrpp_h4_LDADD = $(builddir)/../.libs/libdmrpp_module.a -L$(builddir)/../ngap_container -lngap \ +build_dmrpp_h4_LDADD = $(top_builddir)/modules/dmrpp_module/.libs/libdmrpp_module.a \ +-L$(top_builddir)/modules/dmrpp_module/ngap_container -lngap \ $(BES_DISPATCH_LIB) $(BES_HTTP_LIB) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) \ $(XML2_LIBS) $(BYTESWAP_LIBS) $(HDFEOS2_LIBS) $(HDF4_LIBS) From f18c13511d09180f1ad081b122b316528adcd728 Mon Sep 17 00:00:00 2001 From: Samuel Lloyd Date: Fri, 23 Jan 2026 14:23:56 -0700 Subject: [PATCH 07/10] pre-master merge --- modules/dmrpp_module/Makefile.am | 2 +- modules/dmrpp_module/build_dmrpp_h4/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/dmrpp_module/Makefile.am b/modules/dmrpp_module/Makefile.am index cfbbe28a40..c27b26093c 100644 --- a/modules/dmrpp_module/Makefile.am +++ b/modules/dmrpp_module/Makefile.am @@ -56,7 +56,7 @@ DMRPP_MODULE = DmrppModule.cc DmrppRequestHandler.cc DmrppModule.h DmrppRequestH libdmrpp_module_la_SOURCES = $(BES_HDRS) $(BES_SRCS) $(DMRPP_MODULE) libdmrpp_module_la_LDFLAGS = -avoid-version -module libdmrpp_module_la_LIBADD = -L$(builddir)/ngap_container -lngap $(BES_DISPATCH_LIB) \ - $(BES_HTTP_LIB) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) \ + $(BES_HTTP_LIB) $(BES_DAP_LIB) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) \ $(H5_LDFLAGS) $(H5_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) -ltest-types \ -Ldmrpp_transmitter -ldmrpp_return_as diff --git a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am index 03adcc2e23..8e880817c1 100644 --- a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am +++ b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am @@ -41,8 +41,8 @@ build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAG build_dmrpp_h4_LDADD = $(top_builddir)/modules/dmrpp_module/.libs/libdmrpp_module.a \ -L$(top_builddir)/modules/dmrpp_module/ngap_container -lngap \ -$(BES_DISPATCH_LIB) $(BES_HTTP_LIB) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) \ -$(XML2_LIBS) $(BYTESWAP_LIBS) $(HDFEOS2_LIBS) $(HDF4_LIBS) +$(BES_DISPATCH_LIB) $(BES_DAP_LIB) $(BES_HTTP_LIB) $(DAP_SERVER_LIBS) $(DAP_CLIENT_LIBS) $(OPENSSL_LDFLAGS) \ +$(OPENSSL_LIBS) $(XML2_LIBS) $(BYTESWAP_LIBS) $(HDFEOS2_LIBS) $(HDF4_LIBS) lib_besdir=$(libdir)/bes From bc1012fecb27e580caec95e17cdbe434f578fdb2 Mon Sep 17 00:00:00 2001 From: Samuel Lloyd Date: Tue, 27 Jan 2026 09:15:25 -0700 Subject: [PATCH 08/10] ngapcontainer unit test --- .../unit-tests/NgapOwnedContainerTest.cc | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc b/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc index 36a77b95b6..a5df3755f1 100644 --- a/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc +++ b/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc @@ -305,6 +305,26 @@ class NgapOwnedContainerTest: public CppUnit::TestFixture { container.set_data_source_location(TEST_DATA_LOCATION); string dmrpp = container.access(); + // .access() changed to only set the container type, SBL 1.23.26 + // DBG2(cerr << "DMR++: " << dmrpp << '\n'); + // CPPUNIT_ASSERT_MESSAGE("The DMR++ should be in the string", !dmrpp.empty()); + + // string attrs = container.get_attributes(); + // CPPUNIT_ASSERT_MESSAGE("The container attributes should be 'as-string'", attrs == "as-string"); + + CPPUNIT_ASSERT_MESSAGE("The container type should be 'dmrpp'", container.get_container_type() == "dmrpp"); + } + + void test_alt_access() { + TEST_NAME; + + NgapOwnedContainer container; + // The REST path will become data/d_int.h5 + container.set_real_name("collections/data/granules/d_int.h5"); + // Set the location of the data as a file:// URL for this test. + container.set_data_source_location(TEST_DATA_LOCATION); + + string dmrpp = container.alt_access(); DBG2(cerr << "DMR++: " << dmrpp << '\n'); CPPUNIT_ASSERT_MESSAGE("The DMR++ should be in the string", !dmrpp.empty()); @@ -423,6 +443,7 @@ class NgapOwnedContainerTest: public CppUnit::TestFixture { CPPUNIT_TEST(test_get_dmrpp_from_cache_or_remote_source_test_cache_use); CPPUNIT_TEST(test_access); + CPPUNIT_TEST(test_alt_access); CPPUNIT_TEST(test_access_s3); CPPUNIT_TEST(test_filter_response_injects_s3_data_urls); From f991a68a267f7e25261f5f0acd12795f9a68d2a0 Mon Sep 17 00:00:00 2001 From: Samuel Lloyd Date: Mon, 2 Feb 2026 07:59:47 -0700 Subject: [PATCH 09/10] test fix --- .../ngap_container/unit-tests/NgapOwnedContainerTest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc b/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc index a5df3755f1..efe59a8d39 100644 --- a/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc +++ b/modules/dmrpp_module/ngap_container/unit-tests/NgapOwnedContainerTest.cc @@ -358,7 +358,7 @@ class NgapOwnedContainerTest: public CppUnit::TestFixture { container.set_data_source_location(DMRPP_TEST_BUCKET_OPENDAP_AWS); string dmrpp; // = container.access(); - CPPUNIT_ASSERT_NO_THROW_MESSAGE("This should not throw an exception", dmrpp = container.access()); + CPPUNIT_ASSERT_NO_THROW_MESSAGE("This should not throw an exception", dmrpp = container.alt_access()); DBG2(cerr << "DMR++: " << dmrpp << '\n'); CPPUNIT_ASSERT_MESSAGE("The response should not be empty", !dmrpp.empty()); string dmrpp_str = R"(dmrpp:href="https://s3.amazonaws.com/cloudydap/ngap_owned/d_int.h5")"; From 722a3bd111d9c8f4c48f09d2b2c2ee71e825ce21 Mon Sep 17 00:00:00 2001 From: Samuel Lloyd Date: Mon, 2 Feb 2026 11:47:07 -0700 Subject: [PATCH 10/10] code clean up --- dispatch/BESRequestHandlerList.cc | 4 +++- modules/dmrpp_module/build_dmrpp_h4/Makefile.am | 7 +++---- .../ngap_container/NgapOwnedContainer.cc | 12 ------------ 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/dispatch/BESRequestHandlerList.cc b/dispatch/BESRequestHandlerList.cc index 6e99946032..fa7dd7c46b 100644 --- a/dispatch/BESRequestHandlerList.cc +++ b/dispatch/BESRequestHandlerList.cc @@ -240,7 +240,9 @@ void BESRequestHandlerList::execute_current(BESDataHandlerInterface &dhi) { // expensive, even when the container is intelligently written (DMR++ documents // can be many megabytes in size). Fix this mess so that get_container_type() // works without all of the handlers calling access() twice. jhrg 2/18/25 - // temporary disable to see what breaks SBL - 12.20.25 + // SBL 1.31.26 - Update: NgapOwnedContainer::access() now just sets the container type + // and does not return the dmrpp string, which is handled in NgapOwnedContainer::alt_access() + // all other container access fcts remain the same dhi.container->access(); // Given the kind of thing in the DHI's container (netcdf file, ...) find the diff --git a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am index 8e880817c1..b67c070160 100644 --- a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am +++ b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am @@ -34,10 +34,9 @@ build_dmrpp_h4_CPPFLAGS = $(AM_CPPFLAGS) build_dmrpp_h4_LDFLAGS = $(HDFEOS2_LDFLAGS) $(HDF4_LDFLAGS) $(BES_DAP_LIB_LDFLAGS) -# TODO Fix this kludge: $(builddir)/../.libs/libdmrpp_module.a. The code above in dmrpp_module -# should build the various type classes into a convenience library and then link that with -# DmrppRequestHandler and DmrppModule to make the module so file. That convenience library -# should then be used here to make build_dmrpp_h4 (and likely to make other programs). jhrg 1/13/26 +# The code in dmrpp_module now builds a convenience library that is then linked +# with the DmrppRequestHandler and DmrppModule classes to make the module. That convenience library +# is also used to make standalone programs like build_dmrpp_h4. SBL & JHRG 2.2.26 build_dmrpp_h4_LDADD = $(top_builddir)/modules/dmrpp_module/.libs/libdmrpp_module.a \ -L$(top_builddir)/modules/dmrpp_module/ngap_container -lngap \ diff --git a/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc b/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc index 9981b79bac..0270599e40 100644 --- a/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc +++ b/modules/dmrpp_module/ngap_container/NgapOwnedContainer.cc @@ -570,18 +570,6 @@ bool NgapOwnedContainer::get_dmrpp_from_cache_or_remote_source(string &dmrpp_str * @throws BESError if there is a problem making the remote request */ string NgapOwnedContainer::access() { -#if 0 - // changed function to only set the container type, SBL 1.13.26 - // ticket: https://bugs.earthdata.nasa.gov/browse/HYRAX-1670 - string dmrpp_string; - - // Get the DMR++ from the S3 bucket or the cache. - // get_dmrpp...() returns false for various caching errors, but throws if it cannot - // get the remote DMR++. jhrg 4/29/24 - get_dmrpp_from_cache_or_remote_source(dmrpp_string); - - set_attributes("as-string"); // This means access() returns a string. jhrg 10/19/23 -#endif // Originally, this was either hard-coded (as it is now) or was set using the 'extension' // on the URL. But it's always a DMR++. jhrg 11/16/23 set_container_type("dmrpp");