Skip to content

Dp redblack#5103

Merged
LeStarch merged 9 commits intonasa:develfrom
timcanham:dp-redblack
May 6, 2026
Merged

Dp redblack#5103
LeStarch merged 9 commits intonasa:develfrom
timcanham:dp-redblack

Conversation

@timcanham
Copy link
Copy Markdown
Collaborator

Related Issue(s) Multiple
Has Unit Tests (y/n) yes
Documentation Included (y/n) partial
Generative AI was used in this contribution (y/n)

Change Description

Switches the tree data structure from the local binary tree to the F Prime Red-Black tree.

Rationale

Consolidate the data structure so we don't have to maintain or understand multiple implementations.

Testing/Review Recommendations

Unit tests pass, need to double-check them for coverage.

Future Work

Various other features once this is in place.

AI Usage (see policy)

Claude was used to update the data structure and usage, and to update unit tests.

Comment thread Svc/DpCatalog/DpCatalog.cpp Fixed
this->m_xmitInProgress = false;
return nullptr;
// Build file name based on the found entry
this->m_currXmitFileName.format(DP_FILENAME_FORMAT, this->m_directories[entry.dir].toChar(), entry.record.get_id(),
entry.record.get_tSec(), entry.record.get_tSub());
this->log_ACTIVITY_LO_SendingProduct(this->m_currXmitFileName, static_cast<U32>(entry.record.get_size()),
entry.record.get_priority());
Svc::SendFileResponse resp = this->fileOut_out(0, this->m_currXmitFileName, this->m_currXmitFileName, 0, 0);
} else {
this->m_currentNode = this->m_currentNode->parent;
}
// Get the entry
bool DpCatalog::insertEntry(DpStateEntry& entry) {
// Insert into the RedBlackTreeSet
// The tree maintains sorting by priority, time, and ID via DpStateEntry comparison operators
Fw::Success status = this->m_dpCatalog.insert(entry);
this->m_currentNode = this->m_currentNode->parent;
}
// Get the entry
entry = *iter;
this->m_currentNode = this->m_currentNode->parent;
}
// Get the entry
entry = *iter;
// start back at the top
if (this->m_currentNode == nullptr) {
this->m_currentNode = this->m_dpTree;
bool DpCatalog::findNextEntry(DpStateEntry& entry) {
Comment thread Svc/DpCatalog/DpCatalog.cpp
Comment thread Svc/DpCatalog/DpCatalog.cpp
Comment thread Svc/DpCatalog/DpCatalog.cpp
Comment thread Svc/DpCatalog/test/ut/DpCatalogTester.cpp Outdated
Comment thread Svc/DpCatalog/test/ut/DpCatalogTester.cpp
@LeStarch LeStarch requested review from LeStarch and bocchino May 5, 2026 22:58
LeStarch
LeStarch previously approved these changes May 5, 2026
@LeStarch LeStarch marked this pull request as ready for review May 5, 2026 22:59
@LeStarch
Copy link
Copy Markdown
Collaborator

LeStarch commented May 5, 2026

Note: there are some failing seeds. I am collecting them in issue #5104

bocchino
bocchino previously approved these changes May 6, 2026
Copy link
Copy Markdown
Collaborator

@bocchino bocchino left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment out the random seed initialization for tests.
@LeStarch LeStarch dismissed stale reviews from bocchino and themself via 49715a8 May 6, 2026 00:52
@bocchino bocchino self-requested a review May 6, 2026 00:52
LeStarch
LeStarch previously approved these changes May 6, 2026
Copy link
Copy Markdown
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

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

Looks good. Rescinded randomness for the time being until we fix:

#5104

bocchino
bocchino previously approved these changes May 6, 2026
Copy link
Copy Markdown
Collaborator

@bocchino bocchino left a comment

Choose a reason for hiding this comment

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

Looks good!

@LeStarch LeStarch dismissed stale reviews from bocchino and themself via 990810f May 6, 2026 00:54
@LeStarch LeStarch merged commit c08ea54 into nasa:devel May 6, 2026
54 checks passed
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.

4 participants