public TCellVisibility deepCopy() { return new TCellVisibility(this); }
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case EXPRESSION: if (value == null) { unsetExpression(); } else { setExpression((java.lang.String)value); } break; } }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCellVisibility) return this.equals((TCellVisibility)that); return false; }
public void write(org.apache.thrift.protocol.TProtocol oprot, TCellVisibility struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.expression != null) { if (struct.isSetExpression()) { oprot.writeFieldBegin(EXPRESSION_FIELD_DESC); oprot.writeString(struct.expression); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, TCellVisibility 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: // EXPRESSION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.expression = iprot.readString(); struct.setExpressionIsSet(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(); }
CellVisibility cellVisibility = in.getCellVisibility(); if (cellVisibility != null) { TCellVisibility tCellVisibility = new TCellVisibility(); tCellVisibility.setExpression(cellVisibility.getExpression()); out.setCellVisibility(tCellVisibility);
case 7: // CELL_VISIBILITY if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.cellVisibility = new TCellVisibility(); struct.cellVisibility.read(iprot); struct.setCellVisibilityIsSet(true); } else {
@org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case EXPRESSION: return getExpression(); } throw new java.lang.IllegalStateException(); }
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
/** * Performs a deep copy on <i>other</i>. */ public TCellVisibility(TCellVisibility other) { if (other.isSetExpression()) { this.expression = other.expression; } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (row == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'row' was not present! Struct: " + toString()); } if (columns == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' was not present! Struct: " + toString()); } // check for sub-struct validity if (cellVisibility != null) { cellVisibility.validate(); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TCellVisibility struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.expression = iprot.readString(); struct.setExpressionIsSet(true); } } }
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); } }
@Test public void testIncrementWithTagsWithNotMatchLabels() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testIncrementWithTagsWithNotMatchLabels"); ByteBuffer table = wrap(tableAname); List<TColumnValue> columnValues = new ArrayList<>(1); columnValues.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(Bytes.toBytes(1L)))); TPut put = new TPut(wrap(rowName), columnValues); put.setColumnValues(columnValues); put.setCellVisibility(new TCellVisibility().setExpression(PRIVATE)); handler.put(table, put); List<TColumnIncrement> incrementColumns = new ArrayList<>(1); incrementColumns.add(new TColumnIncrement(wrap(familyAname), wrap(qualifierAname))); TIncrement increment = new TIncrement(wrap(rowName), incrementColumns); increment.setCellVisibility(new TCellVisibility().setExpression(SECRET)); handler.increment(table, increment); TGet get = new TGet(wrap(rowName)); TAuthorization tauth = new TAuthorization(); List<String> labels = new ArrayList<>(1); labels.add(PUBLIC); tauth.setLabels(labels); get.setAuthorizations(tauth); TResult result = handler.get(table, get); assertNull(result.getRow()); }
case 5: // CELL_VISIBILITY if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.cellVisibility = new TCellVisibility(); struct.cellVisibility.read(iprot); struct.setCellVisibilityIsSet(true); } else {
public void read(org.apache.thrift.protocol.TProtocol iprot, TCellVisibility 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: // EXPRESSION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.expression = iprot.readString(); struct.setExpressionIsSet(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(); }
public Object getFieldValue(_Fields field) { switch (field) { case EXPRESSION: return getExpression(); } throw new IllegalStateException(); }
if (struct.isSetCellVisibility()) { oprot.writeFieldBegin(CELL_VISIBILITY_FIELD_DESC); struct.cellVisibility.write(oprot); oprot.writeFieldEnd();
public void write(org.apache.thrift.protocol.TProtocol oprot, TCellVisibility struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.expression != null) { if (struct.isSetExpression()) { oprot.writeFieldBegin(EXPRESSION_FIELD_DESC); oprot.writeString(struct.expression); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetExpression()) ? 131071 : 524287); if (isSetExpression()) hashCode = hashCode * 8191 + expression.hashCode(); return hashCode; }