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 int
getReplicaNum
(ReplicaSpecifier specifier) makeControllerConfigMessage
(PersistentQueryControllerConfiguration serverConfiguration, Predicate<ConsoleConfigurationType> configTypePredicate) Serialize aPersistentQueryControllerConfiguration
for gRPCmakeDbServerConfig
(PQDBServerConfigMessage configMessage) Deserialize aPersistentQueryDbServerConfig
from gRPC.static ExportedObjectInfo
Deserialize anExportedObjectInfo
from gRPC.static ExportedObjectInfoMessage
makeExportedObjectInfoMessage
(String name, ExportedObjectInfo type) Make anExportedObjectInfoMessage
from a name andExportedObjectInfo
static NamedStringList
makeNamedStringList
(String name, String[] list) Create aNamedStringList
object from a string array and name.static NamedStringList
makeNamedStringList
(String name, Collection<String> list) Create aNamedStringList
object from a collection of strings and name.Deserialize aPersistentQueryControllerConfiguration
from gRPCstatic PQDBServerConfigMessage
Serialize aPersistentQueryDbServerConfig
object for gRPCstatic PersistentQueryConfiguration
makeQueryConfig
(PersistentQueryConfigMessage configMessage) Deserialize aPersistentQueryConfiguration
from gRPC.static PersistentQueryConfigMessage
Serialize aPersistentQueryConfiguration
object for gRPC.static PersistentQueryInfo
makeQueryInfo
(PersistentQueryInfoMessage infoMessage) Deserialize aPersistentQueryInfo
from gRPC.static PersistentQueryInfoMessage
makeQueryInfoMessage
(PersistentQueryInfo info, WorkerUrlBuilder workerUrlBuilder, UserContext forUser, IrisGroupProvider groupProvider, int designatedSlot) Serialize aPersistentQueryInfo
object for gRPC.static PersistentQueryState
makeQueryState
(PersistentQueryStateMessage stateMessage) static PersistentQueryStateMessage
makeStateMessageForPresenceKv
(PersistentQueryState state, WorkerUrlBuilder workerUrlBuilder) Creates a PersistetQueryStateMessage with the PersistentQueryState provided.static PersistentQueryState.Status
makeStatus
(PersistentQueryStatusEnum grpcStatus) Deserialize aPersistentQueryState.Status
from gRPC.static TableDefinition
Deserialize aTableDefinition
from gRPC.static io.deephaven.enterprise.dispatcher.client.WorkerProtocol
makeWorkerProtocol
(WorkerProtocolMessage protocolMessage) Deserialize aWorkerProtocol
from 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 aPersistentQueryInfo
object 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 aPersistentQueryConfiguration
object 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 aNamedStringList
object 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 aNamedStringList
object 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 anExportedObjectInfoMessage
from 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 aPersistentQueryDbServerConfig
object 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 aPersistentQueryControllerConfiguration
for 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 aPersistentQueryInfo
from 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 aWorkerProtocol
from gRPC.- Parameters:
protocolMessage
- the message to deserialize- Returns:
- a new
WorkerProtocol
-
makeQueryConfig
public static PersistentQueryConfiguration makeQueryConfig(PersistentQueryConfigMessage configMessage) throws ControllerSerializationException Deserialize aPersistentQueryConfiguration
from 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.Status
from 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 aPersistentQueryDbServerConfig
from 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 aPersistentQueryControllerConfiguration
from 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 anExportedObjectInfo
from gRPC.- Parameters:
eo
- the message to deserialize- Returns:
- a new
ExportedObjectInfo
- Throws:
ControllerSerializationException
- if a problem occurred deserializing gRPC message
-
makeTableDefinition
public static TableDefinition makeTableDefinition(@NotNull TableDefinitionMessage message) throws ControllerSerializationException Deserialize aTableDefinition
from gRPC.- Parameters:
message
- the message to deserialize- Returns:
- a new
TableDefinition
- Throws:
ControllerSerializationException
- if a problem occurred deserializing gRPC message
-
getReplicaNum
-