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

Do not prompt for node name twice #11668

Merged
merged 1 commit into from Jul 8, 2015
Merged

Conversation

@jaymode
Copy link
Member

jaymode commented Jun 15, 2015

We allow setting the node's name a few different ways: the name system
property, the setting name, and the setting node.name. There is an order
of preference to these settings that gets applied will copy values from the
system property or node.name setting to the name setting. When setting
only node.name to one of the prompt placeholders, the user would be
prompted twice as the value of node.name is copied to name prior to
prompting for input. Additionally, the value entered by the user for node.name
would not be used and only the value entered for name would be used.

This fix changes the behavior to only prompt once when node.name is set and
name is not set. This is accomplished by waiting until all values have been
prompted and replaced, then the logic for determining the node's name is
executed.

Closes #11564

@clintongormley clintongormley changed the title do not prompt for node name twice Do not prompt for node name twice Jun 17, 2015
@djschny

This comment has been minimized.

Copy link
Contributor

djschny commented Jun 29, 2015

Should the javadocs about __prompt__ be updated to match the end chosen ${prompt.text} while at it with this change?

@jaymode

This comment has been minimized.

Copy link
Member Author

jaymode commented Jun 30, 2015

@djschny I pushed another commit that cleaned up the javadocs

@djschny

This comment has been minimized.

Copy link
Contributor

djschny commented Jun 30, 2015

I pulled and built this branch and then tested and it worked. LGTM, thanks for fixing this.

djschny:elasticsearch-2.0.0-SNAPSHOT djschny$ bin/elasticsearch --node.name="$\{prompt.text}"
Enter value for [node.name]: success
[2015-06-30 10:36:14,767][INFO ][node                     ] [success] version[2.0.0-SNAPSHOT], pid[1345], build[634769a/2015-06-30T14:30:00Z]
[2015-06-30 10:36:14,768][INFO ][node                     ] [success] initializing ...
[2015-06-30 10:36:14,774][INFO ][plugins                  ] [success] loaded [], sites []
[2015-06-30 10:36:14,915][INFO ][env                      ] [success] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [118.9gb], net total_space [464.7gb], spins? [unknown], types [hfs]
[2015-06-30 10:36:17,663][INFO ][node                     ] [success] initialized
[2015-06-30 10:36:17,664][INFO ][node                     ] [success] starting ...
[2015-06-30 10:36:17,813][INFO ][transport                ] [success] bound_address {inet[/127.0.0.1:9300]}, publish_address {inet[/127.0.0.1:9300]}
[2015-06-30 10:36:17,839][INFO ][discovery                ] [success] elasticsearch/RX2qVD1HQyuHp74Glt4iag
[2015-06-30 10:36:21,635][INFO ][cluster.service          ] [success] new_master [success][RX2qVD1HQyuHp74Glt4iag][djschny][inet[/127.0.0.1:9300]], reason: zen-disco-join (elected_as_master)
[2015-06-30 10:36:21,679][INFO ][http                     ] [success] bound_address {inet[/127.0.0.1:9200]}, publish_address {inet[/127.0.0.1:9200]}
[2015-06-30 10:36:21,679][INFO ][node                     ] [success] started
[2015-06-30 10:36:21,700][INFO ][gateway                  ] [success] recovered [0] indices into cluster_state
@jpountz

This comment has been minimized.

Copy link
Contributor

jpountz commented Jul 8, 2015

LGTM

We allow setting the node's name a few different ways: the `name` system
property, the setting `name`, and the setting `node.name`. There is an order
of preference to these settings that gets applied, which can copy values from the
system property or `node.name` setting to the `name` setting. When setting
only `node.name` to one of the prompt placeholders, the user would be
prompted twice as the value of `node.name` is copied to `name` prior to
prompting for input. Additionally, the value entered by the user for `node.name`
would not be used and only the value entered for `name` would be used.

This fix changes the behavior to only prompt once when `node.name is set` and
`name` is not set. This is accomplished by waiting until all values have been
prompted and replaced, then the logic for determining the node's name is
executed.

Closes #11564
@jaymode jaymode force-pushed the jaymode:node_name_prompt branch to ae1ed34 Jul 8, 2015
@jaymode jaymode merged commit ae1ed34 into elastic:master Jul 8, 2015
1 check passed
1 check passed
CLA Commit author has signed the CLA
Details
@kevinkluge kevinkluge removed the review label Jul 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.