Search in sources :

Example 1 with ApplyPreviewColumnsRequest

use of io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ApplyPreviewColumnsRequest in project deephaven-core by deephaven.

the class WorkerConnection method getTable.

public Promise<JsTable> getTable(JsVariableDefinition varDef, @Nullable Boolean applyPreviewColumns) {
    return whenServerReady("get a table").then(serve -> {
        JsLog.debug("innerGetTable", varDef.getTitle(), " started");
        return newState(info, (c, cts, metadata) -> {
            JsLog.debug("performing fetch for ", varDef.getTitle(), " / ", cts, " (" + LazyString.of(cts::getHandle), ")");
            // TODO (deephaven-core#188): eliminate this branch by applying preview cols before subscribing
            if (applyPreviewColumns == null || applyPreviewColumns) {
                ApplyPreviewColumnsRequest req = new ApplyPreviewColumnsRequest();
                req.setSourceId(TableTicket.createTableRef(varDef));
                req.setResultId(cts.getHandle().makeTicket());
                tableServiceClient.applyPreviewColumns(req, metadata, c::apply);
            } else {
                FetchTableRequest req = new FetchTableRequest();
                req.setSourceId(TableTicket.createTableRef(varDef));
                req.setResultId(cts.getHandle().makeTicket());
                tableServiceClient.fetchTable(req, metadata, c::apply);
            }
        }, "fetch table " + varDef.getTitle()).then(cts -> {
            JsLog.debug("innerGetTable", varDef.getTitle(), " succeeded ", cts);
            JsTable table = new JsTable(this, cts);
            return Promise.resolve(table);
        });
    });
}
Also used : Arrays(java.util.Arrays) InitialTableDefinition(io.deephaven.web.client.api.barrage.def.InitialTableDefinition) LogSubscriptionRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.LogSubscriptionRequest) JsPropertyMap(jsinterop.base.JsPropertyMap) Buffer(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.Buffer) HandshakeResponse(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb.HandshakeResponse) TypedTicket(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.ticket_pb.TypedTicket) JsTimeZone(io.deephaven.web.client.api.i18n.JsTimeZone) ObjectServiceClient(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.object_pb_service.ObjectServiceClient) StackTrace(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb.terminationnotificationresponse.StackTrace) io.deephaven.web.shared.data(io.deephaven.web.shared.data) Map(java.util.Map) SessionServiceClient(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb_service.SessionServiceClient) FieldsChangeUpdate(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.application_pb.FieldsChangeUpdate) ListFieldsRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.application_pb.ListFieldsRequest) Set(java.util.Set) ClientTableState(io.deephaven.web.client.state.ClientTableState) ExportedTableCreationResponse(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ExportedTableCreationResponse) JsArray(elemental2.core.JsArray) JsSet(elemental2.core.JsSet) Uint8Array(elemental2.core.Uint8Array) MetadataVersion(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.MetadataVersion) JsVariableDefinition(io.deephaven.web.client.api.console.JsVariableDefinition) KeyValue(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.KeyValue) ConsoleServiceClient(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb_service.ConsoleServiceClient) BarrageMessageWrapper(io.deephaven.javascript.proto.dhinternal.io.deephaven.barrage.flatbuf.barrage_generated.io.deephaven.barrage.flatbuf.BarrageMessageWrapper) JsRunnable(io.deephaven.web.shared.fu.JsRunnable) JsItr(io.deephaven.web.client.fu.JsItr) JsOptional(jsinterop.annotations.JsOptional) JsWidget(io.deephaven.web.client.api.widget.JsWidget) JsFigure(io.deephaven.web.client.api.widget.plot.JsFigure) Promise(elemental2.promise.Promise) BiDiStream(io.deephaven.web.client.api.barrage.stream.BiDiStream) Supplier(java.util.function.Supplier) RequestBatcher(io.deephaven.web.client.api.batch.RequestBatcher) ArrayList(java.util.ArrayList) Builder(io.deephaven.javascript.proto.dhinternal.flatbuffers.Builder) ResponseStreamWrapper(io.deephaven.web.client.api.barrage.stream.ResponseStreamWrapper) BiConsumer(java.util.function.BiConsumer) TableReviver(io.deephaven.web.client.state.TableReviver) FetchObjectRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.object_pb.FetchObjectRequest) JsTreeTable(io.deephaven.web.client.api.tree.JsTreeTable) TableServiceClient(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb_service.TableServiceClient) LazyPromise(io.deephaven.web.client.fu.LazyPromise) Nullable(javax.annotation.Nullable) BrowserHeaders(io.deephaven.javascript.proto.dhinternal.browserheaders.BrowserHeaders) LogSubscriptionData(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.LogSubscriptionData) Ticket(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.ticket_pb.Ticket) ColumnDefinition(io.deephaven.web.client.api.barrage.def.ColumnDefinition) RecordBatch(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.RecordBatch) MergeTablesRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.MergeTablesRequest) ApplyPreviewColumnsRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ApplyPreviewColumnsRequest) InputTableServiceClient(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.inputtable_pb_service.InputTableServiceClient) BarrageSubscriptionOptions(io.deephaven.javascript.proto.dhinternal.io.deephaven.barrage.flatbuf.barrage_generated.io.deephaven.barrage.flatbuf.BarrageSubscriptionOptions) ColumnConversionMode(io.deephaven.javascript.proto.dhinternal.io.deephaven.barrage.flatbuf.barrage_generated.io.deephaven.barrage.flatbuf.ColumnConversionMode) EmptyTableRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.EmptyTableRequest) BarrageUpdateMetadata(io.deephaven.javascript.proto.dhinternal.io.deephaven.barrage.flatbuf.barrage_generated.io.deephaven.barrage.flatbuf.BarrageUpdateMetadata) ByteBuffer(java.nio.ByteBuffer) TableConfig(io.deephaven.web.client.api.batch.TableConfig) TableReference(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.TableReference) JsVariableChanges(io.deephaven.web.client.api.console.JsVariableChanges) ReleaseRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb.ReleaseRequest) FlightData(io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.flight_pb.FlightData) ApplicationServiceClient(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.application_pb_service.ApplicationServiceClient) ExportedTableUpdatesRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ExportedTableUpdatesRequest) JsLog(io.deephaven.web.client.fu.JsLog) Collectors(java.util.stream.Collectors) HasTableBinding(io.deephaven.web.client.state.HasTableBinding) List(java.util.List) FlightServiceClient(io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.flight_pb_service.FlightServiceClient) HasLifecycle(io.deephaven.web.client.api.lifecycle.HasLifecycle) Message(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.Message) JsWeakMap(elemental2.core.JsWeakMap) BarrageSubscriptionRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.barrage.flatbuf.barrage_generated.io.deephaven.barrage.flatbuf.BarrageSubscriptionRequest) ExportedTableUpdateMessage(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ExportedTableUpdateMessage) Optional(java.util.Optional) TimeTableRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.TimeTableRequest) HandshakeRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb.HandshakeRequest) Code(io.deephaven.javascript.proto.dhinternal.grpcweb.grpc.Code) Grpc(io.deephaven.javascript.proto.dhinternal.grpcweb.Grpc) BrowserFlightServiceClient(io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.browserflight_pb_service.BrowserFlightServiceClient) BarrageMessageType(io.deephaven.javascript.proto.dhinternal.io.deephaven.barrage.flatbuf.barrage_generated.io.deephaven.barrage.flatbuf.BarrageMessageType) JsMethod(jsinterop.annotations.JsMethod) HashMap(java.util.HashMap) StateCache(io.deephaven.web.client.api.state.StateCache) HashSet(java.util.HashSet) FetchTableRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.FetchTableRequest) Js(jsinterop.base.Js) FieldNode(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.FieldNode) Charset(java.nio.charset.Charset) Field(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.Field) FetchObjectResponse(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.object_pb.FetchObjectResponse) Long(io.deephaven.javascript.proto.dhinternal.flatbuffers.Long) JsConsumer(io.deephaven.web.shared.fu.JsConsumer) DomGlobal(elemental2.dom.DomGlobal) Schema(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.Schema) TerminationNotificationRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.session_pb.TerminationNotificationRequest) JsDataHandler(io.deephaven.web.client.api.parse.JsDataHandler) BarrageUtils(io.deephaven.web.client.api.barrage.BarrageUtils) FieldInfo(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.application_pb.FieldInfo) BitSet(java.util.BitSet) MessageHeader(io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.MessageHeader) ApplyPreviewColumnsRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ApplyPreviewColumnsRequest) FetchTableRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.FetchTableRequest)

Aggregations

JsArray (elemental2.core.JsArray)1 JsSet (elemental2.core.JsSet)1 JsWeakMap (elemental2.core.JsWeakMap)1 Uint8Array (elemental2.core.Uint8Array)1 DomGlobal (elemental2.dom.DomGlobal)1 Promise (elemental2.promise.Promise)1 FieldNode (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.FieldNode)1 Message (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.Message)1 MessageHeader (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.MessageHeader)1 RecordBatch (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.RecordBatch)1 Buffer (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.Buffer)1 Field (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.Field)1 KeyValue (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.KeyValue)1 MetadataVersion (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.MetadataVersion)1 Schema (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.schema_generated.org.apache.arrow.flatbuf.Schema)1 BrowserFlightServiceClient (io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.browserflight_pb_service.BrowserFlightServiceClient)1 FlightData (io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.flight_pb.FlightData)1 FlightServiceClient (io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.flight_pb_service.FlightServiceClient)1 BrowserHeaders (io.deephaven.javascript.proto.dhinternal.browserheaders.BrowserHeaders)1 Builder (io.deephaven.javascript.proto.dhinternal.flatbuffers.Builder)1