Skip to content

NIFI-12107 Fixed sorting in the cluster table#7923

Closed
paulettehc wants to merge 1 commit intoapache:mainfrom
paulettehc:nifi-12107
Closed

NIFI-12107 Fixed sorting in the cluster table#7923
paulettehc wants to merge 1 commit intoapache:mainfrom
paulettehc:nifi-12107

Conversation

@paulettehc
Copy link
Copy Markdown
Contributor

@paulettehc paulettehc commented Oct 23, 2023

Summary

NIFI-12107 Fixed sorting of the following columns in the cluster table:

  • NODES
    • Last Heartbeat: now sorts by date
  • SYSTEM
    • Cores, Total Threads and Daemon Threads: previously did not sort at all
  • JVM
    • Heap Utilization: now sorts numerically
    • Uptime: previously did not sort at all
  • FLOWFILE STORAGE
    • Utilization: now sorts numerically
  • CONTENT STORAGE
    • Utilization: now sorts numerically
  • PROVENANCE STORAGE
    • Total Space, Used Space, Free Space, and Utilization: now sort numerically
  • VERSIONS
    • NiFi Version and Java Version: now sort numerically

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@paulettehc paulettehc force-pushed the nifi-12107 branch 2 times, most recently from c789076 to ee034ee Compare October 25, 2023 20:07
@paulettehc paulettehc marked this pull request as ready for review October 25, 2023 20:07
Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for working on this issue @paulettehc. I noted a couple questions related to the column identifier references.

// defines a function for sorting
var comparer = function (a, b) {
if (sortDetails.columnId === 'heartbeat' || sortDetails.columnId === 'uptime') {
if (sortDetails.columnId === 'heartbeat' || sortDetails.columnId === 'nodeStartTime') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change to nodeStartTime appears to be incorrect since nodeStartTime is a field value not an id value. Should that part of the conditional be removed since the uptime ID is being compared later on using the duration comparison?

var aNode = formatNodeAddress(a);
var bNode = formatNodeAddress(b);
return aNode === bNode ? 0 : aNode > bNode ? 1 : -1;
} else if (sortDetails.columnId === 'version' || sortDetails.columnId === 'javaVersion') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The field id is javaversion all lowercase, versus the field value, which is javaVersion, so it looks like this needs to be changed.

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.

Thanks for reviewing! If you look at line 1454, the columnId is set to the field vs the id. All of the columns in line 835, which has not been changed, also use the field value.

Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for the clarification on the columnId @paulettehc, that makes sense. The changes look good! +1 merging

exceptionfactory pushed a commit that referenced this pull request Nov 13, 2023
This closes #7923

Signed-off-by: David Handermann <exceptionfactory@apache.org>
(cherry picked from commit 93d373f)
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