Skip to content

Conversation

@DennisHeimbigner
Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner commented Dec 13, 2025

Regularize, cleanup, and refactor various AWS features

Ready for review.

Primary Change(s)

  • Refactor to move the AWS constants and code to new files: daws.c and ncaws.h.
  • Provide macro constants for all sources for AWS key values; the possible sources and prefix names are as follows:
Source Macro Prefix
.rc file keys AWS_RC_XXX
.aws profiles AWS_PROF_XXX
getenv() Variables AWS_ENV_XXX
URL fragment keys AWS_FRAG_XXX
URL note keys AWS_NOTE_XXX

Notes:

  • The macros are in include/ncaws.h
  • Some previous macros in other files have been removed.

Secondary changes

  1. Convert NCglobalstate.chunkcache to struct from previous pointer to struct. This entails a number of small changes to handle the change.

DennisHeimbigner and others added 30 commits September 20, 2025 13:42
Provide macro constants for all sources for AWS key values.
The possible sources and prefix names are as follows:

| Source             | Macro Prefix |
|--------------------|--------------|
| getenv() Variables | AWS_ENV_XXX |
| .rc file keys      | AWS_RC_XXX  |
| .aws profiles      | AWS_PROF_XXX|
| URL fragment keys  | AWS_FRAG_XXX|

* The macros are in include/ncs3sdk.h.
* Some previous macros in other files have been removed.
Provide macro constants for all sources for AWS key values.
The possible sources and prefix names are as follows:

| Source             | Macro Prefix |
|--------------------|--------------|
| getenv() Variables | AWS_ENV_XXX |
| .rc file keys      | AWS_RC_XXX  |
| .aws profiles      | AWS_PROF_XXX|
| URL fragment keys  | AWS_FRAG_XXX|

* The macros are in include/ncs3sdk.h.
* Some previous macros in other files have been removed.
DennisHeimbigner and others added 16 commits October 16, 2025 11:45
Begin the consolidation of global state into two files: libdispatch/dglobal.c and include/ncglobal.h.

## Primary Changes
* New files: include/ncglobal.h and libdispatch/dglobal.c.
* Refactor NCglobalstate decls from nc4internal.h to ncglobal.h.
* Refactor NCglobalstate implementation from nc4internal.c and ddispatch.c to dglobal.c.
* Replace/augment ``#include "nc4internal.h"`` with ``#include "ncglobal.h"``.
* Refactor ChunkCache implementation from nc4internal.c to dglobal.c.
    * Side effect: clear chunkcache using memset.

## Secondary Changes
* Modify ncs3sdk.h to define new macros for a variety of AWS keys for environment variables, .aws/config profile keys, AWS-related .ncrc keys, and AWS URI fragment keys.
    * Side effect: replace old macros and in-line string constants with the new macros. Changes primarily in libdispatch/ds3util.c and libdispatch/ncs3sdk_h5.c.
* Fix a  problem in some tests in nczarr_test: modify cp, unzip and gunzip to remove target before overwriting.
* Fix minor bug in libdap4/d4meta.c
* Fix minor bug in plugins/H5Zshuffle.c.
* Modify nclog to ensure that error log messages always get printed irrespective of the logging state.
<!--
Required Branch Pre-cursors
1. s3forward.dmh
2. ncdumpfixes.dmh
3. s3global.dmh
-->

## Primary Change(s)

* Refactor to move the AWS constants and code to new files: daws.c and ncaws.h.
* Provide macro constants for all sources for AWS key values; the possible sources and prefix names are as follows:

| Source             | Macro Prefix |
|--------------------|--------------|
| .rc file keys      | AWS_RC_XXX   |
| .aws profiles      | AWS_PROF_XXX |
| getenv() Variables | AWS_ENV_XXX  |
| URL fragment keys  | AWS_FRAG_XXX |
| URL note keys      | AWS_NOTE_XXX |

Notes:
* The macros are in include/ncaws.h
* Some previous macros in other files have been removed.

## Secondary changes
1. Convert NCglobalstate.chunkcache to struct from previous pointer to struct. This entails a number of small changes to handle the change.
@DennisHeimbigner DennisHeimbigner marked this pull request as ready for review December 22, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant