You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/01/25 01:58:14 UTC

[GitHub] [solr] gerlowskija opened a new pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

gerlowskija opened a new pull request #565:
URL: https://github.com/apache/solr/pull/565


   This commit converts the 'reload', 'swap', 'rename', 'unload',
   'merge-indexes', and 'split' commands of `/v2/cores/<core>` over to the
   preferred framework.
   
   (NOTE: the spelling 'indexes' in the 'merge-indexes' command was
   retained here for consistency/compatibility.  We should consider
   changing it going forward.)
   
   
   # Description
   
   Solr's been in the slow process of moving its v2 APIs away from the
   existing apispec/mapping framework towards one that relies on more
   explicit annotations to specify API properties.  Many "core-admin"
   APIs remain unconverted.
   
   # Solution
   
   This commit converts the 'reload', 'swap', 'rename', 'unload',
   'merge-indexes', and 'split' commands of `/v2/cores/<core>` over to the
   preferred annotation framework.
   
   # Tests
   
   See V2CoreAPIMappingTest
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [x] I have added tests for my changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791891085



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/MergeIndexesAPI.java
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.handler.admin.api;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.solr.api.Command;
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.api.PayloadObj;
+import org.apache.solr.client.solrj.request.beans.MergeIndexesPayload;
+import org.apache.solr.common.params.CoreAdminParams;
+import org.apache.solr.common.params.UpdateParams;
+import org.apache.solr.handler.admin.CoreAdminHandler;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
+import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
+
+/**
+ * V2 API for merging one or more Solr cores into the target core.
+ *
+ * The new API (POST /v2/cores/coreName {'merge-indexes': {...}}) is equivalent to the v1
+ * /admin/cores?action=mergeindexes command.
+ *
+ * @see org.apache.solr.client.solrj.request.beans.MergeIndexesPayload
+ */
+@EndPoint(

Review comment:
       Cool!  (That's a good thing right? I _think_ they should have the same annotations, except that the path on CreateCore should be `/cores`?)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
madrob commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021636009


   Put the new ones inside, leave them old ones?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021504830


   > There are 430 results for "Indexes", and honestly, the more I think on it, I think that while "Indices" may be grammatically correct, "Indexes" is really the word we use! At any rate, only 51 "indices" in the source
   
   Well, that's another good reason to leave the spelling as-is for now.  Yikes though haha 😬 
   
   > Would it make sense to move the Payload classes into the API classes? I think that's the only place they are used?
   
   The only reason I haven't done that yet is that I have some far-off aspiration of re-using the payload classes in SolrJ as well.  It'd be really nice if each API enumerated the params it accepts in only 1 place that can be used on the server and client side alike.  (Bit more detail on this idea [here](https://issues.apache.org/jira/browse/SOLR-15187))
   
   If you feel strongly about it, I'm open to moving them inside the API classes - I don't want to design too much for a "someday" that may never come. Just lmk.  (Either way it should probably be a separate PR since there are a bazillion Payload classes and I'm only touching a few of them here.) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1022628525


   I think that's everyone's review comments, except for Eric's (totally justified) finger-wagging about my incorrect import settings, which I'm still wrestling with.
   
   I'm going to run `gradlew check` again and commit shortly.  Thanks for the review guys!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021285346


   > why not fix "indexes" spelling now?
   
   Two "soft" reasons:
   
   1. It's hard to imagine anyone caring about "indexes" in particular, but in theory I could imagine someone being unhappy at me "burying" API changes in these PRs since I typically describe them as straightforward conversions/translations.
   2. Scope creep - there's so much I'd like to see improved in these APIs that if I started going down those rabbit holes now, I'd never have a hope of finishing the conversion to the annotation framework.  (e.g. Why not make `SplitCorePayload.ranges` a `List<String>`?  Why not unify the use of 'index' and 'core' in some of these commands and property names? Why not add enum support to the annotation framework so we can use it on `SplitCorePayload.splitMethod` etc.)
   
   That said, I'd buy the argument that "indexes" is a clear spelling error, and I'd be willing to make an exception for it if you think I should @epugh ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021347102


   I thought I was "closing" a comment thread, oops.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791754028



##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -48,18 +45,21 @@
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.zookeeper.KeeperException;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.DELETE;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.PUT;
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.*;
 import static org.apache.solr.cloud.api.collections.CollectionHandlingUtils.REQUESTID;
 import static org.apache.solr.common.params.CollectionParams.ACTION;
 import static org.apache.solr.common.params.CollectionParams.CollectionAction.*;
 import static org.apache.solr.core.RateLimiterConfig.RL_CONFIG_KEY;
-import static org.apache.solr.security.PermissionNameProvider.Name.COLL_EDIT_PERM;
-import static org.apache.solr.security.PermissionNameProvider.Name.COLL_READ_PERM;
-import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_EDIT_PERM;
-import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_READ_PERM;
+import static org.apache.solr.security.PermissionNameProvider.Name.*;

Review comment:
       LIkewise

##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/MergeIndexesAPI.java
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.handler.admin.api;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.solr.api.Command;
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.api.PayloadObj;
+import org.apache.solr.client.solrj.request.beans.MergeIndexesPayload;
+import org.apache.solr.common.params.CoreAdminParams;
+import org.apache.solr.common.params.UpdateParams;
+import org.apache.solr.handler.admin.CoreAdminHandler;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
+import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
+
+/**
+ * V2 API for merging one or more Solr cores into the target core.
+ *
+ * The new API (POST /v2/cores/coreName {'merge-indexes': {...}}) is equivalent to the v1
+ * /admin/cores?action=mergeindexes command.
+ *
+ * @see org.apache.solr.client.solrj.request.beans.MergeIndexesPayload
+ */
+@EndPoint(

Review comment:
       I checked CreateCoreAPI, and this looks consistent with how that is annoated ;-)

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/MergeIndexesPayload.java
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+import java.util.List;
+
+// TODO rename all of the MergeIndexes* classes to MergeIndices.  These are only named this way for consistency.

Review comment:
       Why not do it now?   Seperate PR for naming only changes?

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Should we be doing `required = true` is other places as part of this conversion?   

##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -48,18 +45,21 @@
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.zookeeper.KeeperException;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.DELETE;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.PUT;
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.*;

Review comment:
       We need to figure out how to make our IDE's not do this!    

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SplitCorePayload.java
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+import java.util.List;
+
+public class SplitCorePayload implements ReflectMapWriter {
+    // Should be converted as an array

Review comment:
       is this a bug that we need to fix elsewhere, not in the bounds of this PR, or is this more of a wish?  Is there a SOLR- that could be referenced?

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Seems like having some validation on these would be a big win if it's built in to this style of API?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021285346


   > why not fix "indexes" spelling now?
   
   Two "soft" reasons:
   
   1. It's hard to imagine anyone caring about "indexes" in particular, but in theory I could imagine someone being unhappy at me "burying" API changes in these PRs since I typically describe them as straightforward conversions/translations.
   2. Scope creep - there's so much I'd like to see improved in these APIs that if I started going down those rabbit holes now, I'd never have a hope of finishing the conversion to the annotation framework.  (e.g. Why not make `SplitCorePayload.ranges` a `List<String>`?  Why not unify the use of 'index' and 'core' in some of these commands and property names? Why not add enum support to the annotation framework so we can use it on `SplitCorePayload.splitMethod` etc.)
   
   That said, I'd buy the argument that "indexes" is a clear spelling error, and I'd be willing to make an exception for it if you think I should @epugh ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791889412



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Yep, this enforcement is built in to the annotation-style APIs.
   
   > Should we be doing required = true is other places as part of this conversion?
   
   For sure - if there's a place where I skipped `required = true` that's actually required, absolutely lmk.  I thought I set it everywhere I should have, but it's easy to miss.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021220555






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791886377



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SplitCorePayload.java
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+import java.util.List;
+
+public class SplitCorePayload implements ReflectMapWriter {
+    // Should be converted as an array

Review comment:
       Oops - no, this isn't a bug.  This was just a "note to self" so I could remember some niggling detail while I was working on this one.  I forgot to remove it is all.  Will remove.

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Yep, this enforcement is built in to the annotation-style APIs.
   
   > Should we be doing required = true is other places as part of this conversion?
   For sure - if there's a place where I skipped `required = true` that's actually required, absolutely lmk.  I thought I set it everywhere I should have, but it's easy to miss.

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Yep, this enforcement is built in to the annotation-style APIs.
   
   > Should we be doing required = true is other places as part of this conversion?
   
   For sure - if there's a place where I skipped `required = true` that's actually required, absolutely lmk.  I thought I set it everywhere I should have, but it's easy to miss.

##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/MergeIndexesAPI.java
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.handler.admin.api;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.solr.api.Command;
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.api.PayloadObj;
+import org.apache.solr.client.solrj.request.beans.MergeIndexesPayload;
+import org.apache.solr.common.params.CoreAdminParams;
+import org.apache.solr.common.params.UpdateParams;
+import org.apache.solr.handler.admin.CoreAdminHandler;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
+import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
+
+/**
+ * V2 API for merging one or more Solr cores into the target core.
+ *
+ * The new API (POST /v2/cores/coreName {'merge-indexes': {...}}) is equivalent to the v1
+ * /admin/cores?action=mergeindexes command.
+ *
+ * @see org.apache.solr.client.solrj.request.beans.MergeIndexesPayload
+ */
+@EndPoint(

Review comment:
       Cool!  (That's a good thing right? I _think_ they should have the same annotations, except that the path on CreateCore should be `/cores`?)

##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -48,18 +45,21 @@
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.zookeeper.KeeperException;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.DELETE;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.PUT;
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.*;

Review comment:
       Agreed, sigh. I play with these IDE settings every now and then when it comes up in review, but I still see it revert from time to time.  Not sure what the deal is - I'll try playing with it a bit more.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
madrob commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021356353


   Would it make sense to move the Payload classes into the API classes? I think that's the only place they are used?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
madrob commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021356353


   Would it make sense to move the Payload classes into the API classes? I think that's the only place they are used?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh closed pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh closed pull request #565:
URL: https://github.com/apache/solr/pull/565


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791754028



##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -48,18 +45,21 @@
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.zookeeper.KeeperException;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.DELETE;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.PUT;
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.*;
 import static org.apache.solr.cloud.api.collections.CollectionHandlingUtils.REQUESTID;
 import static org.apache.solr.common.params.CollectionParams.ACTION;
 import static org.apache.solr.common.params.CollectionParams.CollectionAction.*;
 import static org.apache.solr.core.RateLimiterConfig.RL_CONFIG_KEY;
-import static org.apache.solr.security.PermissionNameProvider.Name.COLL_EDIT_PERM;
-import static org.apache.solr.security.PermissionNameProvider.Name.COLL_READ_PERM;
-import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_EDIT_PERM;
-import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_READ_PERM;
+import static org.apache.solr.security.PermissionNameProvider.Name.*;

Review comment:
       LIkewise

##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/MergeIndexesAPI.java
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.handler.admin.api;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.solr.api.Command;
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.api.PayloadObj;
+import org.apache.solr.client.solrj.request.beans.MergeIndexesPayload;
+import org.apache.solr.common.params.CoreAdminParams;
+import org.apache.solr.common.params.UpdateParams;
+import org.apache.solr.handler.admin.CoreAdminHandler;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
+import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
+
+/**
+ * V2 API for merging one or more Solr cores into the target core.
+ *
+ * The new API (POST /v2/cores/coreName {'merge-indexes': {...}}) is equivalent to the v1
+ * /admin/cores?action=mergeindexes command.
+ *
+ * @see org.apache.solr.client.solrj.request.beans.MergeIndexesPayload
+ */
+@EndPoint(

Review comment:
       I checked CreateCoreAPI, and this looks consistent with how that is annoated ;-)

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/MergeIndexesPayload.java
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+import java.util.List;
+
+// TODO rename all of the MergeIndexes* classes to MergeIndices.  These are only named this way for consistency.

Review comment:
       Why not do it now?   Seperate PR for naming only changes?

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Should we be doing `required = true` is other places as part of this conversion?   

##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -48,18 +45,21 @@
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.zookeeper.KeeperException;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.DELETE;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.PUT;
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.*;

Review comment:
       We need to figure out how to make our IDE's not do this!    

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SplitCorePayload.java
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+import java.util.List;
+
+public class SplitCorePayload implements ReflectMapWriter {
+    // Should be converted as an array

Review comment:
       is this a bug that we need to fix elsewhere, not in the bounds of this PR, or is this more of a wish?  Is there a SOLR- that could be referenced?

##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Seems like having some validation on these would be a big win if it's built in to this style of API?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791893709



##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -48,18 +45,21 @@
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.zookeeper.KeeperException;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.DELETE;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.PUT;
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.*;

Review comment:
       Agreed, sigh. I play with these IDE settings every now and then when it comes up in review, but I still see it revert from time to time.  Not sure what the deal is - I'll try playing with it a bit more.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021339537


   > > why not fix "indexes" spelling now?
   > 
   > Two "soft" reasons:
   > 
   >     1. It's hard to imagine anyone caring about "indexes" in particular, but in theory I could imagine someone being unhappy at me "burying" API changes in these PRs since I typically describe them as straightforward conversions/translations.
   > 
   >     2. Scope creep - there's so much I'd like to see improved in these APIs that if I started going down those rabbit holes now, I'd never have a hope of finishing the conversion to the annotation framework.  (e.g. Why not make `SplitCorePayload.ranges` a `List<String>`?  Why not unify the use of 'index' and 'core' in some of these commands and property names? Why not add enum support to the annotation framework so we can use it on `SplitCorePayload.splitMethod` etc.)
   > 
   > 
   > That said, I'd buy the argument that "indexes" is a clear spelling error, and I'd be willing to make an exception for it if you think I should @epugh ?
   
   There are 430 results for "Indexes", and honestly, the more I think on it, I think that while "Indices" may be grammatically correct, "Indexes" is really the word we use!   At any rate, only 51 "indices" in the source ;-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija merged pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija merged pull request #565:
URL: https://github.com/apache/solr/pull/565


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791886377



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SplitCorePayload.java
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+import java.util.List;
+
+public class SplitCorePayload implements ReflectMapWriter {
+    // Should be converted as an array

Review comment:
       Oops - no, this isn't a bug.  This was just a "note to self" so I could remember some niggling detail while I was working on this one.  I forgot to remove it is all.  Will remove.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1022613929


   > Put the new ones inside, leave the old ones?
   
   It wouldn't be my choice in a vacuum: I can live with giving up on my long-term goal of reusing these payload classes, but introducing the inconsistency for different payloads just seems like kicking me while I'm down 😛 
   
   But I guess the inconsistency is only a problem if I'm slow getting a PR together to move the other `Payload` files.  Let's go with this approach.  Feel free to bug me in a few days if I don't ping you on a PR to move the rest of the payloads @madrob 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob edited a comment on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
madrob edited a comment on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021636009


   Put the new ones inside, leave the old ones?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh closed pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh closed pull request #565:
URL: https://github.com/apache/solr/pull/565


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh commented on pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
epugh commented on pull request #565:
URL: https://github.com/apache/solr/pull/565#issuecomment-1021220555


   Since "v2" is experimental, why not fix "indexes" spelling now?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] gerlowskija commented on a change in pull request #565: SOLR-15745: Move public v2 "core-admin" APIs to annotation framework

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #565:
URL: https://github.com/apache/solr/pull/565#discussion_r791889412



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/beans/SwapCoresPayload.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.client.solrj.request.beans;
+
+import org.apache.solr.common.annotation.JsonProperty;
+import org.apache.solr.common.util.ReflectMapWriter;
+
+public class SwapCoresPayload implements ReflectMapWriter {
+    @JsonProperty(required = true)

Review comment:
       Yep, this enforcement is built in to the annotation-style APIs.
   
   > Should we be doing required = true is other places as part of this conversion?
   For sure - if there's a place where I skipped `required = true` that's actually required, absolutely lmk.  I thought I set it everywhere I should have, but it's easy to miss.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org