Subversion Repositories SmartDukaan

Rev

Rev 12169 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12169 Rev 12243
Line 29... Line 29...
29
  private static final org.apache.thrift.protocol.TField SD_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("sdPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
29
  private static final org.apache.thrift.protocol.TField SD_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("sdPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
30
  private static final org.apache.thrift.protocol.TField FK_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("fkPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
30
  private static final org.apache.thrift.protocol.TField FK_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("fkPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
31
  private static final org.apache.thrift.protocol.TField AMAZON_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
31
  private static final org.apache.thrift.protocol.TField AMAZON_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
32
  private static final org.apache.thrift.protocol.TField PRODUCT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("productName", org.apache.thrift.protocol.TType.STRING, (short)7);
32
  private static final org.apache.thrift.protocol.TField PRODUCT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("productName", org.apache.thrift.protocol.TType.STRING, (short)7);
33
  private static final org.apache.thrift.protocol.TField LAST_PROCESSED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("lastProcessedTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);
33
  private static final org.apache.thrift.protocol.TField LAST_PROCESSED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("lastProcessedTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);
-
 
34
  private static final org.apache.thrift.protocol.TField DIFF_FIELD_DESC = new org.apache.thrift.protocol.TField("diff", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
34
 
35
 
35
  private long item_id; // required
36
  private long item_id; // required
36
  private double dealPrice; // required
37
  private double dealPrice; // required
37
  private double saholicPrice; // required
38
  private double saholicPrice; // required
38
  private double sdPrice; // required
39
  private double sdPrice; // required
39
  private double fkPrice; // required
40
  private double fkPrice; // required
40
  private double amazonPrice; // required
41
  private double amazonPrice; // required
41
  private String productName; // required
42
  private String productName; // required
42
  private long lastProcessedTimestamp; // required
43
  private long lastProcessedTimestamp; // required
-
 
44
  private double diff; // required
43
 
45
 
44
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
46
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
45
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
47
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
46
    ITEM_ID((short)1, "item_id"),
48
    ITEM_ID((short)1, "item_id"),
47
    DEAL_PRICE((short)2, "dealPrice"),
49
    DEAL_PRICE((short)2, "dealPrice"),
48
    SAHOLIC_PRICE((short)3, "saholicPrice"),
50
    SAHOLIC_PRICE((short)3, "saholicPrice"),
49
    SD_PRICE((short)4, "sdPrice"),
51
    SD_PRICE((short)4, "sdPrice"),
50
    FK_PRICE((short)5, "fkPrice"),
52
    FK_PRICE((short)5, "fkPrice"),
51
    AMAZON_PRICE((short)6, "amazonPrice"),
53
    AMAZON_PRICE((short)6, "amazonPrice"),
52
    PRODUCT_NAME((short)7, "productName"),
54
    PRODUCT_NAME((short)7, "productName"),
53
    LAST_PROCESSED_TIMESTAMP((short)8, "lastProcessedTimestamp");
55
    LAST_PROCESSED_TIMESTAMP((short)8, "lastProcessedTimestamp"),
-
 
56
    DIFF((short)9, "diff");
54
 
57
 
55
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
58
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
56
 
59
 
57
    static {
60
    static {
58
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
61
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 79... Line 82...
79
          return AMAZON_PRICE;
82
          return AMAZON_PRICE;
80
        case 7: // PRODUCT_NAME
83
        case 7: // PRODUCT_NAME
81
          return PRODUCT_NAME;
84
          return PRODUCT_NAME;
82
        case 8: // LAST_PROCESSED_TIMESTAMP
85
        case 8: // LAST_PROCESSED_TIMESTAMP
83
          return LAST_PROCESSED_TIMESTAMP;
86
          return LAST_PROCESSED_TIMESTAMP;
-
 
87
        case 9: // DIFF
-
 
88
          return DIFF;
84
        default:
89
        default:
85
          return null;
90
          return null;
86
      }
91
      }
87
    }
92
    }
88
 
93
 
Line 126... Line 131...
126
  private static final int __SAHOLICPRICE_ISSET_ID = 2;
131
  private static final int __SAHOLICPRICE_ISSET_ID = 2;
127
  private static final int __SDPRICE_ISSET_ID = 3;
132
  private static final int __SDPRICE_ISSET_ID = 3;
128
  private static final int __FKPRICE_ISSET_ID = 4;
133
  private static final int __FKPRICE_ISSET_ID = 4;
129
  private static final int __AMAZONPRICE_ISSET_ID = 5;
134
  private static final int __AMAZONPRICE_ISSET_ID = 5;
130
  private static final int __LASTPROCESSEDTIMESTAMP_ISSET_ID = 6;
135
  private static final int __LASTPROCESSEDTIMESTAMP_ISSET_ID = 6;
-
 
136
  private static final int __DIFF_ISSET_ID = 7;
131
  private BitSet __isset_bit_vector = new BitSet(7);
137
  private BitSet __isset_bit_vector = new BitSet(8);
132
 
138
 
133
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
139
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
134
  static {
140
  static {
135
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
141
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
136
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 147... Line 153...
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
153
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
148
    tmpMap.put(_Fields.PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("productName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
    tmpMap.put(_Fields.PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("productName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
150
    tmpMap.put(_Fields.LAST_PROCESSED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("lastProcessedTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
    tmpMap.put(_Fields.LAST_PROCESSED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("lastProcessedTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
157
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
158
    tmpMap.put(_Fields.DIFF, new org.apache.thrift.meta_data.FieldMetaData("diff", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
159
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
152
    metaDataMap = Collections.unmodifiableMap(tmpMap);
160
    metaDataMap = Collections.unmodifiableMap(tmpMap);
153
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PdPriceComp.class, metaDataMap);
161
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PdPriceComp.class, metaDataMap);
154
  }
162
  }
155
 
163
 
156
  public PdPriceComp() {
164
  public PdPriceComp() {
Line 162... Line 170...
162
    double saholicPrice,
170
    double saholicPrice,
163
    double sdPrice,
171
    double sdPrice,
164
    double fkPrice,
172
    double fkPrice,
165
    double amazonPrice,
173
    double amazonPrice,
166
    String productName,
174
    String productName,
167
    long lastProcessedTimestamp)
175
    long lastProcessedTimestamp,
-
 
176
    double diff)
168
  {
177
  {
169
    this();
178
    this();
170
    this.item_id = item_id;
179
    this.item_id = item_id;
171
    setItem_idIsSet(true);
180
    setItem_idIsSet(true);
172
    this.dealPrice = dealPrice;
181
    this.dealPrice = dealPrice;
Line 180... Line 189...
180
    this.amazonPrice = amazonPrice;
189
    this.amazonPrice = amazonPrice;
181
    setAmazonPriceIsSet(true);
190
    setAmazonPriceIsSet(true);
182
    this.productName = productName;
191
    this.productName = productName;
183
    this.lastProcessedTimestamp = lastProcessedTimestamp;
192
    this.lastProcessedTimestamp = lastProcessedTimestamp;
184
    setLastProcessedTimestampIsSet(true);
193
    setLastProcessedTimestampIsSet(true);
-
 
194
    this.diff = diff;
-
 
195
    setDiffIsSet(true);
185
  }
196
  }
186
 
197
 
187
  /**
198
  /**
188
   * Performs a deep copy on <i>other</i>.
199
   * Performs a deep copy on <i>other</i>.
189
   */
200
   */
Line 198... Line 209...
198
    this.amazonPrice = other.amazonPrice;
209
    this.amazonPrice = other.amazonPrice;
199
    if (other.isSetProductName()) {
210
    if (other.isSetProductName()) {
200
      this.productName = other.productName;
211
      this.productName = other.productName;
201
    }
212
    }
202
    this.lastProcessedTimestamp = other.lastProcessedTimestamp;
213
    this.lastProcessedTimestamp = other.lastProcessedTimestamp;
-
 
214
    this.diff = other.diff;
203
  }
215
  }
204
 
216
 
205
  public PdPriceComp deepCopy() {
217
  public PdPriceComp deepCopy() {
206
    return new PdPriceComp(this);
218
    return new PdPriceComp(this);
207
  }
219
  }
Line 221... Line 233...
221
    setAmazonPriceIsSet(false);
233
    setAmazonPriceIsSet(false);
222
    this.amazonPrice = 0.0;
234
    this.amazonPrice = 0.0;
223
    this.productName = null;
235
    this.productName = null;
224
    setLastProcessedTimestampIsSet(false);
236
    setLastProcessedTimestampIsSet(false);
225
    this.lastProcessedTimestamp = 0;
237
    this.lastProcessedTimestamp = 0;
-
 
238
    setDiffIsSet(false);
-
 
239
    this.diff = 0.0;
226
  }
240
  }
227
 
241
 
228
  public long getItem_id() {
242
  public long getItem_id() {
229
    return this.item_id;
243
    return this.item_id;
230
  }
244
  }
Line 400... Line 414...
400
 
414
 
401
  public void setLastProcessedTimestampIsSet(boolean value) {
415
  public void setLastProcessedTimestampIsSet(boolean value) {
402
    __isset_bit_vector.set(__LASTPROCESSEDTIMESTAMP_ISSET_ID, value);
416
    __isset_bit_vector.set(__LASTPROCESSEDTIMESTAMP_ISSET_ID, value);
403
  }
417
  }
404
 
418
 
-
 
419
  public double getDiff() {
-
 
420
    return this.diff;
-
 
421
  }
-
 
422
 
-
 
423
  public void setDiff(double diff) {
-
 
424
    this.diff = diff;
-
 
425
    setDiffIsSet(true);
-
 
426
  }
-
 
427
 
-
 
428
  public void unsetDiff() {
-
 
429
    __isset_bit_vector.clear(__DIFF_ISSET_ID);
-
 
430
  }
-
 
431
 
-
 
432
  /** Returns true if field diff is set (has been assigned a value) and false otherwise */
-
 
433
  public boolean isSetDiff() {
-
 
434
    return __isset_bit_vector.get(__DIFF_ISSET_ID);
-
 
435
  }
-
 
436
 
-
 
437
  public void setDiffIsSet(boolean value) {
-
 
438
    __isset_bit_vector.set(__DIFF_ISSET_ID, value);
-
 
439
  }
-
 
440
 
405
  public void setFieldValue(_Fields field, Object value) {
441
  public void setFieldValue(_Fields field, Object value) {
406
    switch (field) {
442
    switch (field) {
407
    case ITEM_ID:
443
    case ITEM_ID:
408
      if (value == null) {
444
      if (value == null) {
409
        unsetItem_id();
445
        unsetItem_id();
Line 466... Line 502...
466
      } else {
502
      } else {
467
        setLastProcessedTimestamp((Long)value);
503
        setLastProcessedTimestamp((Long)value);
468
      }
504
      }
469
      break;
505
      break;
470
 
506
 
-
 
507
    case DIFF:
-
 
508
      if (value == null) {
-
 
509
        unsetDiff();
-
 
510
      } else {
-
 
511
        setDiff((Double)value);
-
 
512
      }
-
 
513
      break;
-
 
514
 
471
    }
515
    }
472
  }
516
  }
473
 
517
 
474
  public Object getFieldValue(_Fields field) {
518
  public Object getFieldValue(_Fields field) {
475
    switch (field) {
519
    switch (field) {
Line 495... Line 539...
495
      return getProductName();
539
      return getProductName();
496
 
540
 
497
    case LAST_PROCESSED_TIMESTAMP:
541
    case LAST_PROCESSED_TIMESTAMP:
498
      return Long.valueOf(getLastProcessedTimestamp());
542
      return Long.valueOf(getLastProcessedTimestamp());
499
 
543
 
-
 
544
    case DIFF:
-
 
545
      return Double.valueOf(getDiff());
-
 
546
 
500
    }
547
    }
501
    throw new IllegalStateException();
548
    throw new IllegalStateException();
502
  }
549
  }
503
 
550
 
504
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
551
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 522... Line 569...
522
      return isSetAmazonPrice();
569
      return isSetAmazonPrice();
523
    case PRODUCT_NAME:
570
    case PRODUCT_NAME:
524
      return isSetProductName();
571
      return isSetProductName();
525
    case LAST_PROCESSED_TIMESTAMP:
572
    case LAST_PROCESSED_TIMESTAMP:
526
      return isSetLastProcessedTimestamp();
573
      return isSetLastProcessedTimestamp();
-
 
574
    case DIFF:
-
 
575
      return isSetDiff();
527
    }
576
    }
528
    throw new IllegalStateException();
577
    throw new IllegalStateException();
529
  }
578
  }
530
 
579
 
531
  @Override
580
  @Override
Line 611... Line 660...
611
        return false;
660
        return false;
612
      if (this.lastProcessedTimestamp != that.lastProcessedTimestamp)
661
      if (this.lastProcessedTimestamp != that.lastProcessedTimestamp)
613
        return false;
662
        return false;
614
    }
663
    }
615
 
664
 
-
 
665
    boolean this_present_diff = true;
-
 
666
    boolean that_present_diff = true;
-
 
667
    if (this_present_diff || that_present_diff) {
-
 
668
      if (!(this_present_diff && that_present_diff))
-
 
669
        return false;
-
 
670
      if (this.diff != that.diff)
-
 
671
        return false;
-
 
672
    }
-
 
673
 
616
    return true;
674
    return true;
617
  }
675
  }
618
 
676
 
619
  @Override
677
  @Override
620
  public int hashCode() {
678
  public int hashCode() {
Line 707... Line 765...
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastProcessedTimestamp, typedOther.lastProcessedTimestamp);
765
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastProcessedTimestamp, typedOther.lastProcessedTimestamp);
708
      if (lastComparison != 0) {
766
      if (lastComparison != 0) {
709
        return lastComparison;
767
        return lastComparison;
710
      }
768
      }
711
    }
