Java tutorial
/** * Dasshy - Real time and Batch Analytics Open Source System * Copyright (C) 2016 Kromatik Solutions (http://kromatiksolutions.com) * * This file is part of Dasshy * * Dasshy is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * Dasshy is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public * License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Dasshy. If not, see <http://www.gnu.org/licenses/>. */ /** * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.kromatik.dasshy.thrift.model; 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 org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked" }) @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-06-13") public class TPolicy implements org.apache.thrift.TBase<TPolicy, TPolicy._Fields>, java.io.Serializable, Cloneable, Comparable<TPolicy> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( "TPolicy"); private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField( "id", org.apache.thrift.protocol.TType.STRING, (short) 1); private static final org.apache.thrift.protocol.TField CLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField( "clock", org.apache.thrift.protocol.TType.STRUCT, (short) 2); private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField( "error", org.apache.thrift.protocol.TType.STRING, (short) 3); private static final org.apache.thrift.protocol.TField LAST_UPDATED_FIELD_DESC = new org.apache.thrift.protocol.TField( "lastUpdated", org.apache.thrift.protocol.TType.I64, (short) 4); private static final org.apache.thrift.protocol.TField EXTRACTOR_FIELD_DESC = new org.apache.thrift.protocol.TField( "extractor", org.apache.thrift.protocol.TType.STRUCT, (short) 5); private static final org.apache.thrift.protocol.TField TRANSFORMER_FIELD_DESC = new org.apache.thrift.protocol.TField( "transformer", org.apache.thrift.protocol.TType.STRUCT, (short) 6); private static final org.apache.thrift.protocol.TField LOADER_FIELD_DESC = new org.apache.thrift.protocol.TField( "loader", org.apache.thrift.protocol.TType.STRUCT, (short) 7); private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField( "state", org.apache.thrift.protocol.TType.I32, (short) 8); private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField( "startTime", org.apache.thrift.protocol.TType.I64, (short) 9); private static final org.apache.thrift.protocol.TField END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField( "endTime", org.apache.thrift.protocol.TType.I64, (short) 10); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new TPolicyStandardSchemeFactory()); schemes.put(TupleScheme.class, new TPolicyTupleSchemeFactory()); } private String id; // required private TBatchClock clock; // required private String error; // required private long lastUpdated; // required private TStage extractor; // required private TStage transformer; // required private TStage loader; // required private TJobState state; // required private long startTime; // required private long endTime; // 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 { ID((short) 1, "id"), CLOCK((short) 2, "clock"), ERROR((short) 3, "error"), LAST_UPDATED((short) 4, "lastUpdated"), EXTRACTOR((short) 5, "extractor"), TRANSFORMER((short) 6, "transformer"), LOADER((short) 7, "loader"), /** * * @see TJobState */ STATE((short) 8, "state"), START_TIME((short) 9, "startTime"), END_TIME((short) 10, "endTime"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); 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: // ID return ID; case 2: // CLOCK return CLOCK; case 3: // ERROR return ERROR; case 4: // LAST_UPDATED return LAST_UPDATED; case 5: // EXTRACTOR return EXTRACTOR; case 6: // TRANSFORMER return TRANSFORMER; case 7: // LOADER return LOADER; case 8: // STATE return STATE; case 9: // START_TIME return START_TIME; case 10: // END_TIME return END_TIME; 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 __LASTUPDATED_ISSET_ID = 0; private static final int __STARTTIME_ISSET_ID = 1; private static final int __ENDTIME_ISSET_ID = 2; private byte __isset_bitfield = 0; 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CLOCK, new org.apache.thrift.meta_data.FieldMetaData("clock", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBatchClock.class))); tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.LAST_UPDATED, new org.apache.thrift.meta_data.FieldMetaData("lastUpdated", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.EXTRACTOR, new org.apache.thrift.meta_data.FieldMetaData("extractor", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStage.class))); tmpMap.put(_Fields.TRANSFORMER, new org.apache.thrift.meta_data.FieldMetaData("transformer", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStage.class))); tmpMap.put(_Fields.LOADER, new org.apache.thrift.meta_data.FieldMetaData("loader", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStage.class))); tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TJobState.class))); tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.END_TIME, new org.apache.thrift.meta_data.FieldMetaData("endTime", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPolicy.class, metaDataMap); } public TPolicy() { } public TPolicy(String id, TBatchClock clock, String error, long lastUpdated, TStage extractor, TStage transformer, TStage loader, TJobState state, long startTime, long endTime) { this(); this.id = id; this.clock = clock; this.error = error; this.lastUpdated = lastUpdated; setLastUpdatedIsSet(true); this.extractor = extractor; this.transformer = transformer; this.loader = loader; this.state = state; this.startTime = startTime; setStartTimeIsSet(true); this.endTime = endTime; setEndTimeIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TPolicy(TPolicy other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetId()) { this.id = other.id; } if (other.isSetClock()) { this.clock = new TBatchClock(other.clock); } if (other.isSetError()) { this.error = other.error; } this.lastUpdated = other.lastUpdated; if (other.isSetExtractor()) { this.extractor = new TStage(other.extractor); } if (other.isSetTransformer()) { this.transformer = new TStage(other.transformer); } if (other.isSetLoader()) { this.loader = new TStage(other.loader); } if (other.isSetState()) { this.state = other.state; } this.startTime = other.startTime; this.endTime = other.endTime; } public TPolicy deepCopy() { return new TPolicy(this); } @Override public void clear() { this.id = null; this.clock = null; this.error = null; setLastUpdatedIsSet(false); this.lastUpdated = 0; this.extractor = null; this.transformer = null; this.loader = null; this.state = null; setStartTimeIsSet(false); this.startTime = 0; setEndTimeIsSet(false); this.endTime = 0; } public String getId() { return this.id; } public void setId(String id) { this.id = id; } public void unsetId() { this.id = null; } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { return this.id != null; } public void setIdIsSet(boolean value) { if (!value) { this.id = null; } } public TBatchClock getClock() { return this.clock; } public void setClock(TBatchClock clock) { this.clock = clock; } public void unsetClock() { this.clock = null; } /** Returns true if field clock is set (has been assigned a value) and false otherwise */ public boolean isSetClock() { return this.clock != null; } public void setClockIsSet(boolean value) { if (!value) { this.clock = null; } } public String getError() { return this.error; } public void setError(String error) { this.error = error; } public void unsetError() { this.error = null; } /** Returns true if field error is set (has been assigned a value) and false otherwise */ public boolean isSetError() { return this.error != null; } public void setErrorIsSet(boolean value) { if (!value) { this.error = null; } } public long getLastUpdated() { return this.lastUpdated; } public void setLastUpdated(long lastUpdated) { this.lastUpdated = lastUpdated; setLastUpdatedIsSet(true); } public void unsetLastUpdated() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTUPDATED_ISSET_ID); } /** Returns true if field lastUpdated is set (has been assigned a value) and false otherwise */ public boolean isSetLastUpdated() { return EncodingUtils.testBit(__isset_bitfield, __LASTUPDATED_ISSET_ID); } public void setLastUpdatedIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTUPDATED_ISSET_ID, value); } public TStage getExtractor() { return this.extractor; } public void setExtractor(TStage extractor) { this.extractor = extractor; } public void unsetExtractor() { this.extractor = null; } /** Returns true if field extractor is set (has been assigned a value) and false otherwise */ public boolean isSetExtractor() { return this.extractor != null; } public void setExtractorIsSet(boolean value) { if (!value) { this.extractor = null; } } public TStage getTransformer() { return this.transformer; } public void setTransformer(TStage transformer) { this.transformer = transformer; } public void unsetTransformer() { this.transformer = null; } /** Returns true if field transformer is set (has been assigned a value) and false otherwise */ public boolean isSetTransformer() { return this.transformer != null; } public void setTransformerIsSet(boolean value) { if (!value) { this.transformer = null; } } public TStage getLoader() { return this.loader; } public void setLoader(TStage loader) { this.loader = loader; } public void unsetLoader() { this.loader = null; } /** Returns true if field loader is set (has been assigned a value) and false otherwise */ public boolean isSetLoader() { return this.loader != null; } public void setLoaderIsSet(boolean value) { if (!value) { this.loader = null; } } /** * * @see TJobState */ public TJobState getState() { return this.state; } /** * * @see TJobState */ public void setState(TJobState state) { this.state = state; } public void unsetState() { this.state = null; } /** Returns true if field state is set (has been assigned a value) and false otherwise */ public boolean isSetState() { return this.state != null; } public void setStateIsSet(boolean value) { if (!value) { this.state = null; } } public long getStartTime() { return this.startTime; } public void setStartTime(long startTime) { this.startTime = startTime; setStartTimeIsSet(true); } public void unsetStartTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); } /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ public boolean isSetStartTime() { return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); } public void setStartTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); } public long getEndTime() { return this.endTime; } public void setEndTime(long endTime) { this.endTime = endTime; setEndTimeIsSet(true); } public void unsetEndTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID); } /** Returns true if field endTime is set (has been assigned a value) and false otherwise */ public boolean isSetEndTime() { return EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID); } public void setEndTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: if (value == null) { unsetId(); } else { setId((String) value); } break; case CLOCK: if (value == null) { unsetClock(); } else { setClock((TBatchClock) value); } break; case ERROR: if (value == null) { unsetError(); } else { setError((String) value); } break; case LAST_UPDATED: if (value == null) { unsetLastUpdated(); } else { setLastUpdated((Long) value); } break; case EXTRACTOR: if (value == null) { unsetExtractor(); } else { setExtractor((TStage) value); } break; case TRANSFORMER: if (value == null) { unsetTransformer(); } else { setTransformer((TStage) value); } break; case LOADER: if (value == null) { unsetLoader(); } else { setLoader((TStage) value); } break; case STATE: if (value == null) { unsetState(); } else { setState((TJobState) value); } break; case START_TIME: if (value == null) { unsetStartTime(); } else { setStartTime((Long) value); } break; case END_TIME: if (value == null) { unsetEndTime(); } else { setEndTime((Long) value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ID: return getId(); case CLOCK: return getClock(); case ERROR: return getError(); case LAST_UPDATED: return getLastUpdated(); case EXTRACTOR: return getExtractor(); case TRANSFORMER: return getTransformer(); case LOADER: return getLoader(); case STATE: return getState(); case START_TIME: return getStartTime(); case END_TIME: return getEndTime(); } 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 ID: return isSetId(); case CLOCK: return isSetClock(); case ERROR: return isSetError(); case LAST_UPDATED: return isSetLastUpdated(); case EXTRACTOR: return isSetExtractor(); case TRANSFORMER: return isSetTransformer(); case LOADER: return isSetLoader(); case STATE: return isSetState(); case START_TIME: return isSetStartTime(); case END_TIME: return isSetEndTime(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TPolicy) return this.equals((TPolicy) that); return false; } public boolean equals(TPolicy that) { if (that == null) return false; boolean this_present_id = true && this.isSetId(); boolean that_present_id = true && that.isSetId(); if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (!this.id.equals(that.id)) return false; } boolean this_present_clock = true && this.isSetClock(); boolean that_present_clock = true && that.isSetClock(); if (this_present_clock || that_present_clock) { if (!(this_present_clock && that_present_clock)) return false; if (!this.clock.equals(that.clock)) return false; } boolean this_present_error = true && this.isSetError(); boolean that_present_error = true && that.isSetError(); if (this_present_error || that_present_error) { if (!(this_present_error && that_present_error)) return false; if (!this.error.equals(that.error)) return false; } boolean this_present_lastUpdated = true; boolean that_present_lastUpdated = true; if (this_present_lastUpdated || that_present_lastUpdated) { if (!(this_present_lastUpdated && that_present_lastUpdated)) return false; if (this.lastUpdated != that.lastUpdated) return false; } boolean this_present_extractor = true && this.isSetExtractor(); boolean that_present_extractor = true && that.isSetExtractor(); if (this_present_extractor || that_present_extractor) { if (!(this_present_extractor && that_present_extractor)) return false; if (!this.extractor.equals(that.extractor)) return false; } boolean this_present_transformer = true && this.isSetTransformer(); boolean that_present_transformer = true && that.isSetTransformer(); if (this_present_transformer || that_present_transformer) { if (!(this_present_transformer && that_present_transformer)) return false; if (!this.transformer.equals(that.transformer)) return false; } boolean this_present_loader = true && this.isSetLoader(); boolean that_present_loader = true && that.isSetLoader(); if (this_present_loader || that_present_loader) { if (!(this_present_loader && that_present_loader)) return false; if (!this.loader.equals(that.loader)) return false; } boolean this_present_state = true && this.isSetState(); boolean that_present_state = true && that.isSetState(); if (this_present_state || that_present_state) { if (!(this_present_state && that_present_state)) return false; if (!this.state.equals(that.state)) return false; } boolean this_present_startTime = true; boolean that_present_startTime = true; if (this_present_startTime || that_present_startTime) { if (!(this_present_startTime && that_present_startTime)) return false; if (this.startTime != that.startTime) return false; } boolean this_present_endTime = true; boolean that_present_endTime = true; if (this_present_endTime || that_present_endTime) { if (!(this_present_endTime && that_present_endTime)) return false; if (this.endTime != that.endTime) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_id = true && (isSetId()); list.add(present_id); if (present_id) list.add(id); boolean present_clock = true && (isSetClock()); list.add(present_clock); if (present_clock) list.add(clock); boolean present_error = true && (isSetError()); list.add(present_error); if (present_error) list.add(error); boolean present_lastUpdated = true; list.add(present_lastUpdated); if (present_lastUpdated) list.add(lastUpdated); boolean present_extractor = true && (isSetExtractor()); list.add(present_extractor); if (present_extractor) list.add(extractor); boolean present_transformer = true && (isSetTransformer()); list.add(present_transformer); if (present_transformer) list.add(transformer); boolean present_loader = true && (isSetLoader()); list.add(present_loader); if (present_loader) list.add(loader); boolean present_state = true && (isSetState()); list.add(present_state); if (present_state) list.add(state.getValue()); boolean present_startTime = true; list.add(present_startTime); if (present_startTime) list.add(startTime); boolean present_endTime = true; list.add(present_endTime); if (present_endTime) list.add(endTime); return list.hashCode(); } @Override public int compareTo(TPolicy other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetClock()).compareTo(other.isSetClock()); if (lastComparison != 0) { return lastComparison; } if (isSetClock()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clock, other.clock); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError()); if (lastComparison != 0) { return lastComparison; } if (isSetError()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLastUpdated()).compareTo(other.isSetLastUpdated()); if (lastComparison != 0) { return lastComparison; } if (isSetLastUpdated()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastUpdated, other.lastUpdated); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetExtractor()).compareTo(other.isSetExtractor()); if (lastComparison != 0) { return lastComparison; } if (isSetExtractor()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extractor, other.extractor); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTransformer()).compareTo(other.isSetTransformer()); if (lastComparison != 0) { return lastComparison; } if (isSetTransformer()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transformer, other.transformer); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLoader()).compareTo(other.isSetLoader()); if (lastComparison != 0) { return lastComparison; } if (isSetLoader()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loader, other.loader); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetState()).compareTo(other.isSetState()); if (lastComparison != 0) { return lastComparison; } if (isSetState()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); if (lastComparison != 0) { return lastComparison; } if (isSetStartTime()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEndTime()).compareTo(other.isSetEndTime()); if (lastComparison != 0) { return lastComparison; } if (isSetEndTime()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endTime, other.endTime); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("TPolicy("); boolean first = true; sb.append("id:"); if (this.id == null) { sb.append("null"); } else { sb.append(this.id); } first = false; if (!first) sb.append(", "); sb.append("clock:"); if (this.clock == null) { sb.append("null"); } else { sb.append(this.clock); } first = false; if (!first) sb.append(", "); sb.append("error:"); if (this.error == null) { sb.append("null"); } else { sb.append(this.error); } first = false; if (!first) sb.append(", "); sb.append("lastUpdated:"); sb.append(this.lastUpdated); first = false; if (!first) sb.append(", "); sb.append("extractor:"); if (this.extractor == null) { sb.append("null"); } else { sb.append(this.extractor); } first = false; if (!first) sb.append(", "); sb.append("transformer:"); if (this.transformer == null) { sb.append("null"); } else { sb.append(this.transformer); } first = false; if (!first) sb.append(", "); sb.append("loader:"); if (this.loader == null) { sb.append("null"); } else { sb.append(this.loader); } first = false; if (!first) sb.append(", "); sb.append("state:"); if (this.state == null) { sb.append("null"); } else { sb.append(this.state); } first = false; if (!first) sb.append(", "); sb.append("startTime:"); sb.append(this.startTime); first = false; if (!first) sb.append(", "); sb.append("endTime:"); sb.append(this.endTime); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (extractor != null) { extractor.validate(); } if (transformer != null) { transformer.validate(); } if (loader != null) { loader.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol( new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol( new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class TPolicyStandardSchemeFactory implements SchemeFactory { public TPolicyStandardScheme getScheme() { return new TPolicyStandardScheme(); } } private static class TPolicyStandardScheme extends StandardScheme<TPolicy> { public void read(org.apache.thrift.protocol.TProtocol iprot, TPolicy struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.id = iprot.readString(); struct.setIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // CLOCK if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.clock = new TBatchClock(); struct.clock.read(iprot); struct.setClockIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // ERROR if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.error = iprot.readString(); struct.setErrorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // LAST_UPDATED if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.lastUpdated = iprot.readI64(); struct.setLastUpdatedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // EXTRACTOR if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.extractor = new TStage(); struct.extractor.read(iprot); struct.setExtractorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // TRANSFORMER if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transformer = new TStage(); struct.transformer.read(iprot); struct.setTransformerIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // LOADER if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.loader = new TStage(); struct.loader.read(iprot); struct.setLoaderIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // STATE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.state = com.kromatik.dasshy.thrift.model.TJobState.findByValue(iprot.readI32()); struct.setStateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // START_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.startTime = iprot.readI64(); struct.setStartTimeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // END_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.endTime = iprot.readI64(); struct.setEndTimeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TPolicy struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.id != null) { oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeString(struct.id); oprot.writeFieldEnd(); } if (struct.clock != null) { oprot.writeFieldBegin(CLOCK_FIELD_DESC); struct.clock.write(oprot); oprot.writeFieldEnd(); } if (struct.error != null) { oprot.writeFieldBegin(ERROR_FIELD_DESC); oprot.writeString(struct.error); oprot.writeFieldEnd(); } oprot.writeFieldBegin(LAST_UPDATED_FIELD_DESC); oprot.writeI64(struct.lastUpdated); oprot.writeFieldEnd(); if (struct.extractor != null) { oprot.writeFieldBegin(EXTRACTOR_FIELD_DESC); struct.extractor.write(oprot); oprot.writeFieldEnd(); } if (struct.transformer != null) { oprot.writeFieldBegin(TRANSFORMER_FIELD_DESC); struct.transformer.write(oprot); oprot.writeFieldEnd(); } if (struct.loader != null) { oprot.writeFieldBegin(LOADER_FIELD_DESC); struct.loader.write(oprot); oprot.writeFieldEnd(); } if (struct.state != null) { oprot.writeFieldBegin(STATE_FIELD_DESC); oprot.writeI32(struct.state.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(START_TIME_FIELD_DESC); oprot.writeI64(struct.startTime); oprot.writeFieldEnd(); oprot.writeFieldBegin(END_TIME_FIELD_DESC); oprot.writeI64(struct.endTime); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TPolicyTupleSchemeFactory implements SchemeFactory { public TPolicyTupleScheme getScheme() { return new TPolicyTupleScheme(); } } private static class TPolicyTupleScheme extends TupleScheme<TPolicy> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TPolicy struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetId()) { optionals.set(0); } if (struct.isSetClock()) { optionals.set(1); } if (struct.isSetError()) { optionals.set(2); } if (struct.isSetLastUpdated()) { optionals.set(3); } if (struct.isSetExtractor()) { optionals.set(4); } if (struct.isSetTransformer()) { optionals.set(5); } if (struct.isSetLoader()) { optionals.set(6); } if (struct.isSetState()) { optionals.set(7); } if (struct.isSetStartTime()) { optionals.set(8); } if (struct.isSetEndTime()) { optionals.set(9); } oprot.writeBitSet(optionals, 10); if (struct.isSetId()) { oprot.writeString(struct.id); } if (struct.isSetClock()) { struct.clock.write(oprot); } if (struct.isSetError()) { oprot.writeString(struct.error); } if (struct.isSetLastUpdated()) { oprot.writeI64(struct.lastUpdated); } if (struct.isSetExtractor()) { struct.extractor.write(oprot); } if (struct.isSetTransformer()) { struct.transformer.write(oprot); } if (struct.isSetLoader()) { struct.loader.write(oprot); } if (struct.isSetState()) { oprot.writeI32(struct.state.getValue()); } if (struct.isSetStartTime()) { oprot.writeI64(struct.startTime); } if (struct.isSetEndTime()) { oprot.writeI64(struct.endTime); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TPolicy struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(10); if (incoming.get(0)) { struct.id = iprot.readString(); struct.setIdIsSet(true); } if (incoming.get(1)) { struct.clock = new TBatchClock(); struct.clock.read(iprot); struct.setClockIsSet(true); } if (incoming.get(2)) { struct.error = iprot.readString(); struct.setErrorIsSet(true); } if (incoming.get(3)) { struct.lastUpdated = iprot.readI64(); struct.setLastUpdatedIsSet(true); } if (incoming.get(4)) { struct.extractor = new TStage(); struct.extractor.read(iprot); struct.setExtractorIsSet(true); } if (incoming.get(5)) { struct.transformer = new TStage(); struct.transformer.read(iprot); struct.setTransformerIsSet(true); } if (incoming.get(6)) { struct.loader = new TStage(); struct.loader.read(iprot); struct.setLoaderIsSet(true); } if (incoming.get(7)) { struct.state = com.kromatik.dasshy.thrift.model.TJobState.findByValue(iprot.readI32()); struct.setStateIsSet(true); } if (incoming.get(8)) { struct.startTime = iprot.readI64(); struct.setStartTimeIsSet(true); } if (incoming.get(9)) { struct.endTime = iprot.readI64(); struct.setEndTimeIsSet(true); } } } }