-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retention job summary events #3683
base: master
Are you sure you want to change the base?
Conversation
DatasetCleaner.this.finishCleanSignal.get().countDown(); | ||
LOG.info("Successfully cleaned: " + dataset.datasetURN()); | ||
DatasetRetentionSummary summary = new DatasetRetentionSummary(dataset.datasetURN(), datasetsDeleted, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it certain we'd only ever overwrite the summary, rather than potentially needing to add this new count to whatever accumulating sum was already tracked for the same dataset URN?
* Cleans the {@link CleanableDataset}. | ||
* Returns the number of versions marked for deletion | ||
* {@link org.apache.gobblin.data.management.retention.policy.RetentionPolicy} and delete files and directories that need deleting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like new line 33 cut in mid-sentence to the prior javadoc.
also, prefer a @return
tag
private final int versionsSelectedForDeletion; | ||
private final boolean successfullyDeleted; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the impl, it appeared that versionsSelectedForDeletion
is truly the total number successfully deleted. e.g. is there any way that the number selected might not equal a non-zero number successfully deleted?
if not, I suggest renaming to versionsDeleted
and reversing the boolean to hadExecutionFailure
. the latter of course discerns between 0 found to delete and >0 found, but none actually successful. calling out a tad more explicitly in javadoc seems worthwhile
@@ -34,6 +35,12 @@ static class CleanFailed { | |||
*/ | |||
static final String FAILURE_CONTEXT_METADATA_KEY = "failureContext"; | |||
} | |||
|
|||
static class RetentionJobSummary { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: RetentionEvents.JobSummary
would avoid redundant Retention
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
Tests
Commits