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 2021/11/29 03:59:02 UTC

[GitHub] [solr] gerlowskija opened a new pull request #433: SOLR-15747: Convert /node v2 APIs to annotations

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


   # Description
   
   Solr currently implements its v2 APIs using a mix of two frameworks: a JSON 'apispec' file approach, and a more modern annotation-based approach.  Solr's in the process of aligning on the annotation-based option.
   
   # Solution
   
   This commit moves that alignment forward by converting the v2 /node APIs to the annotation framework.
   
   # Tests
   
   None (yet).
   
   # 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.
   - [ ] I have run `./gradlew check`.
   - [ ] 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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/api/ApiRegistrar.java
##########
@@ -19,6 +19,8 @@
 
 import org.apache.solr.api.ApiBag;
 import org.apache.solr.handler.admin.CollectionsHandler;
+import org.apache.solr.handler.admin.CoreAdminHandler;
+import org.apache.solr.handler.admin.InfoHandler;
 import org.apache.solr.handler.admin.api.*;

Review comment:
       I did update my code settings, fwiw.  I guess IntelliJ only rewrites those imports that change as you edit though?  I can change this line explicitly if you care strongly, just lmk.




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/InvokeClassAPI.java
##########
@@ -0,0 +1,63 @@
+/*
+ * 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.solr.api.Command;
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.api.PayloadObj;
+import org.apache.solr.client.solrj.request.beans.InvokeClassPayload;
+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.common.params.CoreAdminParams.ACTION;
+import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.INVOKE;
+import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
+
+/**
+ * V2 API for triggering "invocable" classes.
+ *
+ * This API (POST /v2/node {'invoke': {...}}) is analogous to the v1 /admin/cores?action=INVOKE command.

Review comment:
       I'm not sure.  Prior to this PR I'd never heard of 'invoke' either.  It seems like an internal detail, but since there's no existing documentation or even comment in the Java code and this is the first I've stumbled on it, I'm a little leery to make that call here.
   
   I can do some JIRA or git-blame digging and try to find out.
   
   Either way though, I'm not sure I've got the context to even really know what to say about it in the ref-guide.  I suspect I hate that as much as you do, but the only thing worse than no-docs is wrong-docs 😬 
   
   (There's also the practical matter that if I stop to document everything I come across in the course of these API conversions, I'll never be able to finish them.)




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreApiMapping.java
##########
@@ -52,10 +48,7 @@
     REQUESTSYNCSHARD(PER_CORE_COMMANDS, POST, CoreAdminAction.REQUESTSYNCSHARD, "request-sync-shard", null),
     REQUESTBUFFERUPDATES(PER_CORE_COMMANDS, POST, CoreAdminAction.REQUESTBUFFERUPDATES, "request-buffer-updates", null),
     REQUESTAPPLYUPDATES(PER_CORE_COMMANDS, POST, CoreAdminAction.REQUESTAPPLYUPDATES, "request-apply-updates", null),
-    REQUESTSTATUS(PER_CORE_COMMANDS, GET, CoreAdminAction.REQUESTSTATUS, "request-status", null),/*TODO*/
-    OVERSEEROP(NODEAPIS, POST, CoreAdminAction.OVERSEEROP, "overseer-op", null),
-    REJOINLEADERELECTION(NODEAPIS, POST, CoreAdminAction.REJOINLEADERELECTION, "rejoin-leader-election", null),
-    INVOKE(NODEINVOKE, GET, CoreAdminAction.INVOKE,"invoke",  null);
+    REQUESTSTATUS(PER_CORE_COMMANDS, GET, CoreAdminAction.REQUESTSTATUS, "request-status", null)/*TODO*/;

Review comment:
       this isn't related to this PR, but I wonder what TODO here means???




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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


   Just added some tests in `V2NodeAPIMappingTest`, fwiw


-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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


   I guess there are no unit tests because the existing ones all work, that this is just a under the covers change?  


-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreApiMapping.java
##########
@@ -52,10 +48,7 @@
     REQUESTSYNCSHARD(PER_CORE_COMMANDS, POST, CoreAdminAction.REQUESTSYNCSHARD, "request-sync-shard", null),
     REQUESTBUFFERUPDATES(PER_CORE_COMMANDS, POST, CoreAdminAction.REQUESTBUFFERUPDATES, "request-buffer-updates", null),
     REQUESTAPPLYUPDATES(PER_CORE_COMMANDS, POST, CoreAdminAction.REQUESTAPPLYUPDATES, "request-apply-updates", null),
-    REQUESTSTATUS(PER_CORE_COMMANDS, GET, CoreAdminAction.REQUESTSTATUS, "request-status", null),/*TODO*/
-    OVERSEEROP(NODEAPIS, POST, CoreAdminAction.OVERSEEROP, "overseer-op", null),
-    REJOINLEADERELECTION(NODEAPIS, POST, CoreAdminAction.REJOINLEADERELECTION, "rejoin-leader-election", null),
-    INVOKE(NODEINVOKE, GET, CoreAdminAction.INVOKE,"invoke",  null);
+    REQUESTSTATUS(PER_CORE_COMMANDS, GET, CoreAdminAction.REQUESTSTATUS, "request-status", null)/*TODO*/;

