private void CreateStepConfig(String name, String jarPath, String mainClass, ActionOnFailure actionOnFailure, List <String> args)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new InvalidOperationException(Resources.E_StepNameIsMissing);
            }

            if (String.IsNullOrEmpty(jarPath))
            {
                throw new InvalidOperationException(Resources.E_StepJarPathIsMissing);
            }

            HadoopJarStepConfig hadoopJarStep = new HadoopJarStepConfig();

            hadoopJarStep.Jar       = this.settings.FillPlaceHolders(jarPath);
            hadoopJarStep.MainClass = this.settings.FillPlaceHolders(mainClass);
            hadoopJarStep.Args      = this.FillPlaceHolders(args);

            StepConfig result = new StepConfig();

            result.Name            = this.settings.FillPlaceHolders(name);
            result.ActionOnFailure = actionOnFailure;
            result.HadoopJarStep   = hadoopJarStep;

            if (this.OnStepConfigCreated != null)
            {
                this.OnStepConfigCreated(this, result);
            }
        }
Example #2
0
        /// <summary>
        /// Used for XML deserialization.
        /// Populate object properties from the nested elements
        /// </summary>
        /// <param name="elementName">Xml element name</param>
        /// <param name="value">Value of the element</param>
        /// <returns>True - if was processed, false - doesn't support the specified <see cref="elementName"/></returns>
        protected override bool ReadXmlValue(string elementName, string value)
        {
            switch (elementName)
            {
            case "name":
                this.Name = value;
                break;

            case "jar":
                this.JarPath = value;
                break;

            case "actionOnFailure":
                this.ActionOnFailure = ActionOnFailure.FindValue(value);
                break;

            case "mainClass":
                this.MainClass = value;
                break;

            case "arg":
                if (this.Args == null)
                {
                    this.Args = new List <String>();
                }

                this.Args.Add(value);
                break;

            default:
                return(false);
            }

            return(true);
        }
 private void CreateStepConfig(String name, String jarPath, ActionOnFailure actionOnFailure, List <String> args)
 {
     this.CreateStepConfig(name, jarPath, null, actionOnFailure, args);
 }