Class ControllerGrpcHelper
java.lang.Object
com.illumon.iris.controller.utils.ControllerGrpcHelper
This class contains utilities for packing and unpacking objects for gRPC communication.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.deephaven.shadow.core.io.grpc.Metadata.Key<ErrorResponse> -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetReplicaNum(ReplicaSpecifier specifier) makeControllerConfigMessage(PersistentQueryControllerConfiguration serverConfiguration, Predicate<ConsoleConfigurationType> configTypePredicate) Serialize aPersistentQueryControllerConfigurationfor gRPCmakeDbServerConfig(PQDBServerConfigMessage configMessage) Deserialize aPersistentQueryDbServerConfigfrom gRPC.static ExportedObjectInfoDeserialize anExportedObjectInfofrom gRPC.static ExportedObjectInfoMessagemakeExportedObjectInfoMessage(String name, ExportedObjectInfo type) Make anExportedObjectInfoMessagefrom a name andExportedObjectInfostatic NamedStringListmakeNamedStringList(String name, String[] list) Create aNamedStringListobject from a string array and name.static NamedStringListmakeNamedStringList(String name, Collection<String> list) Create aNamedStringListobject from a collection of strings and name.Deserialize aPersistentQueryControllerConfigurationfrom gRPCstatic PQDBServerConfigMessageSerialize aPersistentQueryDbServerConfigobject for gRPCstatic PersistentQueryConfigurationmakeQueryConfig(PersistentQueryConfigMessage configMessage) Deserialize aPersistentQueryConfigurationfrom gRPC.static PersistentQueryConfigMessageSerialize aPersistentQueryConfigurationobject for gRPC.static PersistentQueryInfomakeQueryInfo(PersistentQueryInfoMessage infoMessage) Deserialize aPersistentQueryInfofrom gRPC.static PersistentQueryInfoMessagemakeQueryInfoMessage(PersistentQueryInfo info, WorkerUrlBuilder workerUrlBuilder, UserContext forUser, IrisGroupProvider groupProvider, int designatedSlot) Serialize aPersistentQueryInfoobject for gRPC.static PersistentQueryStatemakeQueryState(PersistentQueryStateMessage stateMessage) static PersistentQueryStateMessagemakeStateMessageForPresenceKv(PersistentQueryState state, WorkerUrlBuilder workerUrlBuilder) Creates a PersistetQueryStateMessage with the PersistentQueryState provided.static PersistentQueryState.StatusmakeStatus(PersistentQueryStatusEnum grpcStatus) Deserialize aPersistentQueryState.Statusfrom gRPC.static TableDefinitionDeserialize aTableDefinitionfrom gRPC.static io.deephaven.enterprise.dispatcher.client.WorkerProtocolmakeWorkerProtocol(WorkerProtocolMessage protocolMessage) Deserialize aWorkerProtocolfrom gRPC.
-
Field Details
-
ERROR_KEY
-
-
Method Details
-
makeQueryInfoMessage
public static PersistentQueryInfoMessage makeQueryInfoMessage(@NotNull PersistentQueryInfo info, @NotNull WorkerUrlBuilder workerUrlBuilder, @Nullable UserContext forUser, @Nullable IrisGroupProvider groupProvider, int designatedSlot) throws ControllerSerializationException Serialize aPersistentQueryInfoobject for gRPC.- Parameters:
info- the object to serializeworkerUrlBuilder- the builder for constructing worker URLsforUser- the user this is destined forgroupProvider- the group provider for determining filters and access.designatedSlot- the worker slot the user will be assigned to.- Returns:
- the serialized
PersistentQueryInfoMessage - Throws:
ControllerSerializationException- if a problem occurred converting the message to gRPC
-
makeQueryConfigMessage
public static PersistentQueryConfigMessage makeQueryConfigMessage(@NotNull PersistentQueryConfiguration config) throws ControllerSerializationException Serialize aPersistentQueryConfigurationobject for gRPC.- Parameters:
config- the object to serialize- Returns:
- the serialized
PersistentQueryConfigMessage - Throws:
ControllerSerializationException- if a problem occurred converting the message to gRPC
-
makeStateMessageForPresenceKv
public static PersistentQueryStateMessage makeStateMessageForPresenceKv(@NotNull PersistentQueryState state, @NotNull WorkerUrlBuilder workerUrlBuilder) throws ControllerSerializationException Creates a PersistetQueryStateMessage with the PersistentQueryState provided.- Parameters:
state- the state to use as data to populate the returned messageworkerUrlBuilder- the worker url build to use for the respective fields- Returns:
- a new state message matching the supplied data
- Throws:
ControllerSerializationException- if there are any errors during serialization
-
makeNamedStringList
Create aNamedStringListobject from a string array and name.- Parameters:
name- the name to uselist- the array of values- Returns:
- a new
NamedStringList
-
makeNamedStringList
@NotNull public static NamedStringList makeNamedStringList(@NotNull String name, @Nullable Collection<String> list) Create aNamedStringListobject from a collection of strings and name.- Parameters:
name- the name to uselist- the collection of values- Returns:
- a new
NamedStringList
-
makeExportedObjectInfoMessage
public static ExportedObjectInfoMessage makeExportedObjectInfoMessage(@NotNull String name, @NotNull ExportedObjectInfo type) throws ControllerSerializationException Make anExportedObjectInfoMessagefrom a name andExportedObjectInfo- Parameters:
name- the name of the objecttype- theExportedObjectInfo- Returns:
- a new
ExportedObjectInfoMessage - Throws:
ControllerSerializationException- if a problem occurred converting the message to gRPC
-
makePQDBServerConfigMessage
public static PQDBServerConfigMessage makePQDBServerConfigMessage(@NotNull PersistentQueryDbServerConfig config) throws ControllerSerializationException Serialize aPersistentQueryDbServerConfigobject for gRPC- Parameters:
config- the configuration to serialize- Returns:
- a new
PersistentQueryDbServerConfig - Throws:
ControllerSerializationException- if a problem occurred converting the message to gRPC
-
makeControllerConfigMessage
public static ControllerConfigurationMessage makeControllerConfigMessage(@NotNull PersistentQueryControllerConfiguration serverConfiguration, @NotNull Predicate<ConsoleConfigurationType> configTypePredicate) throws ControllerSerializationException Serialize aPersistentQueryControllerConfigurationfor gRPC- Parameters:
serverConfiguration- the configuration to serialize- Returns:
- a new
ControllerConfigurationMessage - Throws:
ControllerSerializationException- if a problem occurred converting the message to gRPC
-
makeQueryInfo
public static PersistentQueryInfo makeQueryInfo(@NotNull PersistentQueryInfoMessage infoMessage) throws ControllerSerializationException Deserialize aPersistentQueryInfofrom gRPC.- Parameters:
infoMessage- the message to deserialize- Returns:
- a new
PersistentQueryInfo - Throws:
ControllerSerializationException- if a problem occurred deserializing gRPC message
-
makeQueryState
public static PersistentQueryState makeQueryState(@NotNull PersistentQueryStateMessage stateMessage) throws ControllerSerializationException - Throws:
ControllerSerializationException
-
makeWorkerProtocol
public static io.deephaven.enterprise.dispatcher.client.WorkerProtocol makeWorkerProtocol(@NotNull WorkerProtocolMessage protocolMessage) Deserialize aWorkerProtocolfrom gRPC.- Parameters:
protocolMessage- the message to deserialize- Returns:
- a new
WorkerProtocol
-
makeQueryConfig
public static PersistentQueryConfiguration makeQueryConfig(PersistentQueryConfigMessage configMessage) throws ControllerSerializationException Deserialize aPersistentQueryConfigurationfrom gRPC.- Parameters:
configMessage- the message to deserialize- Returns:
- a new
PersistentQueryConfiguration - Throws:
ControllerSerializationException- if a problem occurred deserializing gRPC message
-
makeStatus
public static PersistentQueryState.Status makeStatus(@NotNull PersistentQueryStatusEnum grpcStatus) throws ControllerSerializationException Deserialize aPersistentQueryState.Statusfrom gRPC.- Parameters:
grpcStatus- the message to deserialize- Returns:
- a new
PersistentQueryState.Status. - Throws:
ControllerSerializationException- if a problem occurred deserializing gRPC message
-
makeDbServerConfig
public static PersistentQueryDbServerConfig makeDbServerConfig(PQDBServerConfigMessage configMessage) throws ControllerSerializationException Deserialize aPersistentQueryDbServerConfigfrom gRPC.- Parameters:
configMessage- the message to deserialize- Returns:
- a new
PersistentQueryDbServerConfig - Throws:
ControllerSerializationException- if a problem occurred deserializing gRPC message
-
makePersistentQueryControllerConfiguration
public static PersistentQueryControllerConfiguration makePersistentQueryControllerConfiguration(@NotNull ControllerConfigurationMessage response) throws ControllerSerializationException Deserialize aPersistentQueryControllerConfigurationfrom gRPC- Parameters:
response- the message to deserialize- Returns:
- a new
PersistentQueryControllerConfiguration - Throws:
ControllerSerializationException- if a problem occurred deserializing gRPC message
-
makeExportedObjectInfo
public static ExportedObjectInfo makeExportedObjectInfo(ExportedObjectInfoMessage eo) throws ControllerSerializationException Deserialize anExportedObjectInfofrom gRPC.- Parameters:
eo- the message to deserialize- Returns:
- a new
ExportedObjectInfo - Throws:
ControllerSerializationException- if a problem occurred deserializing gRPC message
-
makeTableDefinition
Deserialize aTableDefinitionfrom gRPC.- Parameters:
message- the message to deserialize- Returns:
- a new
TableDefinitionor null if the message does not contain a table definition, or the table definition cannot be deserialized (for example a missing custom class)
-
getReplicaNum
-