Skip to content

Commit 8786b73

Browse files
author
Dongwei Wang
committed
Save current status
1 parent 38f037d commit 8786b73

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

src/Synapse/Synapse/Common/HelpMessages.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,5 +430,9 @@ SELECT on dbo.myTable by public
430430
public const string SqlScriptName = "The SQL Script name.";
431431

432432
public const string SqlScriptObject = "The SQL script object.";
433+
434+
public const string SparkJobDefinitionName = "The Spark job definition name.";
435+
436+
public const string SparkJobDefinitionObject = "The Spark job definition object.";
433437
}
434438
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Azure.Analytics.Synapse.Artifacts.Models;
2+
3+
namespace Microsoft.Azure.Commands.Synapse.Models
4+
{
5+
public class PSSparkJobDefinition
6+
{
7+
public PSSparkJobDefinition(SparkJobDefinition properties)
8+
{
9+
Description = properties?.Description;
10+
TargetBigDataPool = properties?.TargetBigDataPool != null ? new PSBigDataPoolReference(properties.TargetBigDataPool) : null;
11+
RequiredSparkVersion = properties?.RequiredSparkVersion;
12+
JobProperties = properties?.JobProperties;
13+
}
14+
15+
/// <summary> The description of the Spark job definition. </summary>
16+
public string Description { get; set; }
17+
18+
/// <summary> Big data pool reference. </summary>
19+
public PSBigDataPoolReference TargetBigDataPool { get; set; }
20+
21+
/// <summary> The required Spark version of the application. </summary>
22+
public string RequiredSparkVersion { get; set; }
23+
24+
/// <summary> The language of the Spark application. </summary>
25+
public string Language { get; set; }
26+
27+
/// <summary> The properties of the Spark job. </summary>
28+
public PSSparkJobProperties JobProperties { get; set; }
29+
}
30+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Azure.Analytics.Synapse.Artifacts.Models;
2+
3+
namespace Microsoft.Azure.Commands.Synapse.Models
4+
{
5+
public class PSSparkJobDefinitionResource : PSSubResource
6+
{
7+
public PSSparkJobDefinitionResource(SparkJobDefinitionResource sparkJobDefinition)
8+
: base(sparkJobDefinition.Id, sparkJobDefinition.Name, sparkJobDefinition.Type, sparkJobDefinition.Etag)
9+
{
10+
Properties = sparkJobDefinition?.Properties != null ? new PSSparkJobDefinition(sparkJobDefinition.Properties) : null;
11+
}
12+
13+
/// <summary> Properties of spark job definition. </summary>
14+
public PSSparkJobDefinition Properties { get; set; }
15+
}
16+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using Azure.Analytics.Synapse.Artifacts.Models;
2+
using System.Collections.Generic;
3+
4+
namespace Microsoft.Azure.Commands.Synapse.Models
5+
{
6+
public class PSSparkJobProperties
7+
{
8+
public PSSparkJobProperties(SparkJobProperties sparkJobProperties)
9+
{
10+
this.Name = sparkJobProperties.Name;
11+
this.File = sparkJobProperties.File;
12+
this.ClassName = sparkJobProperties.ClassName;
13+
this.Configuration = sparkJobProperties.Conf;
14+
this.Arguments = sparkJobProperties.Args;
15+
this.Jars = sparkJobProperties.Files;
16+
this.Archives = sparkJobProperties.Archives;
17+
this.DriverMemory = sparkJobProperties.DriverMemory;
18+
this.DriverCores = sparkJobProperties.DriverCores;
19+
this.ExecutorMemory = sparkJobProperties.ExecutorMemory;
20+
this.ExecutorCores = sparkJobProperties.ExecutorCores;
21+
this.NumberOfExecutors = sparkJobProperties.NumExecutors;
22+
}
23+
24+
/// <summary> The name of the job. </summary>
25+
public string Name { get; set; }
26+
27+
/// <summary> File containing the application to execute. </summary>
28+
public string File { get; set; }
29+
30+
/// <summary> Main class for Java/Scala application. </summary>
31+
public string ClassName { get; set; }
32+
33+
/// <summary> Spark configuration properties. </summary>
34+
public object Configuration { get; set; }
35+
36+
/// <summary> Command line arguments for the application. </summary>
37+
public IList<string> Arguments { get; }
38+
39+
/// <summary> Jars to be used in this job. </summary>
40+
public IList<string> Jars { get; }
41+
42+
/// <summary> files to be used in this job. </summary>
43+
public IList<string> Files { get; }
44+
45+
/// <summary> Archives to be used in this job. </summary>
46+
public IList<string> Archives { get; }
47+
48+
/// <summary> Amount of memory to use for the driver process. </summary>
49+
public string DriverMemory { get; set; }
50+
51+
/// <summary> Number of cores to use for the driver. </summary>
52+
public int DriverCores { get; set; }
53+
54+
/// <summary> Amount of memory to use per executor process. </summary>
55+
public string ExecutorMemory { get; set; }
56+
57+
/// <summary> Number of cores to use for each executor. </summary>
58+
public int ExecutorCores { get; set; }
59+
60+
/// <summary> Number of executors to launch for this job. </summary>
61+
public int NumberOfExecutors { get; set; }
62+
}
63+
}

0 commit comments

Comments
 (0)