Package com.google.gerrit.server.notedb
Class DeleteZombieCommentsRefs
java.lang.Object
com.google.gerrit.server.DeleteZombieComments<org.eclipse.jgit.lib.Ref>
com.google.gerrit.server.notedb.DeleteZombieCommentsRefs
- All Implemented Interfaces:
AutoCloseable
This class can be used to clean zombie draft comments from NoteDB.
See DeleteZombieComments
for more info.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.gerrit.server.DeleteZombieComments
dryRun
-
Constructor Summary
ConstructorsConstructorDescriptionDeleteZombieCommentsRefs
(AllUsersName allUsers, GitRepositoryManager repoManager, Integer cleanupPercentage, Consumer<String> uiConsumer) DeleteZombieCommentsRefs
(Integer cleanupPercentage, boolean dryRun, GitRepositoryManager repoManager, AllUsersName allUsers, DraftCommentsReader draftCommentsReader, ChangeNotes.Factory changeNotesFactory, CommentsUtil commentsUtil, ChangeUpdate.Factory changeUpdateFactory, IdentifiedUser.GenericFactory userFactory) DeleteZombieCommentsRefs
(Integer cleanupPercentage, GitRepositoryManager repoManager, AllUsersName allUsers, DraftCommentsReader draftCommentsReader, ChangeNotes.Factory changeNotesFactory, CommentsUtil commentsUtil, ChangeUpdate.Factory changeUpdateFactory, IdentifiedUser.GenericFactory userFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
deleteEmptyDraftsByKey
(Collection<org.eclipse.jgit.lib.Ref> refs) An earlier bug in the deletion of draft commentsrefs/draft-comments/$change_id_short/$change_id/$user_id
caused some draft refs to remain in Git and not get deleted.protected void
deleteZombieDrafts
(com.google.common.collect.ListMultimap<org.eclipse.jgit.lib.Ref, HumanComment> drafts) protected Account.Id
getAccountId
(org.eclipse.jgit.lib.Ref ref) protected Change.Id
getChangeId
(org.eclipse.jgit.lib.Ref ref) protected List<org.eclipse.jgit.lib.Ref>
protected List<org.eclipse.jgit.lib.Ref>
protected String
loggable
(org.eclipse.jgit.lib.Ref ref) void
setup()
Methods inherited from class com.google.gerrit.server.DeleteZombieComments
execute, getChangeNotes, listDraftCommentsThatAreAlsoPublished, logInfo
-
Constructor Details
-
DeleteZombieCommentsRefs
public DeleteZombieCommentsRefs(Integer cleanupPercentage, GitRepositoryManager repoManager, AllUsersName allUsers, DraftCommentsReader draftCommentsReader, ChangeNotes.Factory changeNotesFactory, CommentsUtil commentsUtil, ChangeUpdate.Factory changeUpdateFactory, IdentifiedUser.GenericFactory userFactory) -
DeleteZombieCommentsRefs
public DeleteZombieCommentsRefs(Integer cleanupPercentage, boolean dryRun, GitRepositoryManager repoManager, AllUsersName allUsers, DraftCommentsReader draftCommentsReader, ChangeNotes.Factory changeNotesFactory, CommentsUtil commentsUtil, ChangeUpdate.Factory changeUpdateFactory, IdentifiedUser.GenericFactory userFactory) -
DeleteZombieCommentsRefs
public DeleteZombieCommentsRefs(AllUsersName allUsers, GitRepositoryManager repoManager, Integer cleanupPercentage, Consumer<String> uiConsumer)
-
-
Method Details
-
setup
- Specified by:
setup
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
- Throws:
IOException
-
listAllDrafts
- Specified by:
listAllDrafts
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
- Throws:
IOException
-
listEmptyDrafts
- Specified by:
listEmptyDrafts
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
- Throws:
IOException
-
deleteEmptyDraftsByKey
An earlier bug in the deletion of draft commentsrefs/draft-comments/$change_id_short/$change_id/$user_id
caused some draft refs to remain in Git and not get deleted. These refs point to an empty tree. We delete such refs.- Specified by:
deleteEmptyDraftsByKey
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
- Throws:
IOException
-
deleteZombieDrafts
protected void deleteZombieDrafts(com.google.common.collect.ListMultimap<org.eclipse.jgit.lib.Ref, HumanComment> drafts) throws IOException- Specified by:
deleteZombieDrafts
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
- Throws:
IOException
-
getChangeId
- Specified by:
getChangeId
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
-
getAccountId
- Specified by:
getAccountId
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
-
loggable
- Specified by:
loggable
in classDeleteZombieComments<org.eclipse.jgit.lib.Ref>
-