Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Fix RunnerBuilder method names #1284

Merged

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented Apr 15, 2019

PR description

I noticed the method name RunnerBuilder.discoveryPort is inaccurate because it actually defines the listening port for both wire-level tcp connections and discovery-level udp messages. Updated this method name to be more generic. And also ported discoveryHost for symmetry.

.discoveryHost(discoveryHost)
.discoveryPort(discoveryPort)
.advertisedHost(discoveryHost)
.listenPort(discoveryPort)
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 weird to have the names mismatching here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, thats weird :) . Updated the variable names. Also updated the description of the corresponding options.

return this;
}

public RunnerBuilder discoveryPort(final int listenPort) {
public RunnerBuilder listenPort(final int listenPort) {
Copy link
Contributor

Choose a reason for hiding this comment

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

listenPort feels too generic here. I wonder if these should be p2pAdvertisedHost and p2pListenPort? A bigger refactoring would be to make an actual P2pConfiguration object to match JsonRpcConfiguration and friends but that's probably scope creep on what you were working on. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the names. We do have a NetworkingConfiguration object, although it's probably due for some cleanup.

@@ -239,14 +239,14 @@ void setBootnodes(final List<String> values) {
@Option(
names = {"--p2p-host"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
description = "Host for P2P peer discovery to listen on (default: ${DEFAULT-VALUE})",
description = "Ip address this node advertises to its peers (default: ${DEFAULT-VALUE})",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fyi @PegaSysEng/pliny - I'm updating the CLI descriptions here and below. Let me know if you see any issues.

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM.

@mbaxter mbaxter merged commit 6eb231f into PegaSysEng:master Apr 17, 2019
notlesh pushed a commit to notlesh/pantheon that referenced this pull request Apr 24, 2019
notlesh pushed a commit to notlesh/pantheon that referenced this pull request May 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants