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

SOLR-11617 rename alias metadata as alias properties #335

Closed
wants to merge 2 commits into from

Conversation

nsoft
Copy link
Contributor

@nsoft nsoft commented Mar 10, 2018

Renamed the usage in the API and made the code match where I could to avoid confusion in the future.

@@ -35,7 +35,7 @@

public class ModifyAliasCmd implements Cmd {
Copy link
Contributor

@dsmiley dsmiley Mar 10, 2018

Choose a reason for hiding this comment

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

Rename to "SetAliasPropCmd"?

"&wt=xml" +
"&name=" + aliasName +
"&metadata.foo=baz" +
"&metadata.bar=bam");
"&properties.foo=baz" +
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want the V1 API prefix for this to be "property" since each param occurrence is one property by itself. This is consistent with various other V1 APIs (See CollectionApiMapping.java search for "property"). (My comment here applies to many spots in the diff, not just here of course).

Copy link

Choose a reason for hiding this comment

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

I tend to like dot notation to be nounish things. A set of things collectively know as "properties" with member element ".foo" rather than an adjective "property" describing ".foo"

      "properties" : {
        "foo": "baz",
        "bar": "bam"
        }

vs

      "property" : {
        "foo": "baz",
        "bar": "bam"
      }

The v1 api flattening should match what we do for v2 I think?

Copy link
Contributor

Choose a reason for hiding this comment

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

What you have for V2 (a JSON API) — “properties” is good. I’m directing my feedback expressly at V1 for “property”, which is a param prefix, not JSON. Again, see the existing APIs like core properties which already set this precedent.

@@ -750,36 +750,38 @@ http://localhost:8983/solr/admin/collections?action=LISTALIASES&wt=xml
----

[[modifyalias]]
Copy link
Contributor

Choose a reason for hiding this comment

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

"modifyalias" here is now incorrect; should be "ALIASPROP". This would affect some of the examples below too.

@@ -124,7 +124,7 @@ protected TimeRoutedAliasUpdateProcessor(SolrQueryRequest req, SolrQueryResponse
cmdDistrib = new SolrCmdDistributor(cc.getUpdateShardHandler());
collHandler = cc.getCollectionsHandler();

final Map<String, String> aliasMetadata = zkController.getZkStateReader().getAliases().getCollectionAliasMetadata(aliasName);
final Map<String, String> aliasMetadata = zkController.getZkStateReader().getAliases().getCollectionAliasProperties(aliasName);
Copy link
Contributor

Choose a reason for hiding this comment

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

it'd be nice to also rename aliasMetada to aliasProperties

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

Nice renames... almost there.

@fsparv
Copy link

fsparv commented Mar 12, 2018

Added another commit addressing comments

@ctargett
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-11617 was released in Solr 7.3, so this PR can be closed.

@ctargett ctargett closed this Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants