Exemple #1
0
        //private static string GetXCopyArgsFormatString(string exampleFileToCopy, string baseDestnDir)
        //{
        //    string relativeDirName = FileUtils.GetDirectoryName(exampleFileToCopy);
        //    string outputDir = Path.Combine(baseDestnDir, relativeDirName);

        //    if(!Directory.Exists(outputDir))
        //        Directory.CreateDirectory(outputDir);

        //    string args = "/d /c /i \"{0}\" \"" + outputDir + "\"";
        //    return args;
        //}



        //private static List<string> GetExclusionNodes(string nodeExclusionList, int apiLevel)
        //{
        //    List<string> nodesToExclude = new List<string>();
        //    if (null != nodeExclusionList)
        //    {
        //        throw new Exception("never managed to get this to work");
        //        if (apiLevel == 1) throw new Exception("cannot use -nodeExclusionList with version 1 API");
        //        nodesToExclude = nodeExclusionList.Split(',').ToList();
        //    }
        //    return nodesToExclude;
        //}

        private static void SetPriority(ArgumentCollection argumentCollection, int apiLevel, out v1.JobPriority priorityV1, out v2008R2.Properties.JobPriority priorityV2)
        {
            priorityV1 = v1.JobPriority.Normal;
            priorityV2 = v2008R2.Properties.JobPriority.Normal;
            switch (apiLevel)
            {
            case 1:
                priorityV1 = argumentCollection.ExtractOptional <v1.JobPriority>("priority", v1.JobPriority.Normal);
                break;

            case 2:
                priorityV2 = argumentCollection.ExtractOptional <v2008R2.Properties.JobPriority>("priority", v2008R2.Properties.JobPriority.Normal);
                break;

            default:
                throw new NotSupportedException(string.Format("Cluster version {0} is not supported.", apiLevel));
            }
        }