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

Provide gRPC api for input tables #1440

Merged
merged 13 commits into from
Nov 8, 2021
Merged

Conversation

niloc132
Copy link
Member

This pull request is broken into three commits to start (with JS API client code to follow):

  • ClassUtil improvements
  • Proposed MutableInputTable api enhancements
  • Proposed gRPC api and implementation

ClassUtil got its lookupClass from the dataobjects ClassUtil, but this implementation isn't thread safe, and while it supports both Class.getName() and Class.getCanonicalName() array notation, it only supports getName() inner type notation. Additionally, it initializes the class on first mention, which could mean for example that an arbitrary doPut could force the server to load a class, even if not serializable. This commit still supports (ignores) generic arguments provided to the class, but otherwise delegates to common-lang3 to actually find the class, and provide the class instance without initializing it.

The MutableInputTable changes are intended to make it easier to use from gRPC on the server, and removes some details where the DHE openapi was used to provide implementation details of the input table.

The gRPC API adds a createInputTable call in table service (still has some TODOs for discussion), and provides a separate gRPC service to interact with the input table itself.

Copy link
Member

@devinrsmith devinrsmith left a comment

Choose a reason for hiding this comment

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

I'm excited!

nbauernfeind
nbauernfeind previously approved these changes Nov 5, 2021
Comment on lines 60 to 65
Message message = Message.getRootAsMessage(request.getSchema().asReadOnlyByteBuffer());
if (message.headerType() != MessageHeader.Schema) {
throw GrpcUtil.statusRuntimeException(Code.INVALID_ARGUMENT,
"Must specify schema header in schema message");
}
tableDefinitionFromSchema = BarrageUtil.convertArrowSchema((Schema) message.header(new Schema())).tableDef;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like from this context we don't have to worry about the magic 8 bytes?

I wonder if we should try to use the utility code, or generalize the utility code, in io.deephaven.grpc_api.util.SchemaHelper and/or BarrageUtil instead of doing it inline here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a new method to SchemaHelper to unwrap an arbitrary ByteBuffer, then pass to BarrageUtil to convert to the TableDefinition.

devinrsmith
devinrsmith previously approved these changes Nov 5, 2021
nbauernfeind
nbauernfeind previously approved these changes Nov 5, 2021
@devinrsmith devinrsmith self-requested a review November 8, 2021 15:34
@niloc132 niloc132 merged commit b7ad12c into deephaven:main Nov 8, 2021
@niloc132 niloc132 deleted the 1271-input-tables branch November 8, 2021 21:16
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants