Class RemoteQueryUtils
java.lang.Object
com.illumon.iris.db.tables.remotequery.RemoteQueryUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.deephaven.enterprise.comm.api.DynamicCommClientPolicystatic final io.deephaven.enterprise.niowrapper.sched.IOParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckCommandArgs(String source, int type, boolean allowNullValues, Object[] args, Class<?>... expectedArgTypes) Validate that the provided arguments are of the correct type or throw an IllegalCommandException.static voidcheckCommandArgs(String source, int type, Object[] args, Class<?>... expectedArgTypes) Validate that the provided arguments are of the correct type or throw an IllegalCommandException.static voidcheckResponse(String source, Object[] responseArgs, Class<?>... expectedArgTypes) Check command responses from RemoteQueryDispatcher/RemoteQueryProcessor and similar servers.static voidcheckResponse2(String source, Object[] responseArgs, Class<?>... expectedArgTypes) Check command responses from WeepsController/DbAclWriteServer and similar servers.static IrisGroupProvidermakeGroupProvider(com.fishlib.io.logger.Logger log, Database database) Creates a group provider using the supplied database.static IrisDbGroovySessionsetupGroovySessionAndQueryScope(com.fishlib.io.logger.Logger log, String hostName, String queryName, Database database) Run this in the worker (via ContextAwareRemoteQuery to create a groovy session and setup the compiler context and query scope appropriately.static voidsetupQueryScope(ScriptSession scriptSession, String hostName, String queryName) Creates a query scope using the supplied scriptSession; and sets the hostname and query name parameters within it.static StringtranslateHostName(String hostName) static StringtruncateHostName(String hostName) static StringtruncateHostName(String hostName, Iterable<String> suffixesToTruncate)
-
Field Details
-
DEFAULT_CONNECTION_POLICY
public static final io.deephaven.enterprise.comm.api.DynamicCommClientPolicy DEFAULT_CONNECTION_POLICY -
SERVER_IO_PARAMETERS
public static final io.deephaven.enterprise.niowrapper.sched.IOParameters SERVER_IO_PARAMETERS
-
-
Constructor Details
-
RemoteQueryUtils
public RemoteQueryUtils()
-
-
Method Details
-
checkCommandArgs
public static void checkCommandArgs(String source, int type, Object[] args, Class<?>... expectedArgTypes) throws IllegalArgumentException Validate that the provided arguments are of the correct type or throw an IllegalCommandException. Allow null argument values.- Parameters:
source- The name of the source for logging purposestype- The command typeargs- The arguments to validateexpectedArgTypes- The expected argument types- Throws:
IllegalArgumentException- if the number of arguments is incorrect, or the arguments are not of the correct type
-
checkCommandArgs
public static void checkCommandArgs(String source, int type, boolean allowNullValues, Object[] args, Class<?>... expectedArgTypes) throws IllegalArgumentException Validate that the provided arguments are of the correct type or throw an IllegalCommandException.- Parameters:
source- The name of the source for logging purposestype- The command typeallowNullValues- If true, then allow null argument valuesargs- The arguments to validateexpectedArgTypes- The expected argument types- Throws:
IllegalArgumentException- if the number of arguments is incorrect, or the arguments are not of the correct type, or a null argument is provided when allowNullValues is false
-
checkResponse
public static void checkResponse(String source, Object[] responseArgs, Class<?>... expectedArgTypes) Check command responses from RemoteQueryDispatcher/RemoteQueryProcessor and similar servers.- Parameters:
source-responseArgs-expectedArgTypes-
-
checkResponse2
public static void checkResponse2(String source, Object[] responseArgs, Class<?>... expectedArgTypes) Check command responses from WeepsController/DbAclWriteServer and similar servers.- Parameters:
source-responseArgs-expectedArgTypes-
-
truncateHostName
-
truncateHostName
-
translateHostName
-
getLocalHostNames
-
setupGroovySessionAndQueryScope
public static IrisDbGroovySession setupGroovySessionAndQueryScope(com.fishlib.io.logger.Logger log, String hostName, String queryName, Database database) Run this in the worker (via ContextAwareRemoteQuery to create a groovy session and setup the compiler context and query scope appropriately.- Parameters:
log-hostName-queryName-database-- Returns:
-
setupQueryScope
Creates a query scope using the supplied scriptSession; and sets the hostname and query name parameters within it. The new query scope is then set as the default query scope.- Parameters:
scriptSession- the scriptSession to wrap in a QueryScope.ScriptSessionImplhostName- the hostname for the QueryScope.CLIENT_HOST_PARAM_NAME variablequeryName- the query name for the QueryScope.QUERY_NAME_PARAM_NAME variable
-
makeGroupProvider
public static IrisGroupProvider makeGroupProvider(com.fishlib.io.logger.Logger log, Database database) Creates a group provider using the supplied database.- Parameters:
log- the loggerdatabase- the database- Returns:
- a group provider
-