769
    }
-
 
770
    lastComparison = Boolean.valueOf(isSetDiff()).compareTo(typedOther.isSetDiff());
-
 
771
    if (lastComparison != 0) {
-
 
772
      return lastComparison;
-
 
773
    }
-
 
774
    if (isSetDiff()) {
-
 
775
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.diff, typedOther.diff);
-
 
776
      if (lastComparison != 0) {
-
 
777
        return lastComparison;
-
 
778
      }
-
 
779
    }
712
    return 0;
780
    return 0;
713
  }
781
  }
714
 
782
 
715
  public _Fields fieldForId(int fieldId) {
783
  public _Fields fieldForId(int fieldId) {
716
    return _Fields.findByThriftId(fieldId);
784
    return _Fields.findByThriftId(fieldId);
Line 787... Line 855...
787
            setLastProcessedTimestampIsSet(true);
855
            setLastProcessedTimestampIsSet(true);
788
          } else { 
856
          } else { 
789
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
857
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
790
          }
858
          }
791
          break;
859
          break;
-
 
860
        case 9: // DIFF
-
 
861
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
-
 
862
            this.diff = iprot.readDouble();
-
 
863
            setDiffIsSet(true);
-
 
864
          } else { 
-
 
865
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
866
          }
-
 
867
          break;
