Skip to content

AMBARI-26312: Clean up RequestScheduleEntity and RequestScheduleBatchRequestEntity also - #3946

Open
eubnara wants to merge 1 commit into
apache:trunkfrom
eubnara:AMBARI-26312
Open

eubnara wants to merge 1 commit into
apache:trunkfrom
eubnara:AMBARI-26312

Conversation

@eubnara

@eubnara eubnara commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

If some classes implements "Cleanable", CleanupDriver will call cleanup() for those classes when administrator uses "ambari-server db-purge-history".
"requestschedule" and "requestschedulebatchrequest" tables could be cleaned up with old rows.

How was this patch tested?

manual tests on my company's cluster.

idsSubList.get(0) + " - " + idsSubList.get(idsSubList.size() - 1));
requestScheduleQuery.setParameter("scheduleIds", idsSubList);
affectedRows += requestScheduleQuery.executeUpdate();
LOG.info("Deleting RequestScheduleBatchRequest entity batch with schedule ids: " +

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.

RequestSchedule is related to RequestScheduleBatchRequest.
I guess that RequestSchedule is usually removed with RequestScheduleBatchRequest.

  @Override
  public void delete() {
    readWriteLock.writeLock().lock();
    try {
      if (isPersisted) {
        batchRequestDAO.removeByScheduleId(requestScheduleEntity.getScheduleId());
        requestScheduleDAO.remove(requestScheduleEntity);
        cluster.refresh();
        isPersisted = false;
      }
    } finally {
      readWriteLock.writeLock().unlock();
    }
  }

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