Proto file CLI commands on Red Hat Data Grid 8.x

Solution Verified - Updated

Environment

  • Red Hat Data Grid (RHDG)
    • 8.x

Issue

  • Proto file commands on DG 8.x
  • What are the DG 8.x CLI command for handling proto file?

Resolution

[dg-cluster-8718-0-47944@dg-cluster-8718//containers/default]> schema --upload=person.proto person.proto
Could not connect to server: java.io.FileNotFoundException: /opt/infinispan/person.proto (No such file or directory)

In case there is any issue on the upload the workaround for this is to delete the schema, or repeat the command to add the schema with the valid file.

Root Cause

First, the ProtoBuf schema file is only needed if indexing or running server-side tasks that need to work on the data locally.
Second, the ProtoBuf schema is an internal metacache - repl-sync cache - located in the data directory and can be manually removed.
However, one important fact is that even without proto file the withDataFormat() is required for visualization on the console. This allows the DG server instead of serializing the data using Java serialization, to use specific media types this will allow visualization in the console.
Meaning withDataFormat method in RemoteCache to make sure the client will have a certain format, given by default we use Java serialization, so the byte[] stored on the server will be only readable if it has the exact classes
by telling it the media type and using the UTF8StringMarshaller, we store it as plain UTF-8.

DG 8's Protosteam vs JDG 7's jboss-marshalling

Protostream is the marshaller for RHDG 8, whereas Jboss-marshalling is the marshaller used by RHDG 7.
The console can show these entries if the user deploys a jar with their classes. RHDG 8 still supports this feature but needs to be enabled. Protostream is the marshaller for RHDG 8. It has a schema so it does not need a jar with the customer classes. And the console can show these entries as well.

jboss-marshalling-osgi-2.0.12.Final-redhat-00001.jar doesn't work with JDK 17. Can be replaced in Infinispan with jboss-marshalling and jboss-marshalling-river as temporary alternatives for JDK 17.
The name is called osgi given it contains the necessary manifest entries to allow it to work in OSGi containers.

Jiras

This content is not included.JDG-5549: REST/CLI command will add a schema definition with 'upload' if the given file does not exists

DG 8.x

User can add a proto via schema --upload:

schema --upload=aprotofile.proto
...
[dg-cluster-8718-0-47944@dg-cluster-8718//containers/default/caches]> cd ../schemas
[dg-cluster-8718-0-47944@dg-cluster-8718//containers/default/schemas]> ls
afile.proto <-------------------------------
person.proto

DG 8.4

CLI commands for DG 8.4:

schema upload 
schema remove 
schema ls 
schema get
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.