package com.hbc.svc.sundial.v2.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 2.0.0-dev * User agent: apibuilder app.apibuilder.io/hbc/svc-sundial/2.0.0-dev/android_rx2_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson, retrofit2 and RxJava2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * */ @JsonIgnoreProperties( ignoreUnknown = true ) @JsonTypeInfo( use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE ) public class EmrCommand implements TaskExecutable { private final EmrCluster emrCluster; private final String jobName; private final String region; private final String class_; private final String s3JarPath; private final String[] sparkConf; private final MavenPackage[] sparkPackages; private final String[] args; private final S3LogDetails s3LogDetails; private final S3Cp[] loadData; private final S3Cp[] saveResults; @JsonCreator public EmrCommand(@JsonProperty("emr_cluster") EmrCluster emrCluster, @JsonProperty("job_name") String jobName, @JsonProperty("region") String region, @JsonProperty("class") String class_, @JsonProperty("s3_jar_path") String s3JarPath, @JsonProperty("spark_conf") String[] sparkConf, @JsonProperty("spark_packages") MavenPackage[] sparkPackages, @JsonProperty("args") String[] args, @JsonProperty("s3_log_details") S3LogDetails s3LogDetails, @JsonProperty("load_data") S3Cp[] loadData, @JsonProperty("save_results") S3Cp[] saveResults) { this.emrCluster = emrCluster; this.jobName = jobName; this.region = region; this.class_ = class_; this.s3JarPath = s3JarPath; this.sparkConf = sparkConf; this.sparkPackages = sparkPackages; this.args = args; this.s3LogDetails = s3LogDetails; this.loadData = loadData; this.saveResults = saveResults; } /** * The EMR cluster on which to launch the job (aka step) */ public EmrCluster getEmrCluster() { return emrCluster; } /** * NAme to be assigned to the Job */ public String getJobName() { return jobName; } /** * the AWS Region */ public String getRegion() { return region; } /** * The spark job's `Main.class` to run */ public String getClass() { return class_; } /** * the s3 path to the jar of the job to be run */ public String getS3JarPath() { return s3JarPath; } /** * options that will be sent to spark as --conf key=value, e.g. `--conf spark.driver.extraJavaOptions=-Denvironment=integration` */ public String[] getSparkConf() { return sparkConf; } /** * External maven dependencies to include with Spark job */ public MavenPackage[] getSparkPackages() { return sparkPackages; } /** * command line arguments to be passe to the job's main class */ public String[] getArgs() { return args; } /** * AWS EMR periodically (currently every 5 minutes) zips up all the logs and upload them into S3. This does not work well with sundial's _live logs_. Make use of S3 Logs to visualise in real time job's log on sundial's live logs panel */ public S3LogDetails getS3LogDetails() { return s3LogDetails; } /** * will trigger a s3 dist cp job for every entry in this array, can be used to load data from s3 into HDFS. **requires Hadoop** as application on the cluster */ public S3Cp[] getLoadData() { return loadData; } /** * will trigger a s3 dist cp job for every entry in this array, can be used to save data from HDFS to s3. **requires Hadoop** as application on the cluster */ public S3Cp[] getSaveResults() { return saveResults; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; EmrCommand that = (EmrCommand) o; if (emrCluster != null ? !emrCluster.equals(that.emrCluster) : that.emrCluster != null) return false; if (jobName != null ? !jobName.equals(that.jobName) : that.jobName != null) return false; if (region != null ? !region.equals(that.region) : that.region != null) return false; if (class_ != null ? !class_.equals(that.class_) : that.class_ != null) return false; if (s3JarPath != null ? !s3JarPath.equals(that.s3JarPath) : that.s3JarPath != null) return false; if (!Arrays.equals(sparkConf, that.sparkConf)) return false; if (!Arrays.equals(sparkPackages, that.sparkPackages)) return false; if (!Arrays.equals(args, that.args)) return false; if (s3LogDetails != null ? !s3LogDetails.equals(that.s3LogDetails) : that.s3LogDetails != null) return false; if (!Arrays.equals(loadData, that.loadData)) return false; if (!Arrays.equals(saveResults, that.saveResults)) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (emrCluster != null ? emrCluster.hashCode() : 0); result = 31 * result + (jobName != null ? jobName.hashCode() : 0); result = 31 * result + (region != null ? region.hashCode() : 0); result = 31 * result + (class_ != null ? class_.hashCode() : 0); result = 31 * result + (s3JarPath != null ? s3JarPath.hashCode() : 0); result = 31 * result + (sparkConf != null ? sparkConf.hashCode() : 0); result = 31 * result + (sparkPackages != null ? sparkPackages.hashCode() : 0); result = 31 * result + (args != null ? args.hashCode() : 0); result = 31 * result + (s3LogDetails != null ? s3LogDetails.hashCode() : 0); result = 31 * result + (loadData != null ? loadData.hashCode() : 0); result = 31 * result + (saveResults != null ? saveResults.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.hbc.svc.sundial.v2.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static EmrCommand parseJson(String json) throws IOException { return com.hbc.svc.sundial.v2.android.ApiBuilderObjectMapper.getInstance().readValue( json, EmrCommand.class); } }