Example #1
0
  public boolean equals(MkdirCmd that) {
    if (that == null) return false;

    boolean this_present_path = true && this.isSetPath();
    boolean that_present_path = true && that.isSetPath();
    if (this_present_path || that_present_path) {
      if (!(this_present_path && that_present_path)) return false;
      if (!this.path.equals(that.path)) return false;
    }

    boolean this_present_mode = true;
    boolean that_present_mode = true;
    if (this_present_mode || that_present_mode) {
      if (!(this_present_mode && that_present_mode)) return false;
      if (this.mode != that.mode) return false;
    }

    boolean this_present_uid = true;
    boolean that_present_uid = true;
    if (this_present_uid || that_present_uid) {
      if (!(this_present_uid && that_present_uid)) return false;
      if (this.uid != that.uid) return false;
    }

    boolean this_present_gid = true;
    boolean that_present_gid = true;
    if (this_present_gid || that_present_gid) {
      if (!(this_present_gid && that_present_gid)) return false;
      if (this.gid != that.gid) return false;
    }

    boolean this_present_parentPartition = true && this.isSetParentPartition();
    boolean that_present_parentPartition = true && that.isSetParentPartition();
    if (this_present_parentPartition || that_present_parentPartition) {
      if (!(this_present_parentPartition && that_present_parentPartition)) return false;
      if (!this.parentPartition.equals(that.parentPartition)) return false;
    }

    boolean this_present_partition = true && this.isSetPartition();
    boolean that_present_partition = true && that.isSetPartition();
    if (this_present_partition || that_present_partition) {
      if (!(this_present_partition && that_present_partition)) return false;
      if (!this.partition.equals(that.partition)) return false;
    }

    return true;
  }
Example #2
0
 /** Performs a deep copy on <i>other</i>. */
 public MkdirCmd(MkdirCmd other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetPath()) {
     this.path = other.path;
   }
   this.mode = other.mode;
   this.uid = other.uid;
   this.gid = other.gid;
   if (other.isSetParentPartition()) {
     Set<Byte> __this__parentPartition = new HashSet<Byte>(other.parentPartition);
     this.parentPartition = __this__parentPartition;
   }
   if (other.isSetPartition()) {
     Set<Byte> __this__partition = new HashSet<Byte>(other.partition);
     this.partition = __this__partition;
   }
 }
Example #3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, MkdirCmd struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.path != null) {
        oprot.writeFieldBegin(PATH_FIELD_DESC);
        oprot.writeString(struct.path);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(MODE_FIELD_DESC);
      oprot.writeI32(struct.mode);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(UID_FIELD_DESC);
      oprot.writeI32(struct.uid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(GID_FIELD_DESC);
      oprot.writeI32(struct.gid);
      oprot.writeFieldEnd();
      if (struct.parentPartition != null) {
        oprot.writeFieldBegin(PARENT_PARTITION_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.BYTE, struct.parentPartition.size()));
          for (byte _iter38 : struct.parentPartition) {
            oprot.writeByte(_iter38);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.partition != null) {
        oprot.writeFieldBegin(PARTITION_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.BYTE, struct.partition.size()));
          for (byte _iter39 : struct.partition) {
            oprot.writeByte(_iter39);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Example #4
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, MkdirCmd struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(6);
   if (incoming.get(0)) {
     struct.path = iprot.readString();
     struct.setPathIsSet(true);
   }
   if (incoming.get(1)) {
     struct.mode = iprot.readI32();
     struct.setModeIsSet(true);
   }
   if (incoming.get(2)) {
     struct.uid = iprot.readI32();
     struct.setUidIsSet(true);
   }
   if (incoming.get(3)) {
     struct.gid = iprot.readI32();
     struct.setGidIsSet(true);
   }
   if (incoming.get(4)) {
     {
       org.apache.thrift.protocol.TSet _set42 =
           new org.apache.thrift.protocol.TSet(
               org.apache.thrift.protocol.TType.BYTE, iprot.readI32());
       struct.parentPartition = new HashSet<Byte>(2 * _set42.size);
       for (int _i43 = 0; _i43 < _set42.size; ++_i43) {
         byte _elem44;
         _elem44 = iprot.readByte();
         struct.parentPartition.add(_elem44);
       }
     }
     struct.setParentPartitionIsSet(true);
   }
   if (incoming.get(5)) {
     {
       org.apache.thrift.protocol.TSet _set45 =
           new org.apache.thrift.protocol.TSet(
               org.apache.thrift.protocol.TType.BYTE, iprot.readI32());
       struct.partition = new HashSet<Byte>(2 * _set45.size);
       for (int _i46 = 0; _i46 < _set45.size; ++_i46) {
         byte _elem47;
         _elem47 = iprot.readByte();
         struct.partition.add(_elem47);
       }
     }
     struct.setPartitionIsSet(true);
   }
 }
Example #5
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, MkdirCmd struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetPath()) {
     optionals.set(0);
   }
   if (struct.isSetMode()) {
     optionals.set(1);
   }
   if (struct.isSetUid()) {
     optionals.set(2);
   }
   if (struct.isSetGid()) {
     optionals.set(3);
   }
   if (struct.isSetParentPartition()) {
     optionals.set(4);
   }
   if (struct.isSetPartition()) {
     optionals.set(5);
   }
   oprot.writeBitSet(optionals, 6);
   if (struct.isSetPath()) {
     oprot.writeString(struct.path);
   }
   if (struct.isSetMode()) {
     oprot.writeI32(struct.mode);
   }
   if (struct.isSetUid()) {
     oprot.writeI32(struct.uid);
   }
   if (struct.isSetGid()) {
     oprot.writeI32(struct.gid);
   }
   if (struct.isSetParentPartition()) {
     {
       oprot.writeI32(struct.parentPartition.size());
       for (byte _iter40 : struct.parentPartition) {
         oprot.writeByte(_iter40);
       }
     }
   }
   if (struct.isSetPartition()) {
     {
       oprot.writeI32(struct.partition.size());
       for (byte _iter41 : struct.partition) {
         oprot.writeByte(_iter41);
       }
     }
   }
 }
Example #6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, MkdirCmd 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 3: // PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.path = iprot.readString();
              struct.setPathIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // MODE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.mode = iprot.readI32();
              struct.setModeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // UID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.uid = iprot.readI32();
              struct.setUidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // GID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.gid = iprot.readI32();
              struct.setGidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // PARENT_PARTITION
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set32 = iprot.readSetBegin();
                struct.parentPartition = new HashSet<Byte>(2 * _set32.size);
                for (int _i33 = 0; _i33 < _set32.size; ++_i33) {
                  byte _elem34;
                  _elem34 = iprot.readByte();
                  struct.parentPartition.add(_elem34);
                }
                iprot.readSetEnd();
              }
              struct.setParentPartitionIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // PARTITION
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set35 = iprot.readSetBegin();
                struct.partition = new HashSet<Byte>(2 * _set35.size);
                for (int _i36 = 0; _i36 < _set35.size; ++_i36) {
                  byte _elem37;
                  _elem37 = iprot.readByte();
                  struct.partition.add(_elem37);
                }
                iprot.readSetEnd();
              }
              struct.setPartitionIsSet(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();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }
Example #7
0
  @Override
  public int compareTo(MkdirCmd other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMode()).compareTo(other.isSetMode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mode, other.mode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGid()).compareTo(other.isSetGid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gid, other.gid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetParentPartition()).compareTo(other.isSetParentPartition());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParentPartition()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.parentPartition, other.parentPartition);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPartition()).compareTo(other.isSetPartition());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartition()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partition, other.partition);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }