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/11/11 15:43:53 UTC

[GitHub] [solr] Jdurham2843 commented on a diff in pull request #1126: SOLR-16462: Create v2 equivalent of v1 'CREATESNAPSHOT', 'LISTSNAPSHOT' and 'DELETESNAPSHOT' (core level)

Jdurham2843 commented on code in PR #1126:
URL: https://github.com/apache/solr/pull/1126#discussion_r1020335589


##########
solr/core/src/java/org/apache/solr/handler/admin/api/CoreAdminAPIBase.java:
##########
@@ -0,0 +1,210 @@
+/*
+ * 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 java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.function.Supplier;
+import org.apache.solr.api.JerseyResource;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.util.ExecutorUtil;
+import org.apache.solr.common.util.SolrNamedThreadFactory;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.handler.api.V2ApiUtils;
+import org.apache.solr.jersey.SolrJerseyResponse;
+import org.apache.solr.logging.MDCLoggingContext;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+import org.apache.solr.util.tracing.TraceUtils;
+import org.slf4j.MDC;
+
+public abstract class CoreAdminAPIBase extends JerseyResource {
+
+  private static final ExecutorService PARALLEL_EXECUTOR =

Review Comment:
   Oh gotcha, not a problem - The way I read your original comment, I thought we were going fully with the static approach first, I can take some blame for my interpretation. I think what you're laying out here makes sense and I hadn't considered the case of multiple Solr Contexts running on a single VM. I took a little bit of time to see how I would register the map/executor, but haven't made any code changes yet. I will attempt to work on it this weekend if you haven't already gotten to it.
   
   Would migrating the status map and executor into a class that can then be used by both the CoreAdminHandler and made injectable for the CoreAdminAPIBase work? That may save us from having to inject multiple things and could potentially get us closer to the future state of what async could look like.



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