Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schemas api design #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Schemas-API.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Proposal: Schema Manipulation in Hotrod for Protostream Infinispan

## Goal
To enhance schema evolution and management in Infinispan's Protostream serialization framework, we propose replacing the current API with a new schema manipulation mechanism.

## Hotrod client side marshaller

### Client side api today

[source, java]
----
Schema schema = // programmatic schema
MagazineMarshaller magazineMarshaller = new MagazineMarshaller(); // custom marshaller 1
BookMarshaller bookMarshaller = new BookMarshaller(); // custom marshaller 2

ProtoStreamMarshaller protostreamMarshaller = new ProtoStreamMarshaller();
SerializationContext serializationContext = marshaller.getSerializationContext();
FileDescriptorSource fds = FileDescriptorSource.fromString(schema.getName(), schema.toString());
serializationContext.registerProtoFiles(fds);
serializationContext.registerMarshaller(magazineMarshaller);
serializationContext.registerMarshaller(bookMarshaller);
builder.marshaller(protostreamMarshaller);
builder.remoteCache("cacheName").marshaller(protostreamMarshaller);
----

### Client side api proposal

[source, java]
----
Schema schema = // programmatic schema
MagazineMarshaller magazineMarshaller = new MagazineMarshaller(); // custom marshaller 1
BookMarshaller bookMarshaller = new BookMarshaller(); // custom marshaller 2

ProtoStreamMarshaller protostreamMarshaller = new ProtoStreamMarshaller();
protostreamMarshaller.register(schema, magazineMarshaller, bookMarshaller);

builder.remoteCache("cacheName").marshaller(marshaller);
----