OpenSearch icon indicating copy to clipboard operation
OpenSearch copied to clipboard

Refactor StreamInput.readGenericValue StreamOutput.writeGenericValue to use NamedWriteableRegistry

Open nknize opened this issue 1 year ago • 0 comments

Class ID bytes are used by StreamInput.readGenericValue and StreamOutput.writeGenericValue to identify the generic class sent over the wire. This is subject to id clashing if/when a plugin registers with the same byte.

The proper solution is to cut over to the NamedWriteableRegistry and have modules and plugins load their named writeable via SPI. This has a positive side effect that we can register core named writeables through the core library and create options for deciding how to separate cluster specific named writeables (e.g., through a cluster specific module or the core library).

To do this requires some initial groundwork to untangle tightly coupled classes (e.g., unwind XContent from server classes, Settings from server to core library).

I'm opening this meta issue to track PRs that contribute to both #8110 and achieving the objective above.

  • [x] XContentType abstraction in server (#8636)
  • [ ] Refactor Settings from server to core library
  • [ ] #7840

relates #5910 relates #8636 relates #7840 relates #7780

nknize avatar Jul 20 '23 15:07 nknize