Skip to content

IGNITE-19181 ConfigurationNotificationEvent API modified to include both old and new node/name values.#1883

Merged
ibessonov merged 6 commits intoapache:mainfrom
gridgain:ignite-19181
Apr 3, 2023
Merged

IGNITE-19181 ConfigurationNotificationEvent API modified to include both old and new node/name values.#1883
ibessonov merged 6 commits intoapache:mainfrom
gridgain:ignite-19181

Conversation

@ibessonov
Copy link
Contributor

…oth old and new node/name values.

Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
* @param viewClass Configuration interface, for example {@code RootView.class}.
* @param <T> Configuration type.
*/
@Nullable <T> T oldValue(Class<T> viewClass);
Copy link
Contributor

Choose a reason for hiding this comment

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

In fact, oldValue() is a special case of this method, do you think it's worth getting rid of oldValue() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should leave the method without parameters, because unlike oldValue(FooView.class), oldValue() may return String / Integer / etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok

* @param viewClass Configuration interface, for example {@code RootView.class}.
* @param <T> Configuration type.
*/
@Nullable <T> T newValue(Class<T> viewClass);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

*/
@Nullable ConfigurationProperty<InnerNode> specificConfig() {
return config.isRemovedFromNamedList() ? null : config.specificConfigTree();
public @Nullable <T> T find(Class<T> clazz, boolean old) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe different methods? findOld and findNew ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why duplicating them? This one is good enough

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a suggestion, it seems a little clearer to read code like this (findOld, findNew) instead of a parameter. But it's up to you.

*/
Class<?> configClass() {
Class<?> polymorphicInstanceConfigType = config.polymorphicInstanceConfigType();
public @Nullable String name(Class<?> clazz, boolean old) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same

…/configuration/notifications/ConfigurationContainer.java

Co-authored-by: Kirill Tkalenko <tkalkirill@yandex.ru>
@ibessonov ibessonov merged commit 3043bec into apache:main Apr 3, 2023
@ibessonov ibessonov deleted the ignite-19181 branch April 3, 2023 12:30
lowka pushed a commit to gridgain/apache-ignite-3 that referenced this pull request Apr 19, 2023
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