Package com.azure.compute.batch.models
Class MultiInstanceSettings
java.lang.Object
com.azure.compute.batch.models.MultiInstanceSettings
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MultiInstanceSettings>
public final class MultiInstanceSettings
extends Object
implements com.azure.json.JsonSerializable<MultiInstanceSettings>
Multi-instance Tasks are commonly used to support MPI Tasks. In the MPI case,
if any of the subtasks fail (for example due to exiting with a non-zero exit
code) the entire multi-instance Task fails. The multi-instance Task is then
terminated and retried, up to its retry limit.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiInstanceSettings
(String coordinationCommandLine) Creates an instance of MultiInstanceSettings class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiInstanceSettings
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MultiInstanceSettings from the JsonReader.Get the commonResourceFiles property: A list of files that the Batch service will download before running the coordination command line.Get the coordinationCommandLine property: The command line to run on all the Compute Nodes to enable them to coordinate when the primary runs the main Task command.Get the numberOfInstances property: The number of Compute Nodes required by the Task.setCommonResourceFiles
(List<ResourceFile> commonResourceFiles) Set the commonResourceFiles property: A list of files that the Batch service will download before running the coordination command line.setNumberOfInstances
(Integer numberOfInstances) Set the numberOfInstances property: The number of Compute Nodes required by the Task.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
MultiInstanceSettings
Creates an instance of MultiInstanceSettings class.- Parameters:
coordinationCommandLine
- the coordinationCommandLine value to set.
-
-
Method Details
-
getNumberOfInstances
Get the numberOfInstances property: The number of Compute Nodes required by the Task. If omitted, the default is 1.- Returns:
- the numberOfInstances value.
-
setNumberOfInstances
Set the numberOfInstances property: The number of Compute Nodes required by the Task. If omitted, the default is 1.- Parameters:
numberOfInstances
- the numberOfInstances value to set.- Returns:
- the MultiInstanceSettings object itself.
-
getCoordinationCommandLine
Get the coordinationCommandLine property: The command line to run on all the Compute Nodes to enable them to coordinate when the primary runs the main Task command. A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages.- Returns:
- the coordinationCommandLine value.
-
getCommonResourceFiles
Get the commonResourceFiles property: A list of files that the Batch service will download before running the coordination command line. The difference between common resource files and Task resource files is that common resource files are downloaded for all subtasks including the primary, whereas Task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the Task working directory, but instead are downloaded to the Task root directory (one directory above the working directory). There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers.- Returns:
- the commonResourceFiles value.
-
setCommonResourceFiles
Set the commonResourceFiles property: A list of files that the Batch service will download before running the coordination command line. The difference between common resource files and Task resource files is that common resource files are downloaded for all subtasks including the primary, whereas Task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the Task working directory, but instead are downloaded to the Task root directory (one directory above the working directory). There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers.- Parameters:
commonResourceFiles
- the commonResourceFiles value to set.- Returns:
- the MultiInstanceSettings object itself.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<MultiInstanceSettings>
- Throws:
IOException
-
fromJson
public static MultiInstanceSettings fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of MultiInstanceSettings from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of MultiInstanceSettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the MultiInstanceSettings.
-