-
Notifications
You must be signed in to change notification settings - Fork 81
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm excited!
DB/src/main/java/io/deephaven/db/v2/utils/KeyedArrayBackedMutableTable.java
Show resolved
Hide resolved
proto/proto-backplane-grpc/src/main/proto/deephaven/proto/inputtable.proto
Outdated
Show resolved
Hide resolved
proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto
Outdated
Show resolved
Hide resolved
proto/proto-backplane-grpc/src/main/proto/deephaven/proto/table.proto
Outdated
Show resolved
Hide resolved
proto/proto-backplane-grpc/src/main/proto/deephaven/proto/inputtable.proto
Outdated
Show resolved
Hide resolved
grpc-api/src/main/java/io/deephaven/grpc_api/table/inputtables/InputTableServiceGrpcImpl.java
Show resolved
Hide resolved
grpc-api/src/main/java/io/deephaven/grpc_api/table/inputtables/InputTableServiceGrpcImpl.java
Outdated
Show resolved
Hide resolved
grpc-api/src/main/java/io/deephaven/grpc_api/table/ops/CreateInputTableGrpcImpl.java
Show resolved
Hide resolved
DB/src/main/java/io/deephaven/db/util/config/MutableInputTable.java
Outdated
Show resolved
Hide resolved
DB/src/main/java/io/deephaven/db/v2/utils/KeyedArrayBackedMutableTable.java
Show resolved
Hide resolved
DB/src/main/java/io/deephaven/db/v2/utils/KeyedArrayBackedMutableTable.java
Outdated
Show resolved
Hide resolved
36695a7
to
487a6e7
Compare
487a6e7
to
2b327af
Compare
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
3b109b0
This pull request is broken into three commits to start (with JS API client code to follow):
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.