Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Will-Lo
Copy link
Contributor

@Will-Lo Will-Lo commented Apr 21, 2023

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

  • Here are some details about my PR, including screenshots (if applicable):

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

DatasetCleaner.this.finishCleanSignal.get().countDown();
LOG.info("Successfully cleaned: " + dataset.datasetURN());
DatasetRetentionSummary summary = new DatasetRetentionSummary(dataset.datasetURN(), datasetsDeleted, true);
Copy link
Contributor

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?

Comment on lines +32 to 34
* 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.
Copy link
Contributor

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

Comment on lines +29 to +30
private final int versionsSelectedForDeletion;
private final boolean successfullyDeleted;
Copy link
Contributor

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 {
Copy link
Contributor

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

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.

2 participants