792
        default:
868
        default:
793
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
869
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
794
      }
870
      }
795
      iprot.readFieldEnd();
871
      iprot.readFieldEnd();
796
    }
872
    }
Line 826... Line 902...
826
      oprot.writeFieldEnd();
902
      oprot.writeFieldEnd();
827
    }
903
    }
828
    oprot.writeFieldBegin(LAST_PROCESSED_TIMESTAMP_FIELD_DESC);
904
    oprot.writeFieldBegin(LAST_PROCESSED_TIMESTAMP_FIELD_DESC);
829
    oprot.writeI64(this.lastProcessedTimestamp);
905
    oprot.writeI64(this.lastProcessedTimestamp);
830
    oprot.writeFieldEnd();
906
    oprot.writeFieldEnd();
-
 
907
    oprot.writeFieldBegin(DIFF_FIELD_DESC);
-
 
908
    oprot.writeDouble(this.diff);
-
 
909
    oprot.writeFieldEnd();
831
    oprot.writeFieldStop();
910
    oprot.writeFieldStop();
832
    oprot.writeStructEnd();
911
    oprot.writeStructEnd();
833
  }
912
  }
834
 
913
 
835
  @Override
914
  @Override
Line 870... Line 949...
870
    first = false;
949
    first = false;
871
    if (!first) sb.append(", ");
950
    if (!first) sb.append(", ");
872
    sb.append("lastProcessedTimestamp:");
951
    sb.append("lastProcessedTimestamp:");
873
    sb.append(this.lastProcessedTimestamp);
952
    sb.append(this.lastProcessedTimestamp);
874
    first = false;
953
    first = false;
-
 
954
    if (!first) sb.append(", ");
-
 
955
    sb.append("diff:");
-
 
956
    sb.append(this.diff);
-
 
957
    first = false;
875
    sb.append(")");
958
    sb.append(")");
876
    return sb.toString();
959
    return sb.toString();
877
  }
960
  }
878
 
961
 
879
  public void validate() throws org.apache.thrift.TException {
962
  public void validate() throws org.apache.thrift.TException {