Skip to content

HPCC-36100 Implement directoryFiles for Azure Blob and Files classes#21188

Closed
jackdelv wants to merge 4 commits intohpcc-systems:candidate-10.0.xfrom
jackdelv:use-api-to-get-directory-contents
Closed

HPCC-36100 Implement directoryFiles for Azure Blob and Files classes#21188
jackdelv wants to merge 4 commits intohpcc-systems:candidate-10.0.xfrom
jackdelv:use-api-to-get-directory-contents

Conversation

@jackdelv
Copy link
Copy Markdown
Contributor

@jackdelv jackdelv commented Apr 8, 2026

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@jackdelv jackdelv requested a review from ghalliday April 8, 2026 16:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21188 - HPCC-36100 Implement directoryFiles for Azure Blob and Files classes
Base Branch: candidate-10.0.x
Test Time: 2026-04-08 16:13:36 UTC

✅ Successful Branches (2)

  • candidate-10.2.x
  • master
    This comment was automatically generated by the upmerge test workflow.

Copy link
Copy Markdown
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First view looks good. A few minor comments and questions.

// Subclass creates the appropriate IFile (AzureBlob or AzureFile) for the given path
virtual IFile *createFile(const char *fullPath, const DirEntry &entry) = 0;

bool matchesMask(const char *name) const { return !mask.length() || WildMatch(name, mask, false); }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: Use mask.isEmpty() rather than !mask.length(). Calling length() will perform a strlen(), isEmpty will only check the first character. Possibly worth having a member variable isFiltered which can be set up once.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to isEmpty()

}
}
const DirEntry &entry = items[itemIndex];
curName.set(entry.name.c_str());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid cloning these values - cloning the names could be quite expensive. The others are not so significant, but worth avoiding. Could have a function like this to simplify the calling code.

inline const DirEntry & queryCurEntry() const { return items[itemIndex]; }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove cloned member variables.

ListBlobsOptions options;
if (!prefix.empty())
options.Prefix = prefix;
pagedResponse.emplace(containerClient->ListBlobsByHierarchy("/", options));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For heirarchical namespaces does this return all files in all subdirectories, or only direct subfiles?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only returns direct subfiles

Comment thread common/remote/hooks/azure/azureblob.cpp Outdated

IFile * AzureBlobDirectoryIterator::createFile(const char *fullPath, const DirEntry &entry)
{
AzureBlob *file = static_cast<AzureBlob *>(createAzureBlob(fullPath));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be cleaner as a constructor for AzureBlob which was also passed a DirEntry? It does not need to be exported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so. Added a constructor overload that calls setListedInfo.

@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21188 - HPCC-36100 Implement directoryFiles for Azure Blob and Files classes
Base Branch: candidate-10.0.x
Test Time: 2026-04-23 18:22:01 UTC

✅ Successful Branches (3)

  • candidate-10.2.x
  • candidate-10.4.x
  • master
    This comment was automatically generated by the upmerge test workflow.

@jackdelv jackdelv requested a review from ghalliday April 23, 2026 18:23
@ghalliday ghalliday closed this May 6, 2026
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.

2 participants