public ClusterAttributes WithClusterMode()

in csharp/Microsoft.Azure.Databricks.Client/Models/ClusterAttributes.cs [295:336]


    public ClusterAttributes WithClusterMode(ClusterMode clusterMode)
    {
        _clusterMode = clusterMode;

        CustomTags ??= new Dictionary<string, string>();

        SparkConfiguration ??= new Dictionary<string, string>();

        switch (clusterMode)
        {
            case ClusterMode.HighConcurrency:
                CustomTags["ResourceClass"] = "Serverless";
                SparkConfiguration["spark.databricks.cluster.profile"] = "serverless";
                SparkConfiguration.Remove("spark.master");
                break;
            case ClusterMode.SingleNode:
                CustomTags["ResourceClass"] = "SingleNode";
                SparkConfiguration["spark.databricks.cluster.profile"] = "singleNode";
                SparkConfiguration["spark.master"] = "local[*]";
                NumberOfWorkers = 0;
                break;
            case ClusterMode.Standard:
            default: // Standard mode
                CustomTags.Remove("ResourceClass");
                SparkConfiguration.Remove("spark.databricks.cluster.profile");
                SparkConfiguration.Remove("spark.master");
                break;
        }

        var allowedReplLang = DatabricksAllowedReplLang(_enableTableAccessControl, clusterMode);

        if (string.IsNullOrEmpty(allowedReplLang))
        {
            SparkConfiguration.Remove("spark.databricks.repl.allowedLanguages");
        }
        else
        {
            SparkConfiguration["spark.databricks.repl.allowedLanguages"] = allowedReplLang;
        }

        return this;
    }