Review comment:
       Idk - wish someone had left a note on that TODO 🙁 




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
##########
@@ -150,11 +156,6 @@ public SolrRequestHandler getSubHandler(String subPath) {
 
   @Override
   public Collection<Api> getApis() {
-    return singletonList(new ReqHandlerToApi(this, getSpec("node.Info")));
-  }
-
-  @Override
-  public Boolean registerV2() {
-    return Boolean.TRUE;
+    return Collections.emptyList();

Review comment:
       why is this a empty list?    Do we even need getApis???




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/NodeLoggingAPI.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.solr.api.EndPoint;
+import org.apache.solr.handler.admin.LoggingHandler;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
+import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_EDIT_PERM;
+
+/**
+ * V2 API for getting or setting log levels on an individual node.

Review comment:
       Should you reference the JIRA about using the VERB's to decide on getting versus setting?




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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


   


-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/InvokeClassAPI.java
##########
@@ -0,0 +1,63 @@
+/*
+ * 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.solr.api.Command;
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.api.PayloadObj;
+import org.apache.solr.client.solrj.request.beans.InvokeClassPayload;
+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.common.params.CoreAdminParams.ACTION;
+import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.INVOKE;
+import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
+
+/**
+ * V2 API for triggering "invocable" classes.
+ *
+ * This API (POST /v2/node {'invoke': {...}}) is analogous to the v1 /admin/cores?action=INVOKE command.

Review comment:
       Umm, https://solr.apache.org/guide/8_9/coreadmin-api.html doesn't mention INVOKE.....    Is that something we need to add to the ref guide?   Or is it some low level "end users don't touch it code"?    I wonder if end users aren't meant to touch it, maybe we put those under /v2/node/internal/???       And lastly, is there a chance we can get rid of whatever INVOKE does?
   
   




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
##########
@@ -150,11 +156,6 @@ public SolrRequestHandler getSubHandler(String subPath) {
 
   @Override
   public Collection<Api> getApis() {
-    return singletonList(new ReqHandlerToApi(this, getSpec("node.Info")));
-  }
-
-  @Override
-  public Boolean registerV2() {
-    return Boolean.TRUE;
+    return Collections.emptyList();

Review comment:
       I need to look into this a little more.  I _think_ that this method can go away altogether here - it exists to register the v2 APIs associated with this request handler, but in this PR that registration moves over to the 'ApiRegistrar' class where other annotation-based APIs are registered.
   
   So maybe I can remove this here, but I'll need a little more digging to see.




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/NodeHealthAPI.java
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.solr.api.EndPoint;
+import org.apache.solr.handler.admin.HealthCheckHandler;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
+import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_READ_PERM;
+
+/**
+ * V2 API for checking the health of the receiving node.
+ *
+ * This API (GET /v2/node/health) is analogous to the v1 /admin/info/health.

Review comment:
       I've got the same thoughts here as I do on 'INVOKE':
   
   It's new-ish to me, I can do a bit of digging but doubt I have the context to get anything in the ref guide.




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
##########
@@ -150,11 +156,6 @@ public SolrRequestHandler getSubHandler(String subPath) {
 
   @Override
   public Collection<Api> getApis() {
-    return singletonList(new ReqHandlerToApi(this, getSpec("node.Info")));
-  }
-
-  @Override
-  public Boolean registerV2() {
-    return Boolean.TRUE;
+    return Collections.emptyList();

Review comment:
       I've spent a bit of time trying to understand the `ApiSupport` interface and the `getApis` method here, and now think my initial take here was wrong.
   
   `getApis` preexists `ApiRegistrar` and is understood implicitly in some of the data structures used to register and hold RequestHandlers (e.g. `PluginBag`).  We should probably use `getApis` where possible going forward, and reserve `ApiRegistrar` for those APIs which don't have any RequestHandler equivalent.
   
   I'll update the PR to reflect this.




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/api/ApiRegistrar.java
##########
@@ -19,6 +19,8 @@
 
 import org.apache.solr.api.ApiBag;
 import org.apache.solr.handler.admin.CollectionsHandler;
+import org.apache.solr.handler.admin.CoreAdminHandler;
+import org.apache.solr.handler.admin.InfoHandler;
 import org.apache.solr.handler.admin.api.*;

Review comment:
       usual nit pick on .*




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/InvokeClassAPI.java
##########
@@ -0,0 +1,63 @@
+/*
+ * 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.solr.api.Command;
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.api.PayloadObj;
+import org.apache.solr.client.solrj.request.beans.InvokeClassPayload;
+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.common.params.CoreAdminParams.ACTION;
+import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.INVOKE;
+import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
+
+/**
+ * V2 API for triggering "invocable" classes.
+ *
+ * This API (POST /v2/node {'invoke': {...}}) is analogous to the v1 /admin/cores?action=INVOKE command.

Review comment:
       I'm not sure.  Prior to this PR I'd never heard of 'invoke' either.  It seems like an internal detail, but since there's no existing documentation or even comment in the Java code and this is the first I've stumbled on it, I'm a little leery to make that call here.
   
   I can do some JIRA or git-blame digging and try to find out.
   
   Either way though, I'm not sure I've got the context to even really know what to say about it in the ref-guide.  I suspect I hate that as much as you do, but the only thing worse than no-docs is wrong-docs 😬 




-- 
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 #433: SOLR-15747: Convert /node v2 APIs to annotations

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



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/api/NodeLoggingAPI.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.solr.api.EndPoint;
+import org.apache.solr.handler.admin.LoggingHandler;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET;
+import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_EDIT_PERM;
+
+/**
+ * V2 API for getting or setting log levels on an individual node.

Review comment:
       Maybe? Idk.  I included a reference to it in the method-level comment below; do you think it should be mentioned here as well?

##########
File path: solr/core/src/java/org/apache/solr/handler/api/ApiRegistrar.java
##########
@@ -19,6 +19,8 @@
 
 import org.apache.solr.api.ApiBag;
 import org.apache.solr.handler.admin.CollectionsHandler;
+import org.apache.solr.handler.admin.CoreAdminHandler;
+import org.apache.solr.handler.admin.InfoHandler;
 import org.apache.solr.handler.admin.api.*;

Review comment:
       I did update my code settings!  I guess IntelliJ only rewrites those imports that change as you edit though?




-- 
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