GetReplicaCount
Retrieves the replica count for a specific replica type from a map of replica specifications. If the replica type is not found or its replica count is not specified, it returns 0 as the default value.
def GetReplicaCount(
specs: map[kubeflowv1.ReplicaType]*kubeflowv1.ReplicaSpec,
replicaType: kubeflowv1.ReplicaType
) - > *int32
Retrieves the replica count for a specific replica type from a map of replica specifications. This function is used to determine the desired number of replicas for a given component within a Kubeflow setup, returning 0 if the replica type is not found or its replica count is not explicitly set.
Parameters
| Name | Type | Description |
|---|---|---|
| specs | map[kubeflowv1.ReplicaType]*kubeflowv1.ReplicaSpec | A map containing replica specifications, where the key is the replica type and the value is a pointer to the replica's specification details. |
| replicaType | kubeflowv1.ReplicaType | The specific type of replica for which to retrieve the count (e.g., 'Worker', 'Master'). |
Returns
| Type | Description |
|---|---|
*int32 | A pointer to an integer representing the replica count for the specified replica type. Returns a pointer to 0 if the replica type is not found in the map or if its Replicas field is nil. |