com.xiaomi.infra.galaxy.emr.thrift.SubmitJobRequest Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.9.2)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.xiaomi.infra.galaxy.emr.thrift;
import libthrift091.scheme.IScheme;
import libthrift091.scheme.SchemeFactory;
import libthrift091.scheme.StandardScheme;
import libthrift091.scheme.TupleScheme;
import libthrift091.protocol.TTupleProtocol;
import libthrift091.protocol.TProtocolException;
import libthrift091.EncodingUtils;
import libthrift091.TException;
import libthrift091.async.AsyncMethodCallback;
import libthrift091.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-8-2")
public class SubmitJobRequest implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("SubmitJobRequest");
private static final libthrift091.protocol.TField NAME_FIELD_DESC = new libthrift091.protocol.TField("name", libthrift091.protocol.TType.STRING, (short)1);
private static final libthrift091.protocol.TField CLUSTER_ID_FIELD_DESC = new libthrift091.protocol.TField("clusterId", libthrift091.protocol.TType.STRING, (short)2);
private static final libthrift091.protocol.TField JAR_FIELD_DESC = new libthrift091.protocol.TField("jar", libthrift091.protocol.TType.STRING, (short)3);
private static final libthrift091.protocol.TField JAR_MAIN_CLASS_FIELD_DESC = new libthrift091.protocol.TField("jarMainClass", libthrift091.protocol.TType.STRING, (short)4);
private static final libthrift091.protocol.TField JAR_ARGS_FIELD_DESC = new libthrift091.protocol.TField("jarArgs", libthrift091.protocol.TType.LIST, (short)5);
private static final libthrift091.protocol.TField JAR_PROPERTIES_FIELD_DESC = new libthrift091.protocol.TField("jarProperties", libthrift091.protocol.TType.MAP, (short)6);
private static final libthrift091.protocol.TField ACTION_ON_FAILURE_FIELD_DESC = new libthrift091.protocol.TField("actionOnFailure", libthrift091.protocol.TType.I32, (short)7);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new SubmitJobRequestStandardSchemeFactory());
schemes.put(TupleScheme.class, new SubmitJobRequestTupleSchemeFactory());
}
public String name; // required
public String clusterId; // optional
public String jar; // optional
public String jarMainClass; // optional
public List jarArgs; // optional
public Map jarProperties; // optional
/**
*
* @see JobActionOnFailure
*/
public JobActionOnFailure actionOnFailure; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
NAME((short)1, "name"),
CLUSTER_ID((short)2, "clusterId"),
JAR((short)3, "jar"),
JAR_MAIN_CLASS((short)4, "jarMainClass"),
JAR_ARGS((short)5, "jarArgs"),
JAR_PROPERTIES((short)6, "jarProperties"),
/**
*
* @see JobActionOnFailure
*/
ACTION_ON_FAILURE((short)7, "actionOnFailure");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // NAME
return NAME;
case 2: // CLUSTER_ID
return CLUSTER_ID;
case 3: // JAR
return JAR;
case 4: // JAR_MAIN_CLASS
return JAR_MAIN_CLASS;
case 5: // JAR_ARGS
return JAR_ARGS;
case 6: // JAR_PROPERTIES
return JAR_PROPERTIES;
case 7: // ACTION_ON_FAILURE
return ACTION_ON_FAILURE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.CLUSTER_ID,_Fields.JAR,_Fields.JAR_MAIN_CLASS,_Fields.JAR_ARGS,_Fields.JAR_PROPERTIES,_Fields.ACTION_ON_FAILURE};
public static final Map<_Fields, libthrift091.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.NAME, new libthrift091.meta_data.FieldMetaData("name", libthrift091.TFieldRequirementType.REQUIRED,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.CLUSTER_ID, new libthrift091.meta_data.FieldMetaData("clusterId", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.JAR, new libthrift091.meta_data.FieldMetaData("jar", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.JAR_MAIN_CLASS, new libthrift091.meta_data.FieldMetaData("jarMainClass", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.JAR_ARGS, new libthrift091.meta_data.FieldMetaData("jarArgs", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.ListMetaData(libthrift091.protocol.TType.LIST,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))));
tmpMap.put(_Fields.JAR_PROPERTIES, new libthrift091.meta_data.FieldMetaData("jarProperties", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.MapMetaData(libthrift091.protocol.TType.MAP,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING),
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))));
tmpMap.put(_Fields.ACTION_ON_FAILURE, new libthrift091.meta_data.FieldMetaData("actionOnFailure", libthrift091.TFieldRequirementType.OPTIONAL,
new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, JobActionOnFailure.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(SubmitJobRequest.class, metaDataMap);
}
public SubmitJobRequest() {
}
public SubmitJobRequest(
String name)
{
this();
this.name = name;
}
/**
* Performs a deep copy on other.
*/
public SubmitJobRequest(SubmitJobRequest other) {
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetClusterId()) {
this.clusterId = other.clusterId;
}
if (other.isSetJar()) {
this.jar = other.jar;
}
if (other.isSetJarMainClass()) {
this.jarMainClass = other.jarMainClass;
}
if (other.isSetJarArgs()) {
List __this__jarArgs = new ArrayList(other.jarArgs);
this.jarArgs = __this__jarArgs;
}
if (other.isSetJarProperties()) {
Map __this__jarProperties = new HashMap(other.jarProperties);
this.jarProperties = __this__jarProperties;
}
if (other.isSetActionOnFailure()) {
this.actionOnFailure = other.actionOnFailure;
}
}
public SubmitJobRequest deepCopy() {
return new SubmitJobRequest(this);
}
@Override
public void clear() {
this.name = null;
this.clusterId = null;
this.jar = null;
this.jarMainClass = null;
this.jarArgs = null;
this.jarProperties = null;
this.actionOnFailure = null;
}
public String getName() {
return this.name;
}
public SubmitJobRequest setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public String getClusterId() {
return this.clusterId;
}
public SubmitJobRequest setClusterId(String clusterId) {
this.clusterId = clusterId;
return this;
}
public void unsetClusterId() {
this.clusterId = null;
}
/** Returns true if field clusterId is set (has been assigned a value) and false otherwise */
public boolean isSetClusterId() {
return this.clusterId != null;
}
public void setClusterIdIsSet(boolean value) {
if (!value) {
this.clusterId = null;
}
}
public String getJar() {
return this.jar;
}
public SubmitJobRequest setJar(String jar) {
this.jar = jar;
return this;
}
public void unsetJar() {
this.jar = null;
}
/** Returns true if field jar is set (has been assigned a value) and false otherwise */
public boolean isSetJar() {
return this.jar != null;
}
public void setJarIsSet(boolean value) {
if (!value) {
this.jar = null;
}
}
public String getJarMainClass() {
return this.jarMainClass;
}
public SubmitJobRequest setJarMainClass(String jarMainClass) {
this.jarMainClass = jarMainClass;
return this;
}
public void unsetJarMainClass() {
this.jarMainClass = null;
}
/** Returns true if field jarMainClass is set (has been assigned a value) and false otherwise */
public boolean isSetJarMainClass() {
return this.jarMainClass != null;
}
public void setJarMainClassIsSet(boolean value) {
if (!value) {
this.jarMainClass = null;
}
}
public int getJarArgsSize() {
return (this.jarArgs == null) ? 0 : this.jarArgs.size();
}
public java.util.Iterator getJarArgsIterator() {
return (this.jarArgs == null) ? null : this.jarArgs.iterator();
}
public void addToJarArgs(String elem) {
if (this.jarArgs == null) {
this.jarArgs = new ArrayList();
}
this.jarArgs.add(elem);
}
public List getJarArgs() {
return this.jarArgs;
}
public SubmitJobRequest setJarArgs(List jarArgs) {
this.jarArgs = jarArgs;
return this;
}
public void unsetJarArgs() {
this.jarArgs = null;
}
/** Returns true if field jarArgs is set (has been assigned a value) and false otherwise */
public boolean isSetJarArgs() {
return this.jarArgs != null;
}
public void setJarArgsIsSet(boolean value) {
if (!value) {
this.jarArgs = null;
}
}
public int getJarPropertiesSize() {
return (this.jarProperties == null) ? 0 : this.jarProperties.size();
}
public void putToJarProperties(String key, String val) {
if (this.jarProperties == null) {
this.jarProperties = new HashMap();
}
this.jarProperties.put(key, val);
}
public Map getJarProperties() {
return this.jarProperties;
}
public SubmitJobRequest setJarProperties(Map jarProperties) {
this.jarProperties = jarProperties;
return this;
}
public void unsetJarProperties() {
this.jarProperties = null;
}
/** Returns true if field jarProperties is set (has been assigned a value) and false otherwise */
public boolean isSetJarProperties() {
return this.jarProperties != null;
}
public void setJarPropertiesIsSet(boolean value) {
if (!value) {
this.jarProperties = null;
}
}
/**
*
* @see JobActionOnFailure
*/
public JobActionOnFailure getActionOnFailure() {
return this.actionOnFailure;
}
/**
*
* @see JobActionOnFailure
*/
public SubmitJobRequest setActionOnFailure(JobActionOnFailure actionOnFailure) {
this.actionOnFailure = actionOnFailure;
return this;
}
public void unsetActionOnFailure() {
this.actionOnFailure = null;
}
/** Returns true if field actionOnFailure is set (has been assigned a value) and false otherwise */
public boolean isSetActionOnFailure() {
return this.actionOnFailure != null;
}
public void setActionOnFailureIsSet(boolean value) {
if (!value) {
this.actionOnFailure = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case CLUSTER_ID:
if (value == null) {
unsetClusterId();
} else {
setClusterId((String)value);
}
break;
case JAR:
if (value == null) {
unsetJar();
} else {
setJar((String)value);
}
break;
case JAR_MAIN_CLASS:
if (value == null) {
unsetJarMainClass();
} else {
setJarMainClass((String)value);
}
break;
case JAR_ARGS:
if (value == null) {
unsetJarArgs();
} else {
setJarArgs((List)value);
}
break;
case JAR_PROPERTIES:
if (value == null) {
unsetJarProperties();
} else {
setJarProperties((Map)value);
}
break;
case ACTION_ON_FAILURE:
if (value == null) {
unsetActionOnFailure();
} else {
setActionOnFailure((JobActionOnFailure)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
return getName();
case CLUSTER_ID:
return getClusterId();
case JAR:
return getJar();
case JAR_MAIN_CLASS:
return getJarMainClass();
case JAR_ARGS:
return getJarArgs();
case JAR_PROPERTIES:
return getJarProperties();
case ACTION_ON_FAILURE:
return getActionOnFailure();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NAME:
return isSetName();
case CLUSTER_ID:
return isSetClusterId();
case JAR:
return isSetJar();
case JAR_MAIN_CLASS:
return isSetJarMainClass();
case JAR_ARGS:
return isSetJarArgs();
case JAR_PROPERTIES:
return isSetJarProperties();
case ACTION_ON_FAILURE:
return isSetActionOnFailure();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof SubmitJobRequest)
return this.equals((SubmitJobRequest)that);
return false;
}
public boolean equals(SubmitJobRequest that) {
if (that == null)
return false;
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_clusterId = true && this.isSetClusterId();
boolean that_present_clusterId = true && that.isSetClusterId();
if (this_present_clusterId || that_present_clusterId) {
if (!(this_present_clusterId && that_present_clusterId))
return false;
if (!this.clusterId.equals(that.clusterId))
return false;
}
boolean this_present_jar = true && this.isSetJar();
boolean that_present_jar = true && that.isSetJar();
if (this_present_jar || that_present_jar) {
if (!(this_present_jar && that_present_jar))
return false;
if (!this.jar.equals(that.jar))
return false;
}
boolean this_present_jarMainClass = true && this.isSetJarMainClass();
boolean that_present_jarMainClass = true && that.isSetJarMainClass();
if (this_present_jarMainClass || that_present_jarMainClass) {
if (!(this_present_jarMainClass && that_present_jarMainClass))
return false;
if (!this.jarMainClass.equals(that.jarMainClass))
return false;
}
boolean this_present_jarArgs = true && this.isSetJarArgs();
boolean that_present_jarArgs = true && that.isSetJarArgs();
if (this_present_jarArgs || that_present_jarArgs) {
if (!(this_present_jarArgs && that_present_jarArgs))
return false;
if (!this.jarArgs.equals(that.jarArgs))
return false;
}
boolean this_present_jarProperties = true && this.isSetJarProperties();
boolean that_present_jarProperties = true && that.isSetJarProperties();
if (this_present_jarProperties || that_present_jarProperties) {
if (!(this_present_jarProperties && that_present_jarProperties))
return false;
if (!this.jarProperties.equals(that.jarProperties))
return false;
}
boolean this_present_actionOnFailure = true && this.isSetActionOnFailure();
boolean that_present_actionOnFailure = true && that.isSetActionOnFailure();
if (this_present_actionOnFailure || that_present_actionOnFailure) {
if (!(this_present_actionOnFailure && that_present_actionOnFailure))
return false;
if (!this.actionOnFailure.equals(that.actionOnFailure))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy