software.amazon.awscdk.services.glue.alpha.PythonSparkJobExecutableProps Maven / Gradle / Ivy
Show all versions of glue-alpha Show documentation
package software.amazon.awscdk.services.glue.alpha;
/**
* (experimental) Props for creating a Python Spark (ETL or Streaming) job executable.
*
* Example:
*
*
* Job.Builder.create(this, "PythonSparkStreamingJob")
* .executable(JobExecutable.pythonStreaming(PythonSparkJobExecutableProps.builder()
* .glueVersion(GlueVersion.V4_0)
* .pythonVersion(PythonVersion.THREE)
* .script(Code.fromAsset(join(__dirname, "job-script", "hello_world.py")))
* .build()))
* .description("an example Python Streaming job")
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.99.0 (build 8f757e4)", date = "2024-06-13T18:49:27.685Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.glue.alpha.$Module.class, fqn = "@aws-cdk/aws-glue-alpha.PythonSparkJobExecutableProps")
@software.amazon.jsii.Jsii.Proxy(PythonSparkJobExecutableProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface PythonSparkJobExecutableProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Glue version.
*
* @see https://docs.aws.amazon.com/glue/latest/dg/release-notes.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.GlueVersion getGlueVersion();
/**
* (experimental) The Python version to use.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.PythonVersion getPythonVersion();
/**
* (experimental) The script that executes a job.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.Code getScript();
/**
* (experimental) Additional files, such as configuration files that AWS Glue copies to the working directory of your script before executing it.
*
* Only individual files are supported, directories are not supported.
* Equivalent to a job parameter --extra-files
.
*
* Default: [] - no extra files are copied to the working directory
*
* @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getExtraFiles() {
return null;
}
/**
* (experimental) Additional Java .jar files that AWS Glue adds to the Java classpath before executing your script. Only individual files are supported, directories are not supported. Equivalent to a job parameter --extra-jars
.
*
* Default: [] - no extra jars are added to the classpath
*
* @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getExtraJars() {
return null;
}
/**
* (experimental) Setting this value to true prioritizes the customer's extra JAR files in the classpath.
*
* Equivalent to a job parameter --user-jars-first
.
*
* Default: false - priority is not given to user-provided jars
*
* @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getExtraJarsFirst() {
return null;
}
/**
* (experimental) Additional Python files that AWS Glue adds to the Python path before executing your script.
*
* Only individual files are supported, directories are not supported.
* Equivalent to a job parameter --extra-py-files
.
*
* Default: - no extra python files and argument is not set
*
* @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getExtraPythonFiles() {
return null;
}
/**
* (experimental) Runtime.
*
* It is required for Ray jobs.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.glue.alpha.Runtime getRuntime() {
return null;
}
/**
* @return a {@link Builder} of {@link PythonSparkJobExecutableProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link PythonSparkJobExecutableProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.glue.alpha.GlueVersion glueVersion;
software.amazon.awscdk.services.glue.alpha.PythonVersion pythonVersion;
software.amazon.awscdk.services.glue.alpha.Code script;
java.util.List extraFiles;
java.util.List extraJars;
java.lang.Boolean extraJarsFirst;
java.util.List extraPythonFiles;
software.amazon.awscdk.services.glue.alpha.Runtime runtime;
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getGlueVersion}
* @param glueVersion Glue version. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder glueVersion(software.amazon.awscdk.services.glue.alpha.GlueVersion glueVersion) {
this.glueVersion = glueVersion;
return this;
}
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getPythonVersion}
* @param pythonVersion The Python version to use. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder pythonVersion(software.amazon.awscdk.services.glue.alpha.PythonVersion pythonVersion) {
this.pythonVersion = pythonVersion;
return this;
}
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getScript}
* @param script The script that executes a job. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder script(software.amazon.awscdk.services.glue.alpha.Code script) {
this.script = script;
return this;
}
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getExtraFiles}
* @param extraFiles Additional files, such as configuration files that AWS Glue copies to the working directory of your script before executing it.
* Only individual files are supported, directories are not supported.
* Equivalent to a job parameter --extra-files
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder extraFiles(java.util.List extends software.amazon.awscdk.services.glue.alpha.Code> extraFiles) {
this.extraFiles = (java.util.List)extraFiles;
return this;
}
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getExtraJars}
* @param extraJars Additional Java .jar files that AWS Glue adds to the Java classpath before executing your script. Only individual files are supported, directories are not supported. Equivalent to a job parameter --extra-jars
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder extraJars(java.util.List extends software.amazon.awscdk.services.glue.alpha.Code> extraJars) {
this.extraJars = (java.util.List)extraJars;
return this;
}
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getExtraJarsFirst}
* @param extraJarsFirst Setting this value to true prioritizes the customer's extra JAR files in the classpath.
* Equivalent to a job parameter --user-jars-first
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder extraJarsFirst(java.lang.Boolean extraJarsFirst) {
this.extraJarsFirst = extraJarsFirst;
return this;
}
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getExtraPythonFiles}
* @param extraPythonFiles Additional Python files that AWS Glue adds to the Python path before executing your script.
* Only individual files are supported, directories are not supported.
* Equivalent to a job parameter --extra-py-files
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder extraPythonFiles(java.util.List extends software.amazon.awscdk.services.glue.alpha.Code> extraPythonFiles) {
this.extraPythonFiles = (java.util.List)extraPythonFiles;
return this;
}
/**
* Sets the value of {@link PythonSparkJobExecutableProps#getRuntime}
* @param runtime Runtime.
* It is required for Ray jobs.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder runtime(software.amazon.awscdk.services.glue.alpha.Runtime runtime) {
this.runtime = runtime;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link PythonSparkJobExecutableProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public PythonSparkJobExecutableProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link PythonSparkJobExecutableProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements PythonSparkJobExecutableProps {
private final software.amazon.awscdk.services.glue.alpha.GlueVersion glueVersion;
private final software.amazon.awscdk.services.glue.alpha.PythonVersion pythonVersion;
private final software.amazon.awscdk.services.glue.alpha.Code script;
private final java.util.List extraFiles;
private final java.util.List extraJars;
private final java.lang.Boolean extraJarsFirst;
private final java.util.List extraPythonFiles;
private final software.amazon.awscdk.services.glue.alpha.Runtime runtime;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.glueVersion = software.amazon.jsii.Kernel.get(this, "glueVersion", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.GlueVersion.class));
this.pythonVersion = software.amazon.jsii.Kernel.get(this, "pythonVersion", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.PythonVersion.class));
this.script = software.amazon.jsii.Kernel.get(this, "script", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.Code.class));
this.extraFiles = software.amazon.jsii.Kernel.get(this, "extraFiles", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.Code.class)));
this.extraJars = software.amazon.jsii.Kernel.get(this, "extraJars", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.Code.class)));
this.extraJarsFirst = software.amazon.jsii.Kernel.get(this, "extraJarsFirst", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.extraPythonFiles = software.amazon.jsii.Kernel.get(this, "extraPythonFiles", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.Code.class)));
this.runtime = software.amazon.jsii.Kernel.get(this, "runtime", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.Runtime.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.glueVersion = java.util.Objects.requireNonNull(builder.glueVersion, "glueVersion is required");
this.pythonVersion = java.util.Objects.requireNonNull(builder.pythonVersion, "pythonVersion is required");
this.script = java.util.Objects.requireNonNull(builder.script, "script is required");
this.extraFiles = (java.util.List)builder.extraFiles;
this.extraJars = (java.util.List)builder.extraJars;
this.extraJarsFirst = builder.extraJarsFirst;
this.extraPythonFiles = (java.util.List)builder.extraPythonFiles;
this.runtime = builder.runtime;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.GlueVersion getGlueVersion() {
return this.glueVersion;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.PythonVersion getPythonVersion() {
return this.pythonVersion;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.Code getScript() {
return this.script;
}
@Override
public final java.util.List getExtraFiles() {
return this.extraFiles;
}
@Override
public final java.util.List getExtraJars() {
return this.extraJars;
}
@Override
public final java.lang.Boolean getExtraJarsFirst() {
return this.extraJarsFirst;
}
@Override
public final java.util.List getExtraPythonFiles() {
return this.extraPythonFiles;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.Runtime getRuntime() {
return this.runtime;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("glueVersion", om.valueToTree(this.getGlueVersion()));
data.set("pythonVersion", om.valueToTree(this.getPythonVersion()));
data.set("script", om.valueToTree(this.getScript()));
if (this.getExtraFiles() != null) {
data.set("extraFiles", om.valueToTree(this.getExtraFiles()));
}
if (this.getExtraJars() != null) {
data.set("extraJars", om.valueToTree(this.getExtraJars()));
}
if (this.getExtraJarsFirst() != null) {
data.set("extraJarsFirst", om.valueToTree(this.getExtraJarsFirst()));
}
if (this.getExtraPythonFiles() != null) {
data.set("extraPythonFiles", om.valueToTree(this.getExtraPythonFiles()));
}
if (this.getRuntime() != null) {
data.set("runtime", om.valueToTree(this.getRuntime()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-glue-alpha.PythonSparkJobExecutableProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PythonSparkJobExecutableProps.Jsii$Proxy that = (PythonSparkJobExecutableProps.Jsii$Proxy) o;
if (!glueVersion.equals(that.glueVersion)) return false;
if (!pythonVersion.equals(that.pythonVersion)) return false;
if (!script.equals(that.script)) return false;
if (this.extraFiles != null ? !this.extraFiles.equals(that.extraFiles) : that.extraFiles != null) return false;
if (this.extraJars != null ? !this.extraJars.equals(that.extraJars) : that.extraJars != null) return false;
if (this.extraJarsFirst != null ? !this.extraJarsFirst.equals(that.extraJarsFirst) : that.extraJarsFirst != null) return false;
if (this.extraPythonFiles != null ? !this.extraPythonFiles.equals(that.extraPythonFiles) : that.extraPythonFiles != null) return false;
return this.runtime != null ? this.runtime.equals(that.runtime) : that.runtime == null;
}
@Override
public final int hashCode() {
int result = this.glueVersion.hashCode();
result = 31 * result + (this.pythonVersion.hashCode());
result = 31 * result + (this.script.hashCode());
result = 31 * result + (this.extraFiles != null ? this.extraFiles.hashCode() : 0);
result = 31 * result + (this.extraJars != null ? this.extraJars.hashCode() : 0);
result = 31 * result + (this.extraJarsFirst != null ? this.extraJarsFirst.hashCode() : 0);
result = 31 * result + (this.extraPythonFiles != null ? this.extraPythonFiles.hashCode() : 0);
result = 31 * result + (this.runtime != null ? this.runtime.hashCode() : 0);
return result;
}
}
}