Class ControllerGrpcHelper

java.lang.Object
com.illumon.iris.controller.utils.ControllerGrpcHelper

public final class ControllerGrpcHelper extends Object
This class contains utilities for packing and unpacking objects for gRPC communication.
  • Field Details

    • ERROR_KEY

      public static final io.deephaven.shadow.core.io.grpc.Metadata.Key<ErrorResponse> ERROR_KEY
  • Method Details

    • makeQueryInfoMessage

      public static PersistentQueryInfoMessage makeQueryInfoMessage(@NotNull PersistentQueryInfo info, @NotNull WorkerUrlBuilder workerUrlBuilder, @Nullable io.deephaven.enterprise.auth.UserContext forUser, @Nullable IrisGroupProvider groupProvider) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Serialize a PersistentQueryInfo object for gRPC.
      Parameters:
      info - the object to serialize
      forUser -
      groupProvider -
      Returns:
      the serialized PersistentQueryInfoMessage
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred converting the message to gRPC
    • makeQueryConfigMessage

      public static PersistentQueryConfigMessage makeQueryConfigMessage(@NotNull PersistentQueryConfiguration config) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Serialize a PersistentQueryConfiguration object for gRPC.
      Parameters:
      config - the object to serialize
      Returns:
      the serialized PersistentQueryConfigMessage
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred converting the message to gRPC
    • makeStateMessageForPresenceKv

      public static PersistentQueryStateMessage makeStateMessageForPresenceKv(@NotNull PersistentQueryState state, @NotNull WorkerUrlBuilder workerUrlBuilder) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Creates a PersistetQueryStateMessage with the PersistentQueryState provided.
      Parameters:
      state - the state to use as data to populate the returned message
      workerUrlBuilder - the worker url build to use for the respective fields
      Returns:
      a new state message matching the supplied data
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if there are any errors during serialization
    • makeNamedStringList

      public static NamedStringList makeNamedStringList(@NotNull String name, @Nullable String[] list)
      Create a NamedStringList object from a string array and name.
      Parameters:
      name - the name to use
      list - the array of values
      Returns:
      a new NamedStringList
    • makeNamedStringList

      @NotNull public static NamedStringList makeNamedStringList(@NotNull String name, @Nullable Collection<String> list)
      Create a NamedStringList object from a collection of strings and name.
      Parameters:
      name - the name to use
      list - the collection of values
      Returns:
      a new NamedStringList
    • makeExportedObjectInfoMessage

      public static ExportedObjectInfoMessage makeExportedObjectInfoMessage(@NotNull String name, @NotNull ExportedObjectInfo type) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Parameters:
      name - the name of the object
      type - the ExportedObjectInfo
      Returns:
      a new ExportedObjectInfoMessage
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred converting the message to gRPC
    • makePQDBServerConfigMessage

      public static PQDBServerConfigMessage makePQDBServerConfigMessage(@NotNull PersistentQueryDbServerConfig config) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Serialize a PersistentQueryDbServerConfig object for gRPC
      Parameters:
      config - the configuration to serialize
      Returns:
      a new PersistentQueryDbServerConfig
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred converting the message to gRPC
    • makeControllerConfigMessage

      public static ControllerConfigurationMessage makeControllerConfigMessage(@NotNull PersistentQueryControllerConfiguration serverConfiguration, @NotNull Predicate<ConsoleConfigurationType> configTypePredicate) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Parameters:
      serverConfiguration - the configuration to serialize
      Returns:
      a new ControllerConfigurationMessage
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred converting the message to gRPC
    • makeQueryInfo

      public static PersistentQueryInfo makeQueryInfo(@NotNull PersistentQueryInfoMessage infoMessage) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Deserialize a PersistentQueryInfo from gRPC.
      Parameters:
      infoMessage - the message to deserialize
      Returns:
      a new PersistentQueryInfo
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred deserializing gRPC message
    • makeQueryState

      public static PersistentQueryState makeQueryState(@NotNull PersistentQueryStateMessage stateMessage) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException
    • makeWorkerProtocol

      public static io.deephaven.enterprise.dispatcher.client.WorkerProtocol makeWorkerProtocol(@NotNull WorkerProtocolMessage protocolMessage)
      Deserialize a WorkerProtocol from gRPC.
      Parameters:
      protocolMessage - the message to deserialize
      Returns:
      a new WorkerProtocol
    • makeQueryConfig

      public static PersistentQueryConfiguration makeQueryConfig(PersistentQueryConfigMessage configMessage) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Deserialize a PersistentQueryConfiguration from gRPC.
      Parameters:
      configMessage - the message to deserialize
      Returns:
      a new PersistentQueryConfiguration
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred deserializing gRPC message
    • makeStatus

      public static PersistentQueryState.Status makeStatus(@NotNull PersistentQueryStatusEnum grpcStatus) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Deserialize a PersistentQueryState.Status from gRPC.
      Parameters:
      grpcStatus - the message to deserialize
      Returns:
      a new PersistentQueryState.Status.
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred deserializing gRPC message
    • makeDbServerConfig

      public static PersistentQueryDbServerConfig makeDbServerConfig(PQDBServerConfigMessage configMessage) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Deserialize a PersistentQueryDbServerConfig from gRPC.
      Parameters:
      configMessage - the message to deserialize
      Returns:
      a new PersistentQueryDbServerConfig
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred deserializing gRPC message
    • makePersistentQueryControllerConfiguration

      public static PersistentQueryControllerConfiguration makePersistentQueryControllerConfiguration(@NotNull ControllerConfigurationMessage response) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Parameters:
      response - the message to deserialize
      Returns:
      a new PersistentQueryControllerConfiguration
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred deserializing gRPC message
    • makeExportedObjectInfo

      public static ExportedObjectInfo makeExportedObjectInfo(ExportedObjectInfoMessage eo) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Deserialize an ExportedObjectInfo from gRPC.
      Parameters:
      eo - the message to deserialize
      Returns:
      a new ExportedObjectInfo
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred deserializing gRPC message
    • makeTableDefinition

      public static TableDefinition makeTableDefinition(@NotNull TableDefinitionMessage message) throws io.deephaven.enterprise.controller.exception.ControllerSerializationException
      Deserialize a TableDefinition from gRPC.
      Parameters:
      message - the message to deserialize
      Returns:
      a new TableDefinition
      Throws:
      io.deephaven.enterprise.controller.exception.ControllerSerializationException - if a problem occurred deserializing gRPC message