-
Notifications
You must be signed in to change notification settings - Fork 266
Conversation
Fixes #352 |
val keepers = versions.takeRight(versionsToKeep).toSet | ||
versions | ||
.filter(keepers.contains(_)) | ||
.foreach(deleteVersion(_)) |
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.
isn't this going to drop versions to keep?
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.
Don't you want filterNot(keepers)? (note set extends function so that is legit.
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.
True, good catch -- Also do we actually need cleanup? I don't see it called.
Looks great! Thanks for porting this! |
You are right. The HDFSState never writes that a job is running to prevent two from running at the same time. That would be really nice: try to create a file, and if that file is more recent than a threshold (to prevent a crash from deadlocking us), we stop in prepare. Else, we have created a file, and then we go on. We didn't handle that yet: |
@johnynek Looking at how we were using this, there's no locking/state written out. Does it need it/do we have it somewhere else?