Esempio n. 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, SkewedInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetSkewedColNames()) {
     optionals.set(0);
   }
   if (struct.isSetSkewedColValues()) {
     optionals.set(1);
   }
   if (struct.isSetSkewedColValueLocationMaps()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetSkewedColNames()) {
     {
       oprot.writeI32(struct.skewedColNames.size());
       for (String _iter135 : struct.skewedColNames) {
         oprot.writeString(_iter135);
       }
     }
   }
   if (struct.isSetSkewedColValues()) {
     {
       oprot.writeI32(struct.skewedColValues.size());
       for (List<String> _iter136 : struct.skewedColValues) {
         {
           oprot.writeI32(_iter136.size());
           for (String _iter137 : _iter136) {
             oprot.writeString(_iter137);
           }
         }
       }
     }
   }
   if (struct.isSetSkewedColValueLocationMaps()) {
     {
       oprot.writeI32(struct.skewedColValueLocationMaps.size());
       for (Map.Entry<List<String>, String> _iter138 :
           struct.skewedColValueLocationMaps.entrySet()) {
         {
           oprot.writeI32(_iter138.getKey().size());
           for (String _iter139 : _iter138.getKey()) {
             oprot.writeString(_iter139);
           }
         }
         oprot.writeString(_iter138.getValue());
       }
     }
   }
 }
Esempio n. 2
0
  public boolean equals(SkewedInfo that) {
    if (that == null) return false;

    boolean this_present_skewedColNames = true && this.isSetSkewedColNames();
    boolean that_present_skewedColNames = true && that.isSetSkewedColNames();
    if (this_present_skewedColNames || that_present_skewedColNames) {
      if (!(this_present_skewedColNames && that_present_skewedColNames)) return false;
      if (!this.skewedColNames.equals(that.skewedColNames)) return false;
    }

    boolean this_present_skewedColValues = true && this.isSetSkewedColValues();
    boolean that_present_skewedColValues = true && that.isSetSkewedColValues();
    if (this_present_skewedColValues || that_present_skewedColValues) {
      if (!(this_present_skewedColValues && that_present_skewedColValues)) return false;
      if (!this.skewedColValues.equals(that.skewedColValues)) return false;
    }

    boolean this_present_skewedColValueLocationMaps =
        true && this.isSetSkewedColValueLocationMaps();
    boolean that_present_skewedColValueLocationMaps =
        true && that.isSetSkewedColValueLocationMaps();
    if (this_present_skewedColValueLocationMaps || that_present_skewedColValueLocationMaps) {
      if (!(this_present_skewedColValueLocationMaps && that_present_skewedColValueLocationMaps))
        return false;
      if (!this.skewedColValueLocationMaps.equals(that.skewedColValueLocationMaps)) return false;
    }

    return true;
  }
Esempio n. 3
0
  public int compareTo(SkewedInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    SkewedInfo typedOther = (SkewedInfo) other;

    lastComparison =
        Boolean.valueOf(isSetSkewedColNames()).compareTo(typedOther.isSetSkewedColNames());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSkewedColNames()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.skewedColNames, typedOther.skewedColNames);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetSkewedColValues()).compareTo(typedOther.isSetSkewedColValues());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSkewedColValues()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.skewedColValues, typedOther.skewedColValues);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetSkewedColValueLocationMaps())
            .compareTo(typedOther.isSetSkewedColValueLocationMaps());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSkewedColValueLocationMaps()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.skewedColValueLocationMaps, typedOther.skewedColValueLocationMaps);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Esempio n. 4
0
  /** Performs a deep copy on <i>other</i>. */
  public SkewedInfo(SkewedInfo other) {
    if (other.isSetSkewedColNames()) {
      List<String> __this__skewedColNames = new ArrayList<String>();
      for (String other_element : other.skewedColNames) {
        __this__skewedColNames.add(other_element);
      }
      this.skewedColNames = __this__skewedColNames;
    }
    if (other.isSetSkewedColValues()) {
      List<List<String>> __this__skewedColValues = new ArrayList<List<String>>();
      for (List<String> other_element : other.skewedColValues) {
        List<String> __this__skewedColValues_copy = new ArrayList<String>();
        for (String other_element_element : other_element) {
          __this__skewedColValues_copy.add(other_element_element);
        }
        __this__skewedColValues.add(__this__skewedColValues_copy);
      }
      this.skewedColValues = __this__skewedColValues;
    }
    if (other.isSetSkewedColValueLocationMaps()) {
      Map<List<String>, String> __this__skewedColValueLocationMaps =
          new HashMap<List<String>, String>();
      for (Map.Entry<List<String>, String> other_element :
          other.skewedColValueLocationMaps.entrySet()) {

        List<String> other_element_key = other_element.getKey();
        String other_element_value = other_element.getValue();

        List<String> __this__skewedColValueLocationMaps_copy_key = new ArrayList<String>();
        for (String other_element_key_element : other_element_key) {
          __this__skewedColValueLocationMaps_copy_key.add(other_element_key_element);
        }

        String __this__skewedColValueLocationMaps_copy_value = other_element_value;

        __this__skewedColValueLocationMaps.put(
            __this__skewedColValueLocationMaps_copy_key,
            __this__skewedColValueLocationMaps_copy_value);
      }
      this.skewedColValueLocationMaps = __this__skewedColValueLocationMaps;
    }
  }