@Override
 public void read(org.apache.thrift.protocol.TProtocol prot, ClientRawTableInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(5);
   if (incoming.get(0)) {
     struct.id = iprot.readI32();
     struct.setIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.name = iprot.readString();
     struct.setNameIsSet(true);
   }
   if (incoming.get(2)) {
     struct.path = iprot.readString();
     struct.setPathIsSet(true);
   }
   if (incoming.get(3)) {
     struct.columns = iprot.readI32();
     struct.setColumnsIsSet(true);
   }
   if (incoming.get(4)) {
     struct.metadata = iprot.readBinary();
     struct.setMetadataIsSet(true);
   }
 }
示例#2
0
  public RawColumn getRawColumn(int columnIndex) {
    if (columnIndex < 0 || columnIndex >= CLIENT_RAW_TABLE_INFO.getColumns()) {
      CommonUtils.runtimeException(
          CLIENT_RAW_TABLE_INFO.getPath()
              + " does not have column "
              + columnIndex
              + ". It has "
              + CLIENT_RAW_TABLE_INFO.getColumns()
              + " columns.");
    }

    return new RawColumn(TACHYON_CLIENT, this, columnIndex);
  }
  public int compareTo(ClientRawTableInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPath()).compareTo(typedOther.isSetPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, typedOther.path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumns()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(typedOther.isSetMetadata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetadata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, typedOther.metadata);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
 /** Performs a deep copy on <i>other</i>. */
 public ClientRawTableInfo(ClientRawTableInfo other) {
   __isset_bitfield = other.__isset_bitfield;
   this.id = other.id;
   if (other.isSetName()) {
     this.name = other.name;
   }
   if (other.isSetPath()) {
     this.path = other.path;
   }
   this.columns = other.columns;
   if (other.isSetMetadata()) {
     this.metadata = org.apache.thrift.TBaseHelper.copyBinary(other.metadata);
     ;
   }
 }
    public void write(org.apache.thrift.protocol.TProtocol oprot, ClientRawTableInfo struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI32(struct.id);
      oprot.writeFieldEnd();
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      if (struct.path != null) {
        oprot.writeFieldBegin(PATH_FIELD_DESC);
        oprot.writeString(struct.path);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
      oprot.writeI32(struct.columns);
      oprot.writeFieldEnd();
      if (struct.metadata != null) {
        oprot.writeFieldBegin(METADATA_FIELD_DESC);
        oprot.writeBinary(struct.metadata);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
  public boolean equals(ClientRawTableInfo that) {
    if (that == null) return false;

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id)) return false;
      if (this.id != that.id) return false;
    }

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name)) return false;
      if (!this.name.equals(that.name)) 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_columns = true;
    boolean that_present_columns = true;
    if (this_present_columns || that_present_columns) {
      if (!(this_present_columns && that_present_columns)) return false;
      if (this.columns != that.columns) return false;
    }

    boolean this_present_metadata = true && this.isSetMetadata();
    boolean that_present_metadata = true && that.isSetMetadata();
    if (this_present_metadata || that_present_metadata) {
      if (!(this_present_metadata && that_present_metadata)) return false;
      if (!this.metadata.equals(that.metadata)) return false;
    }

    return true;
  }
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ClientRawTableInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetId()) {
     optionals.set(0);
   }
   if (struct.isSetName()) {
     optionals.set(1);
   }
   if (struct.isSetPath()) {
     optionals.set(2);
   }
   if (struct.isSetColumns()) {
     optionals.set(3);
   }
   if (struct.isSetMetadata()) {
     optionals.set(4);
   }
   oprot.writeBitSet(optionals, 5);
   if (struct.isSetId()) {
     oprot.writeI32(struct.id);
   }
   if (struct.isSetName()) {
     oprot.writeString(struct.name);
   }
   if (struct.isSetPath()) {
     oprot.writeString(struct.path);
   }
   if (struct.isSetColumns()) {
     oprot.writeI32(struct.columns);
   }
   if (struct.isSetMetadata()) {
     oprot.writeBinary(struct.metadata);
   }
 }
    public void read(org.apache.thrift.protocol.TProtocol iprot, ClientRawTableInfo 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.I32) {
              struct.id = iprot.readI32();
              struct.setIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          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: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.columns = iprot.readI32();
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // METADATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.metadata = iprot.readBinary();
              struct.setMetadataIsSet(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();
    }
示例#9
0
 public void updateMetadata(ByteBuffer metadata) throws IOException {
   TACHYON_CLIENT.updateRawTableMetadata(CLIENT_RAW_TABLE_INFO.getId(), metadata);
   CLIENT_RAW_TABLE_INFO.setMetadata(CommonUtils.cloneByteBuffer(metadata));
 }
示例#10
0
 public String getPath() {
   return CLIENT_RAW_TABLE_INFO.getPath();
 }
示例#11
0
 public String getName() {
   return CLIENT_RAW_TABLE_INFO.getName();
 }
示例#12
0
 public int getId() {
   return CLIENT_RAW_TABLE_INFO.getId();
 }
示例#13
0
 public int getColumns() {
   return CLIENT_RAW_TABLE_INFO.getColumns();
 }