SOLR-17600 (Part 4/4): Delete MapSerializable interface#4466
Open
isaric wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR migrates Solr’s internal “map-like serialization” from the deprecated MapSerializable API to MapWriter, standardizing conversions via SimpleOrderedMap / Utils.convertToMap and removing MapSerializable.
Changes:
- Replaced
MapSerializableimplementations/usages withMapWriter.writeMap(...)across core, SolrJ, and streaming modules. - Updated various call sites from
.toMap(new ...)tonew SimpleOrderedMap<>(...)orUtils.convertToMap(...). - Removed the deprecated
MapSerializableinterface and adjusted tests accordingly.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| solr/test-framework/src/java/org/apache/solr/common/cloud/ClusterStateUtil.java | Use SimpleOrderedMap for debug serialization of collection states. |
| solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleCborTest.java | Update CBOR test to serialize docs via SimpleOrderedMap. |
| solr/solrj/src/java/org/apache/solr/common/util/Utils.java | Switch deep-copy / reflection mapping to MapWriter + SimpleOrderedMap/convertToMap. |
| solr/solrj/src/java/org/apache/solr/common/util/TextWriter.java | Remove legacy MapSerializable handling in text output. |
| solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java | Remove legacy MapSerializable handling in javabin encoding. |
| solr/solrj/src/java/org/apache/solr/common/cloud/ZkNodeProps.java | Construct props from MapWriter via SimpleOrderedMap. |
| solr/solrj/src/java/org/apache/solr/common/MapWriterMap.java | Remove toMap override tied to removed MapSerializable. |
| solr/solrj/src/java/org/apache/solr/common/MapWriter.java | Drop MapSerializable inheritance and toMap default; minor lambda simplification. |
| solr/solrj/src/java/org/apache/solr/common/MapSerializable.java | Deleted deprecated interface. |
| solr/solrj/src/java/org/apache/solr/common/IteratorWriter.java | Convert nested MapWriter elements via SimpleOrderedMap in toList. |
| solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java | Convert explanation serialization from toMap to writeMap. |
| solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/expr/Explanation.java | Replace MapSerializable with MapWriter.writeMap implementation. |
| solr/modules/extraction/src/java/org/apache/solr/handler/extraction/TikaServerExtractionBackend.java | Copy init args from MapWriter via SimpleOrderedMap. |
| solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java | Update tests to use SimpleOrderedMap + assert MapWriter. |
| solr/core/src/test/org/apache/solr/handler/designer/TestSchemaDesignerAPI.java | Convert SolrParams to map via SimpleOrderedMap. |
| solr/core/src/test/org/apache/solr/core/TestConfig.java | Update mapping assertions to use SimpleOrderedMap. |
| solr/core/src/test/org/apache/solr/core/CacheConfigTest.java | Update cache config mapping tests to use SimpleOrderedMap. |
| solr/core/src/test/org/apache/solr/api/NodeConfigClusterPluginsSourceTest.java | Convert config MapWriter to map via SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java | Replace toMap with writeMap to implement MapWriter. |
| solr/core/src/java/org/apache/solr/update/IndexFingerprint.java | Replace toMap with writeMap; toString now uses SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/search/CacheConfig.java | Replace toMap with writeMap using NamedList writer. |
| solr/core/src/java/org/apache/solr/schema/IndexSchema.java | Convert schema props serialization from toMap to writeMap / SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/handler/export/ExportWriterStream.java | Convert nested MapWriter values via SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/handler/designer/ManagedSchemaDiff.java | Convert SimpleOrderedMap to Map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/SplitShardAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/SplitCoreAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/RequestSyncShardAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/RequestCoreRecoveryAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/RequestBufferUpdatesAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/RequestApplyCoreUpdatesAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/RejoinLeaderElectionAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/RebalanceLeadersAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/PrepareCoreRecoveryAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/OverseerOperationAPI.java | Build legacy param map via SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/MoveReplicaAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/ModifyCollectionAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/MigrateDocsAPI.java | Build legacy param map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/api/InstallShardData.java | Convert message payload via Utils.convertToMap for ZkNodeProps. |
| solr/core/src/java/org/apache/solr/handler/admin/api/CreateCore.java | Convert SolrParams via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java | Convert DocCollection state to map via Utils.convertToMap. |
| solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java | Convert nested MapWriter stats via SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/handler/admin/BaseHandlerApiSupport.java | Switch anonymous map serialization from toMap to writeMap. |
| solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java | Update config/plugin mapping logic to MapWriter + SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/handler/ClusterAPI.java | Convert role payloads via SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/filestore/ClusterFileStore.java | Copy metadata from MapWriter via SimpleOrderedMap. |
| solr/core/src/java/org/apache/solr/core/SolrConfig.java | Replace toMap tree-building with writeMap using SimpleOrderedMap/NamedList. |
| solr/core/src/java/org/apache/solr/core/RequestParams.java | Replace toMap with writeMap; update nested ParamSet serialization. |
| solr/core/src/java/org/apache/solr/core/PluginInfo.java | Replace toMap with writeMap for plugin serialization. |
| solr/core/src/java/org/apache/solr/core/ConfigOverlay.java | Replace toMap with writeMap for overlay serialization. |
| solr/core/src/java/org/apache/solr/api/NodeConfigClusterPluginsSource.java | Use NamedList.asMap when extracting init args for config. |
| changelog/unreleased/SOLR-17600.yml | Add changelog entry for MapSerializable → MapWriter migration. |
Comments suppressed due to low confidence (1)
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java:1
StreamExplanation.writeMapno longer writes achildrenfield; instead it writes each child directly into the sameEntryWriter, which will flatten/overwrite keys and changes the output shape from the priorchildren: [ ... ]list. Restore the prior structure by writing a singlechildrenentry (e.g.,ew.putIfNotNull(\"children\", children)), letting serialization handle the list ofMapWriterchildren, rather than iterating and callingchild.writeMap(ew)on the parent writer.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+198
to
210
| public void writeMap(EntryWriter ew) throws IOException { | ||
| new NamedList<>(attributes).writeMap(ew); | ||
| if (initArgs != null) { | ||
| new SimpleOrderedMap<>(initArgs).writeMap(ew); | ||
| } | ||
| if (children == null || children.isEmpty()) { | ||
| return; | ||
| } | ||
|
|
||
| for (PluginInfo child : children) { | ||
| child.writeMap(ew); | ||
| } | ||
| return m; | ||
| } |
Comment on lines
+209
to
210
| && !((List) o).isEmpty() | ||
| && ((List) o).get(0) instanceof String) { |
b2f6d04 to
b977f5a
Compare
b977f5a to
6280f3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the final Part 4 of 4 to deprecate and remove the
MapSerializableinterface as part of SOLR-17600.This PR deletes the
MapSerializable.javafile from the repository now that all usages have been migrated toMapWriter, and adds the changelog entry.Note: This PR is part of a stacked series and is built on top of Parts 1-3 (#4463, #4464, #4465). It currently displays the commits from Parts 1-3 as well, but they will automatically drop from this PR's diff once the previous parts are merged into
main. This PR should be merged last.