Example #1
0
        internal static Payload GetDefaultPayload()
        {
            var taskContext = new TaskContext()
            {
                StageId       = 1,
                PartitionId   = 2,
                AttemptNumber = 1,
                AttemptId     = 100L,
                Port          = 9999,
                Secret        = "secret"
            };

            var broadcastVars = new BroadcastVariables()
            {
                DecryptionServerNeeded = true,
                DecryptionServerPort   = 9999,
                Secret = "secret"
            };

            return(new Payload()
            {
                SplitIndex = 10,
                Version = AssemblyInfoProvider.MicrosoftSparkAssemblyInfo().AssemblyVersion,
                TaskContext = taskContext,
                SparkFilesDir = "directory",
                IncludeItems = new[] { "file1", "file2" },
                BroadcastVariables = broadcastVars
            });
        }
Example #2
0
        public ConfigurationServiceTests()
        {
            var version = new Version(AssemblyInfoProvider.MicrosoftSparkAssemblyInfo().AssemblyVersion);

            _workerDirEnvVars = new WorkerDirEnvVars
            {
                WorkerDir = new EnvVar(ConfigurationService.DefaultWorkerDirEnvVarName),
                WorkerMajorMinorBuildDir = new EnvVar(
                    string.Format(
                        ConfigurationService.WorkerVerDirEnvVarNameFormat,
                        $"{version.Major}_{version.Minor}_{version.Build}")),
                WorkerMajorMinorDir = new EnvVar(
                    string.Format(
                        ConfigurationService.WorkerVerDirEnvVarNameFormat,
                        $"{version.Major}_{version.Minor}")),
                WorkerMajorDir = new EnvVar(
                    string.Format(ConfigurationService.WorkerVerDirEnvVarNameFormat, version.Major))
            };

            Environment.SetEnvironmentVariable(_workerDirEnvVars.WorkerDir.Name, null);
            Environment.SetEnvironmentVariable(_workerDirEnvVars.WorkerMajorMinorBuildDir.Name, null);
            Environment.SetEnvironmentVariable(_workerDirEnvVars.WorkerMajorMinorDir.Name, null);
            Environment.SetEnvironmentVariable(_workerDirEnvVars.WorkerMajorDir.Name, null);
        }