org.apache.hadoop.hive.metastore.api.RuntimeStat Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hive-apache Show documentation
Show all versions of hive-apache Show documentation
Shaded version of Apache Hive for Presto
The newest version!
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hive.metastore.api;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.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 io.prestosql.hive.$internal.org.slf4j.Logger;
import io.prestosql.hive.$internal.org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
public class RuntimeStat implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RuntimeStat");
private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField WEIGHT_FIELD_DESC = new org.apache.thrift.protocol.TField("weight", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField PAYLOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("payload", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new RuntimeStatStandardSchemeFactory());
schemes.put(TupleScheme.class, new RuntimeStatTupleSchemeFactory());
}
private int createTime; // optional
private int weight; // required
private ByteBuffer payload; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
CREATE_TIME((short)1, "createTime"),
WEIGHT((short)2, "weight"),
PAYLOAD((short)3, "payload");
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: // CREATE_TIME
return CREATE_TIME;
case 2: // WEIGHT
return WEIGHT;
case 3: // PAYLOAD
return PAYLOAD;
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 int __CREATETIME_ISSET_ID = 0;
private static final int __WEIGHT_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.CREATE_TIME};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.WEIGHT, new org.apache.thrift.meta_data.FieldMetaData("weight", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.PAYLOAD, new org.apache.thrift.meta_data.FieldMetaData("payload", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RuntimeStat.class, metaDataMap);
}
public RuntimeStat() {
}
public RuntimeStat(
int weight,
ByteBuffer payload)
{
this();
this.weight = weight;
setWeightIsSet(true);
this.payload = org.apache.thrift.TBaseHelper.copyBinary(payload);
}
/**
* Performs a deep copy on other.
*/
public RuntimeStat(RuntimeStat other) {
__isset_bitfield = other.__isset_bitfield;
this.createTime = other.createTime;
this.weight = other.weight;
if (other.isSetPayload()) {
this.payload = org.apache.thrift.TBaseHelper.copyBinary(other.payload);
}
}
public RuntimeStat deepCopy() {
return new RuntimeStat(this);
}
@Override
public void clear() {
setCreateTimeIsSet(false);
this.createTime = 0;
setWeightIsSet(false);
this.weight = 0;
this.payload = null;
}
public int getCreateTime() {
return this.createTime;
}
public void setCreateTime(int createTime) {
this.createTime = createTime;
setCreateTimeIsSet(true);
}
public void unsetCreateTime() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID);
}
/** Returns true if field createTime is set (has been assigned a value) and false otherwise */
public boolean isSetCreateTime() {
return EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID);
}
public void setCreateTimeIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value);
}
public int getWeight() {
return this.weight;
}
public void setWeight(int weight) {
this.weight = weight;
setWeightIsSet(true);
}
public void unsetWeight() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WEIGHT_ISSET_ID);
}
/** Returns true if field weight is set (has been assigned a value) and false otherwise */
public boolean isSetWeight() {
return EncodingUtils.testBit(__isset_bitfield, __WEIGHT_ISSET_ID);
}
public void setWeightIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WEIGHT_ISSET_ID, value);
}
public byte[] getPayload() {
setPayload(org.apache.thrift.TBaseHelper.rightSize(payload));
return payload == null ? null : payload.array();
}
public ByteBuffer bufferForPayload() {
return org.apache.thrift.TBaseHelper.copyBinary(payload);
}
public void setPayload(byte[] payload) {
this.payload = payload == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(payload, payload.length));
}
public void setPayload(ByteBuffer payload) {
this.payload = org.apache.thrift.TBaseHelper.copyBinary(payload);
}
public void unsetPayload() {
this.payload = null;
}
/** Returns true if field payload is set (has been assigned a value) and false otherwise */
public boolean isSetPayload() {
return this.payload != null;
}
public void setPayloadIsSet(boolean value) {
if (!value) {
this.payload = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case CREATE_TIME:
if (value == null) {
unsetCreateTime();
} else {
setCreateTime((Integer)value);
}
break;
case WEIGHT:
if (value == null) {
unsetWeight();
} else {
setWeight((Integer)value);
}
break;
case PAYLOAD:
if (value == null) {
unsetPayload();
} else {
setPayload((ByteBuffer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case CREATE_TIME:
return getCreateTime();
case WEIGHT:
return getWeight();
case PAYLOAD:
return getPayload();
}
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 CREATE_TIME:
return isSetCreateTime();
case WEIGHT:
return isSetWeight();
case PAYLOAD:
return isSetPayload();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof RuntimeStat)
return this.equals((RuntimeStat)that);
return false;
}
public boolean equals(RuntimeStat that) {
if (that == null)
return false;
boolean this_present_createTime = true && this.isSetCreateTime();
boolean that_present_createTime = true && that.isSetCreateTime();
if (this_present_createTime || that_present_createTime) {
if (!(this_present_createTime && that_present_createTime))
return false;
if (this.createTime != that.createTime)
return false;
}
boolean this_present_weight = true;
boolean that_present_weight = true;
if (this_present_weight || that_present_weight) {
if (!(this_present_weight && that_present_weight))
return false;
if (this.weight != that.weight)
return false;
}
boolean this_present_payload = true && this.isSetPayload();
boolean that_present_payload = true && that.isSetPayload();
if (this_present_payload || that_present_payload) {
if (!(this_present_payload && that_present_payload))
return false;
if (!this.payload.equals(that.payload))
return false;
}
return true;
}
@Override
public int hashCode() {
List © 2015 - 2025 Weber Informatics LLC | Privacy Policy