From 02509788692909b2e1efc24218714bef76423b43 Mon Sep 17 00:00:00 2001 From: Tomas Fernandez Lobbe Date: Thu, 10 Sep 2020 10:33:09 -0700 Subject: [PATCH] SOLR-14510: Remove deprecations added with BlockMax WAND support (#1823) --- .../solr/response/GeoJSONResponseWriter.java | 7 ----- .../solr/response/JSONResponseWriter.java | 7 ----- .../org/apache/solr/response/JSONWriter.java | 30 ------------------- .../response/PHPSerializedResponseWriter.java | 10 +------ .../apache/solr/response/SchemaXmlWriter.java | 5 ---- .../solr/response/TabularResponseWriter.java | 7 ----- .../solr/response/TextResponseWriter.java | 11 +------ .../org/apache/solr/response/XMLWriter.java | 20 ------------- .../src/major-changes-in-solr-9.adoc | 5 +++- 9 files changed, 6 insertions(+), 96 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/response/GeoJSONResponseWriter.java b/solr/core/src/java/org/apache/solr/response/GeoJSONResponseWriter.java index 1afca18214b..7ad861423a1 100644 --- a/solr/core/src/java/org/apache/solr/response/GeoJSONResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/GeoJSONResponseWriter.java @@ -294,13 +294,6 @@ class GeoJSONWriter extends JSONWriter { } } - @Deprecated - @Override - public void writeStartDocumentList(String name, - long start, int size, long numFound, Float maxScore) throws IOException { - throw new UnsupportedOperationException(); - } - @Override public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException diff --git a/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java b/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java index 30a5e5c677c..7cff5cd19a8 100644 --- a/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java @@ -214,13 +214,6 @@ class ArrayOfNameTypeValueJSONWriter extends JSONWriter { ifNeededWriteTypeAndValueKey("doc"); super.writeSolrDocument(name, doc, returnFields, idx); } - - @Deprecated - @Override - public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore) throws IOException { - ifNeededWriteTypeAndValueKey("doclist"); - super.writeStartDocumentList(name, start, size, numFound, maxScore); - } @Override public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/response/JSONWriter.java b/solr/core/src/java/org/apache/solr/response/JSONWriter.java index 48587a98e04..cef8b7d1d0f 100644 --- a/solr/core/src/java/org/apache/solr/response/JSONWriter.java +++ b/solr/core/src/java/org/apache/solr/response/JSONWriter.java @@ -131,36 +131,6 @@ public class JSONWriter extends TextResponseWriter implements JsonTextWriter { // contained in an array or map, a negative value indicates // that the size could not be reliably determined. // - - /** - * This method will be removed in Solr 9 - * @deprecated Use {{@link #writeStartDocumentList(String, long, int, long, Float, Boolean)}. - */ - @Override - @Deprecated - public void writeStartDocumentList(String name, - long start, int size, long numFound, Float maxScore) throws IOException - { - writeMapOpener(headerSize(maxScore, null)); - incLevel(); - writeKey("numFound",false); - writeLong(null,numFound); - writeMapSeparator(); - writeKey("start",false); - writeLong(null,start); - - if (maxScore!=null) { - writeMapSeparator(); - writeKey("maxScore",false); - writeFloat(null,maxScore); - } - writeMapSeparator(); - // indent(); - writeKey("docs",false); - writeArrayOpener(size); - - incLevel(); - } @Override public void writeStartDocumentList(String name, diff --git a/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java b/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java index 155f267a53b..9ff20a0af0c 100644 --- a/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java @@ -86,15 +86,7 @@ class PHPSerializedWriter extends JSONWriter { @Override public void writeNamedList(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException { - writeNamedListAsMapMangled(name,val); - } - - @Deprecated - @Override - public void writeStartDocumentList(String name, - long start, int size, long numFound, Float maxScore) throws IOException - { - throw new UnsupportedOperationException(); + writeNamedListAsMapMangled(name, val); } @Override diff --git a/solr/core/src/java/org/apache/solr/response/SchemaXmlWriter.java b/solr/core/src/java/org/apache/solr/response/SchemaXmlWriter.java index 0ea30fb1138..d9f580467a8 100644 --- a/solr/core/src/java/org/apache/solr/response/SchemaXmlWriter.java +++ b/solr/core/src/java/org/apache/solr/response/SchemaXmlWriter.java @@ -465,11 +465,6 @@ public class SchemaXmlWriter extends TextResponseWriter { writer.write(tag); writer.write('>'); } - - @Override - public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore) throws IOException { - // no-op - } @Override public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/response/TabularResponseWriter.java b/solr/core/src/java/org/apache/solr/response/TabularResponseWriter.java index 2951a473ce8..e27433520db 100644 --- a/solr/core/src/java/org/apache/solr/response/TabularResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/TabularResponseWriter.java @@ -121,13 +121,6 @@ public abstract class TabularResponseWriter extends TextResponseWriter { public void writeNamedList(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException { } - @Override - public void writeStartDocumentList(String name, - long start, int size, long numFound, Float maxScore) throws IOException - { - // nothing - } - @Override public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException diff --git a/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java b/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java index 803c340ca75..e19906afc24 100644 --- a/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java @@ -157,16 +157,7 @@ public abstract class TextResponseWriter implements TextWriter { // types of formats, including those where the name may come after the value (like // some XML formats). - //TODO: Make abstract in Solr 9.0 - public void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException { - writeStartDocumentList(name, start, size, numFound, maxScore); - } - - /** - * @deprecated Use {@link #writeStartDocumentList(String, long, int, long, Float, Boolean)} - */ - @Deprecated - public abstract void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore) throws IOException; + public abstract void writeStartDocumentList(String name, long start, int size, long numFound, Float maxScore, Boolean numFoundExact) throws IOException; public abstract void writeSolrDocument(String name, SolrDocument doc, ReturnFields fields, int idx) throws IOException; diff --git a/solr/core/src/java/org/apache/solr/response/XMLWriter.java b/solr/core/src/java/org/apache/solr/response/XMLWriter.java index 3dec2cc11bd..5f7659007aa 100644 --- a/solr/core/src/java/org/apache/solr/response/XMLWriter.java +++ b/solr/core/src/java/org/apache/solr/response/XMLWriter.java @@ -187,26 +187,6 @@ public class XMLWriter extends TextResponseWriter { incLevel(); } - - @Override - @Deprecated - public void writeStartDocumentList(String name, - long start, int size, long numFound, Float maxScore) throws IOException - { - if (doIndent) indent(); - - writer.write(""); - - incLevel(); - } - /** * The SolrDocument should already have multivalued fields implemented as diff --git a/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc b/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc index 4deea753f43..b94602a0187 100644 --- a/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc +++ b/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc @@ -124,7 +124,10 @@ _(raw; not yet edited)_ monitors on Solr KPIs that mention "master" or "slave" will also now be "leader" and "follower" * SOLR-14783: Data Import Handler (DIH) has been removed from Solr. The community package is available at: https://github.com/rohitbemax/dataimporthandler (Alexandre Rafalovitch) - + +* SOLR-14510: The `writeStartDocumentList` in `TextResponseWriter` now receives an extra boolean parameter representing the "exactness" of the numFound value (exact vs approximation). + Any custom response writer extending `TextResponseWriter` will need to implement this abstract method now (instead previous with the same name but without the new boolean parameter). + === Upgrade Prerequisites in Solr 9 * Upgrade all collections in stateFormat=1 to stateFormat=2 *before* upgrading to Solr 9, as Solr 9 does not support the