% Spark - Scheduler Component for Spark

%   Copyright 2023 The MathWorks, Inc.

% NB This class is hidden for now as the Profiles API is not yet documented
classdef (Hidden, Sealed) Spark < parallel.settings.schedulerComponent.ThirdPartyCJS
    properties (PCTGetSet, Transient, PCTConstraint = 'string')
        SparkInstallFolder = string(missing)
    end

    properties (PCTGetSet, Transient, PCTConstraint = 'sparkproperties')
        SparkProperties = parallel.cluster.SparkProperties
    end

    methods (Hidden, Static)
        function obj = hBuildFromSettings(name, settingsNode, parentSettingsNode, varargin) 
            obj = parallel.settings.schedulerComponent.Spark(name, settingsNode, parentSettingsNode, varargin{:});
        end
    end

    methods (Access = private)
        function obj = Spark(name, node, parentNode, varargin)
            import parallel.internal.types.SchedulerType
            obj@parallel.settings.schedulerComponent.ThirdPartyCJS(name, ...
                SchedulerType.Spark, node, parentNode, varargin{:});
        end
    end

    methods (Hidden)
       function [n, f] = hCustomizeDisplay(obj, level)
            n = {'SparkInstallFolder', 'SparkProperties'};
            if nargin < 2
                f = obj.get(n);
            else
                f = cellfun(@(x) obj.get(x, level), n, 'UniformOutput', false);
            end
       end
    end
end
