Skip to content

[BEAM-2963] Preliminary refactors to PackageUtil#3920

Merged
asfgit merged 3 commits intoapache:masterfrom
kennknowles:PackageUtil
Oct 6, 2017
Merged

[BEAM-2963] Preliminary refactors to PackageUtil#3920
asfgit merged 3 commits intoapache:masterfrom
kennknowles:PackageUtil

Conversation

@kennknowles
Copy link
Member

@kennknowles kennknowles commented Sep 29, 2017

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

These are some basic refactors to give PackageUtil a little TLC, making it more usable and re-usable.

@kennknowles kennknowles changed the title Package util [BEAM-2963] Preliminary refactors to PackageUtil Sep 29, 2017
@kennknowles
Copy link
Member Author

kennknowles commented Sep 29, 2017

R: @tgroh since I know you are looking at artifact-related things. This may or may not actually be interesting to you.

It is probably easiest to review one commit at a time.

@kennknowles kennknowles force-pushed the PackageUtil branch 3 times, most recently from 4b30b9c to 2eb6794 Compare September 30, 2017 13:56
@kennknowles
Copy link
Member Author

The tests all passed, then timeout occurred while building Python. I've bumped the timeout and will retest, but FYI this is g2g.

@kennknowles
Copy link
Member Author

run precommit pipeline java

@kennknowles
Copy link
Member Author

retest this please

}
}

private StagingResult stagePackageBlithely(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I really really like this name, I fear that it doesn't communicate what it does sufficiently precisely, given standard java jargon

throw e;
} else {
LOG.warn(
"Upload attempt failed, sleeping before retrying staging of classpath: {}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'staging of package'

}
}));
for (String classpathElement : classpathElements) {
DataflowPackage sourcePackage = new DataflowPackage();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the creation + value migration worth factoring into its own method?

}
}

private StagingResult stagePackageBlithely(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I really like this name, I don't think it communicates why this is so blithe in standard java Jargon.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions? I settled on this suffix some while ago for lack of a better option.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Crashily"?

Copy link
Member Author

@kennknowles kennknowles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL

throw e;
} else {
LOG.warn(
"Upload attempt failed, sleeping before retrying staging of classpath: {}",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tgroh wrote:
'staging of package'

Done.

}
}));
for (String classpathElement : classpathElements) {
DataflowPackage sourcePackage = new DataflowPackage();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tgroh wrote:
Is the creation + value migration worth factoring into its own method?

TBH this should be moved out to the command line parsing. It has no place here. For now I'd rather leave it as-is (this bit is a code move)

}
}

private StagingResult stagePackageBlithely(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kennknowles wrote:
"Crashily"?

Done. Split into tryStagePackage which is trivial straight-line code, tryStagePackageWithRetries that does just that loop, crashing if it hits something unrecoverable, and stagePackageSynchronously that just decorates the error message.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 69.588% when pulling f630545 on kennknowles:PackageUtil into 7db0f13 on apache:master.

@kennknowles
Copy link
Member Author

run dataflow validatesrunner

@kennknowles
Copy link
Member Author

We've seen a couple jobs run, since the basic presubmit does that, but I'll wait to see a lot of jobs run, since if this breaks it is very bad.

@kennknowles
Copy link
Member Author

All the jobs in the ValidatesRunner suite succeeded. It timed out in dependency analysis. Filed BEAM-3024.

@asfgit asfgit merged commit 58b6453 into apache:master Oct 6, 2017
asfgit pushed a commit that referenced this pull request Oct 6, 2017
  Refactor PackageUtil for more and simpler asynchrony
  Use AutoValue for Dataflow PackageAttributes
  Make PackageUtil a proper class encapsulating its ExecutorService
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 69.604% when pulling 58b6453 on kennknowles:PackageUtil into 31da49c on apache:master.

@kennknowles kennknowles deleted the PackageUtil branch April 25, 2018 02:10
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.

4 participants