Class DndScriptExecutor
java.lang.Object
com.illumon.iris.db.tables.remotequery.client.DndScriptExecutor
Requests DnD worker creation via dispatcher and executes a script on said worker startup.
For programmatic access to DnD worker process info id on failure, handle
DndScriptExecutor.DndScriptExecutionFailure.
Borrows code from DhcInDhe/README.md for remotely starting a DnD worker.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOn DnD script execution failure, this exception contains process info id along with full trace. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeprecated.static StringsendRequest(String host, String workerKind, String scriptLanguage, File file, int requestTimeout, int maxHeapSizeMb) Variation ofsendRequest(String, String, String, String, int, int)that uses filestatic StringsendRequest(String host, String workerKind, String scriptLanguage, String startupScript, int requestTimeout, int maxHeapSizeMb) SeeDndScriptExecutordescription.
-
Constructor Details
-
DndScriptExecutor
public DndScriptExecutor()
-
-
Method Details
-
main
Deprecated.Standalone program deprecated b/c it's not robustly tested. API methods are.- Throws:
Exception
-
sendRequest
public static String sendRequest(String host, String workerKind, String scriptLanguage, String startupScript, int requestTimeout, int maxHeapSizeMb) throws IOException SeeDndScriptExecutordescription.- Parameters:
host- dispatcher host to request worker fromworkerKind- name of desiredWorkerKindscriptLanguage- language to execute startupScriptstartupScript- string of startup script to executerequestTimeout- timeout for dispatcher request in msmaxHeapSizeMb- max heap size for requested worker in mb- Returns:
- process info id of requested DnD worker
- Throws:
IOException- on dispatcher connection failure
-
sendRequest
public static String sendRequest(String host, String workerKind, String scriptLanguage, File file, int requestTimeout, int maxHeapSizeMb) throws IOException Variation ofsendRequest(String, String, String, String, int, int)that uses file- Throws:
IOException
-