示例#1
0
        private string CreateBootstrapAvroAppConfig(AppParameters appParameters, string driverFolder)
        {
            var paramInjector = TangFactory.GetTang().NewInjector(appParameters.DriverConfigurations.ToArray());

            var bootstrapAppArgs = new AvroAppSubmissionParameters
            {
                tcpBeginPort  = paramInjector.GetNamedInstance <TcpPortRangeStart, int>(),
                tcpRangeCount = paramInjector.GetNamedInstance <TcpPortRangeCount, int>(),
                tcpTryCount   = paramInjector.GetNamedInstance <TcpPortRangeTryCount, int>(),
            };

            var avroLocalBootstrapAppArgs = new AvroLocalAppSubmissionParameters
            {
                sharedAppSubmissionParameters   = bootstrapAppArgs,
                maxNumberOfConcurrentEvaluators = _maxNumberOfConcurrentEvaluators
            };

            var submissionArgsFilePath = Path.Combine(driverFolder, _fileNames.GetAppSubmissionParametersFile());

            using (var argsFileStream = new FileStream(submissionArgsFilePath, FileMode.CreateNew))
            {
                var serializedArgs = AvroJsonSerializer <AvroLocalAppSubmissionParameters> .ToBytes(avroLocalBootstrapAppArgs);

                argsFileStream.Write(serializedArgs, 0, serializedArgs.Length);
            }

            return(submissionArgsFilePath);
        }
        internal byte[] SerializeAppArgsToBytes(AppParameters appParameters, IInjector paramInjector)
        {
            var avroAppSubmissionParameters = new AvroAppSubmissionParameters
            {
                tcpBeginPort  = paramInjector.GetNamedInstance <TcpPortRangeStart, int>(),
                tcpRangeCount = paramInjector.GetNamedInstance <TcpPortRangeCount, int>(),
                tcpTryCount   = paramInjector.GetNamedInstance <TcpPortRangeTryCount, int>()
            };

            var avroYarnAppSubmissionParameters = new AvroYarnAppSubmissionParameters
            {
                sharedAppSubmissionParameters = avroAppSubmissionParameters,
                driverRecoveryTimeout         = paramInjector.GetNamedInstance <DriverBridgeConfigurationOptions.DriverRestartEvaluatorRecoverySeconds, int>()
            };

            return(AvroJsonSerializer <AvroYarnAppSubmissionParameters> .ToBytes(avroYarnAppSubmissionParameters));
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AvroYarnAppSubmissionParameters"/> class.
 /// </summary>
 /// <param name="sharedAppSubmissionParameters">The sharedAppSubmissionParameters.</param>
 /// <param name="driverRecoveryTimeout">The driverRecoveryTimeout.</param>
 public AvroYarnAppSubmissionParameters(AvroAppSubmissionParameters sharedAppSubmissionParameters, int driverRecoveryTimeout)
 {
     this.sharedAppSubmissionParameters = sharedAppSubmissionParameters;
     this.driverRecoveryTimeout         = driverRecoveryTimeout;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AvroLocalAppSubmissionParameters"/> class.
 /// </summary>
 /// <param name="sharedAppSubmissionParameters">The sharedAppSubmissionParameters.</param>
 /// <param name="maxNumberOfConcurrentEvaluators">The maxNumberOfConcurrentEvaluators.</param>
 public AvroLocalAppSubmissionParameters(AvroAppSubmissionParameters sharedAppSubmissionParameters, int maxNumberOfConcurrentEvaluators)
 {
     this.sharedAppSubmissionParameters = sharedAppSubmissionParameters;
     this.maxNumberOfConcurrentEvaluators = maxNumberOfConcurrentEvaluators;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AvroYarnAppSubmissionParameters"/> class.
 /// </summary>
 /// <param name="sharedAppSubmissionParameters">The sharedAppSubmissionParameters.</param>
 /// <param name="driverMemory">The driverMemory.</param>
 /// <param name="driverRecoveryTimeout">The driverRecoveryTimeout.</param>
 public AvroYarnAppSubmissionParameters(AvroAppSubmissionParameters sharedAppSubmissionParameters, int driverMemory, int driverRecoveryTimeout)
 {
     this.sharedAppSubmissionParameters = sharedAppSubmissionParameters;
     this.driverMemory = driverMemory;
     this.driverRecoveryTimeout = driverRecoveryTimeout;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AvroLocalAppSubmissionParameters"/> class.
 /// </summary>
 /// <param name="sharedAppSubmissionParameters">The sharedAppSubmissionParameters.</param>
 /// <param name="maxNumberOfConcurrentEvaluators">The maxNumberOfConcurrentEvaluators.</param>
 public AvroLocalAppSubmissionParameters(AvroAppSubmissionParameters sharedAppSubmissionParameters, int maxNumberOfConcurrentEvaluators)
 {
     this.sharedAppSubmissionParameters   = sharedAppSubmissionParameters;
     this.maxNumberOfConcurrentEvaluators = maxNumberOfConcurrentEvaluators;
 }