public static TTableName tableNameFromHBase(TableName table) { TTableName tableName = new TTableName(); tableName.setNs(table.getNamespace()); tableName.setQualifier(table.getQualifier()); return tableName; }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TTableName) return this.equals((TTableName)that); return false; }
public static TableName tableNameFromThrift(TTableName tableName) { return TableName.valueOf(tableName.getNs(), tableName.getQualifier()); }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetNs()) ? 131071 : 524287); if (isSetNs()) hashCode = hashCode * 8191 + ns.hashCode(); hashCode = hashCode * 8191 + ((isSetQualifier()) ? 131071 : 524287); if (isSetQualifier()) hashCode = hashCode * 8191 + qualifier.hashCode(); return hashCode; }
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NS: if (value == null) { unsetNs(); } else { if (value instanceof byte[]) { setNs((byte[])value); } else { setNs((java.nio.ByteBuffer)value); } } break; case QUALIFIER: if (value == null) { unsetQualifier(); } else { if (value instanceof byte[]) { setQualifier((byte[])value); } else { setQualifier((java.nio.ByteBuffer)value); } } break; } }
case 1: // TABLE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.tableName = new TTableName(); struct.tableName.read(iprot); struct.setTableNameIsSet(true); } else {
public TTableName deepCopy() { return new TTableName(this); }
/** * tablename */ public byte[] getQualifier() { setQualifier(org.apache.thrift.TBaseHelper.rightSize(qualifier)); return qualifier == null ? null : qualifier.array(); }
/** * namespace name */ public byte[] getNs() { setNs(org.apache.thrift.TBaseHelper.rightSize(ns)); return ns == null ? null : ns.array(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, TTableName struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.ns != null) { if (struct.isSetNs()) { oprot.writeFieldBegin(NS_FIELD_DESC); oprot.writeBinary(struct.ns); oprot.writeFieldEnd(); } } if (struct.qualifier != null) { oprot.writeFieldBegin(QUALIFIER_FIELD_DESC); oprot.writeBinary(struct.qualifier); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableName struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeBinary(struct.qualifier); java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetNs()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetNs()) { oprot.writeBinary(struct.ns); } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { 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); } }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); if (isSetTableName()) hashCode = hashCode * 8191 + tableName.hashCode(); hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); if (isSetColumns()) hashCode = hashCode * 8191 + columns.hashCode(); hashCode = hashCode * 8191 + ((isSetAttributes()) ? 131071 : 524287); if (isSetAttributes()) hashCode = hashCode * 8191 + attributes.hashCode(); hashCode = hashCode * 8191 + ((isSetDurability()) ? 131071 : 524287); if (isSetDurability()) hashCode = hashCode * 8191 + durability.getValue(); return hashCode; }
/** 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 java.lang.IllegalArgumentException(); } switch (field) { case NS: return isSetNs(); case QUALIFIER: return isSetQualifier(); } throw new java.lang.IllegalStateException(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableDescriptor struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.tableName = new TTableName(); struct.tableName.read(iprot); struct.setTableNameIsSet(true); java.util.BitSet incoming = iprot.readBitSet(3);
/** * Performs a deep copy on <i>other</i>. */ public TTableDescriptor(TTableDescriptor other) { if (other.isSetTableName()) { this.tableName = new TTableName(other.tableName); } if (other.isSetColumns()) { java.util.List<TColumnFamilyDescriptor> __this__columns = new java.util.ArrayList<TColumnFamilyDescriptor>(other.columns.size()); for (TColumnFamilyDescriptor other_element : other.columns) { __this__columns.add(new TColumnFamilyDescriptor(other_element)); } this.columns = __this__columns; } if (other.isSetAttributes()) { java.util.Map<java.nio.ByteBuffer,java.nio.ByteBuffer> __this__attributes = new java.util.HashMap<java.nio.ByteBuffer,java.nio.ByteBuffer>(other.attributes); this.attributes = __this__attributes; } if (other.isSetDurability()) { this.durability = other.durability; } }
@Override public java.lang.String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder("TTableName("); boolean first = true; if (isSetNs()) { sb.append("ns:"); if (this.ns == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.ns, sb); } first = false; } if (!first) sb.append(", "); sb.append("qualifier:"); if (this.qualifier == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.qualifier, sb); } first = false; sb.append(")"); return sb.toString(); }
TTableName tTableName = new TTableName(); tTableName.setNs(Bytes.toBytes("")); tTableName.setQualifier(Bytes.toBytes(TABLENAME)); if (!tableCreated){ Assert.assertTrue(!client.tableExists(tTableName));
public boolean equals(TTableName that) { if (that == null) return false; if (this == that) return true; boolean this_present_ns = true && this.isSetNs(); boolean that_present_ns = true && that.isSetNs(); if (this_present_ns || that_present_ns) { if (!(this_present_ns && that_present_ns)) return false; if (!this.ns.equals(that.ns)) return false; } boolean this_present_qualifier = true && this.isSetQualifier(); boolean that_present_qualifier = true && that.isSetQualifier(); if (this_present_qualifier || that_present_qualifier) { if (!(this_present_qualifier && that_present_qualifier)) return false; if (!this.qualifier.equals(that.qualifier)) return false; } return true; }
@org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NS: return getNs(); case QUALIFIER: return getQualifier(); } throw new java.lang.IllegalStateException(); }