Class DeleteZombieComments<KeyT>

java.lang.Object
com.google.gerrit.server.DeleteZombieComments<KeyT>
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
DeleteZombieCommentsRefs

public abstract class DeleteZombieComments<KeyT> extends Object implements AutoCloseable
This class can be used to clean zombie draft comments. More context in https://gerrit-review.googlesource.com/c/gerrit/+/246233

The implementation has two cases for detecting zombie drafts:

  • An earlier bug in the deletion of draft comments caused some draft refs to remain empty but not get deleted.
  • Inspecting all draft-comments. Check for each draft if there exists a published comment with the same UUID. These comments are called zombie drafts. If the program is run in dryRun mode, the zombie draft IDs will only be logged for tracking, otherwise they will also be deleted.