You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extensions may need to request and respond to each other, including sharing classes with each other. Class sharing can be accomplished with NamedWriteables.
What solution would you like?
Create a Request type that forwards a request to another extension (given its uniqueId). The request should contain:
the uniqueId of the target
a String comprising the request, for data that can be serialized to JSON. May be empty.
a Map containing pairs of NamedWriteable name (key) byte content (value). May be empty.
The receiving handler should validate that any NamedWriteable names are registered and issue a failure response otherwise.
The receiving handler should lookup the target extension and forward the String and Map to it with a separate request.
The receiving handler should get the forwarding response and respond to the sending extensions appropriately.
What alternatives have you considered?
Direct extension communication is possible and will not be prohibited. Extensions will have the host/port information and could, in theory, directly send data. This may be a solution some developers choose. However, it should not be mandated to handle this.
Since the writeables are registered, The ExtensionsOrchestrator could deserialize them and then re-serialize the objects before sending them. This requires extra processing time to convert bytes into temporary objects, just to return the to the same sequence of bytes. The conversion of an object to bytes is most easily accomplished at the sender level (but inside the Request object using helper methods so it's transparent to the user.)
Is your feature request related to a problem?
Extensions may need to request and respond to each other, including sharing classes with each other. Class sharing can be accomplished with
NamedWriteables
.What solution would you like?
Create a
Request
type that forwards a request to another extension (given its uniqueId). The request should contain:NamedWriteable
name (key) byte content (value). May be empty.The receiving handler should validate that any
NamedWriteable
names are registered and issue a failure response otherwise.The receiving handler should lookup the target extension and forward the String and Map to it with a separate request.
The receiving handler should get the forwarding response and respond to the sending extensions appropriately.
What alternatives have you considered?
Direct extension communication is possible and will not be prohibited. Extensions will have the host/port information and could, in theory, directly send data. This may be a solution some developers choose. However, it should not be mandated to handle this.
Since the writeables are registered, The ExtensionsOrchestrator could deserialize them and then re-serialize the objects before sending them. This requires extra processing time to convert bytes into temporary objects, just to return the to the same sequence of bytes. The conversion of an object to bytes is most easily accomplished at the sender level (but inside the Request object using helper methods so it's transparent to the user.)
Do you have any additional context?
Review the classes in this package: some of them may be very helpful:
https://github.com/opensearch-project/OpenSearch/tree/main/server/src/main/java/org/opensearch/common/io/stream
The text was updated successfully, but these errors were encountered: