Skip to content

Conversation

eubnara
Copy link
Contributor

@eubnara eubnara commented Feb 26, 2025

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
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