Skip to content

SOLR-17600 (Part 4/4): Delete MapSerializable interface#4466

Open
isaric wants to merge 4 commits into
apache:mainfrom
isaric:SOLR-17600-4-final-cleanup
Open

SOLR-17600 (Part 4/4): Delete MapSerializable interface#4466
isaric wants to merge 4 commits into
apache:mainfrom
isaric:SOLR-17600-4-final-cleanup

Conversation

@isaric
Copy link
Copy Markdown

@isaric isaric commented May 25, 2026

This is the final Part 4 of 4 to deprecate and remove the MapSerializable interface as part of SOLR-17600.

This PR deletes the MapSerializable.java file from the repository now that all usages have been migrated to MapWriter, 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MapSerializable implementations/usages with MapWriter.writeMap(...) across core, SolrJ, and streaming modules.
  • Updated various call sites from .toMap(new ...) to new SimpleOrderedMap<>(...) or Utils.convertToMap(...).
  • Removed the deprecated MapSerializable interface 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.writeMap no longer writes a children field; instead it writes each child directly into the same EntryWriter, which will flatten/overwrite keys and changes the output shape from the prior children: [ ... ] list. Restore the prior structure by writing a single children entry (e.g., ew.putIfNotNull(\"children\", children)), letting serialization handle the list of MapWriter children, rather than iterating and calling child.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) {
@isaric isaric force-pushed the SOLR-17600-4-final-cleanup branch from b2f6d04 to b977f5a Compare May 25, 2026 13:35
@isaric isaric force-pushed the SOLR-17600-4-final-cleanup branch from b977f5a to 6280f3d Compare May 25, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants