epugh commented on code in PR #4073:
URL: https://github.com/apache/solr/pull/4073#discussion_r2724165203
##########
solr/core/src/java/org/apache/solr/core/SolrCore.java:
##########
@@ -3148,11 +3117,48 @@ default String getContentType() {
}
/**
- * Configure the query response writers. There will always be a default
writer; additional writers
- * may also be configured.
+ * Gets a response writer suitable for admin/container-level requests.
+ *
+ * @param writerName the writer name, or null for default
+ * @return the response writer, never null
+ * @deprecated Use {@link BuiltInResponseWriters#getWriter(String)} instead.
+ */
+ @Deprecated
+ public static QueryResponseWriter getAdminResponseWriter(String writerName) {
+ return BuiltInResponseWriters.getWriter(writerName);
+ }
+
+ /**
+ * Initializes query response writers. Response writers from {@code
ImplicitPlugins.json} may also
+ * be configured.
*/
private void initWriters() {
- responseWriters.init(DEFAULT_RESPONSE_WRITERS, this);
+ // Build default writers map from implicit plugins
+ Map<String, QueryResponseWriter> defaultWriters = new HashMap<>();
+
+ // Load writers from ImplicitPlugins.json
+ List<PluginInfo> implicitWriters = getImplicitResponseWriters();
+ for (PluginInfo info : implicitWriters) {
+ try {
+ QueryResponseWriter writer =
+ createInstance(
+ info.className,
+ QueryResponseWriter.class,
+ "queryResponseWriter",
+ null,
+ getResourceLoader());
+ defaultWriters.put(info.name, writer);
+ } catch (Exception e) {
+ log.warn("Failed to load implicit response writer: {}", info.name, e);
+ }
+ }
+
+ // Add special filestream writer (custom implementation)
+ defaultWriters.put(ReplicationAPIBase.FILE_STREAM, getFileStreamWriter());
Review Comment:
FYI, I don't know why this is "special". I looked, and I think we could
just create a class called `FileStreamWriter` instead of this special magic.
Claude agreed with me and even cranked out a class. I think that would
simplify the code flow. Maybe we call it REPLICATION_FILE_STREAM or
REPLICATION_STREAM. We don't have to fix in this, but it's a candiate for an
improvement.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]