@Override public ByteBuffer getValueBytes() { return column.isSetValue() ? column.value.duplicate() : null; }
@Override public V getValue() { if ( column.isSetValue() ) { if ( null == cachedValue) { cachedValue = valueSerializer.fromByteBuffer(column.value.duplicate()); } return cachedValue; } else { return null; } }
@Override public ByteBuffer getValueBytes() { return column.isSetValue() ? column.value.duplicate() : null; }
@Override public ByteBuffer getValueBytes() { return column.isSetValue() ? column.value.duplicate() : null; }
@Override public V getValue() { if ( column.isSetValue() ) { if ( null == cachedValue) { cachedValue = valueSerializer.fromByteBuffer(column.value.duplicate()); } return cachedValue; } else { return null; } }
@Override public V getValue() { if ( column.isSetValue() ) { if ( null == cachedValue) { cachedValue = valueSerializer.fromByteBuffer(column.value.duplicate()); } return cachedValue; } else { return null; } }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_name = true && (isSetName()); builder.append(present_name); if (present_name) builder.append(name); boolean present_value = true && (isSetValue()); builder.append(present_value); if (present_value) builder.append(value); boolean present_timestamp = true && (isSetTimestamp()); builder.append(present_timestamp); if (present_timestamp) builder.append(timestamp); boolean present_ttl = true && (isSetTtl()); builder.append(present_ttl); if (present_ttl) builder.append(ttl); return builder.toHashCode(); }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_name = true && (isSetName()); builder.append(present_name); if (present_name) builder.append(name); boolean present_value = true && (isSetValue()); builder.append(present_value); if (present_value) builder.append(value); boolean present_timestamp = true && (isSetTimestamp()); builder.append(present_timestamp); if (present_timestamp) builder.append(timestamp); boolean present_ttl = true && (isSetTtl()); builder.append(present_ttl); if (present_ttl) builder.append(ttl); return builder.toHashCode(); }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_name = true && (isSetName()); builder.append(present_name); if (present_name) builder.append(name); boolean present_value = true && (isSetValue()); builder.append(present_value); if (present_value) builder.append(value); boolean present_timestamp = true && (isSetTimestamp()); builder.append(present_timestamp); if (present_timestamp) builder.append(timestamp); boolean present_ttl = true && (isSetTtl()); builder.append(present_ttl); if (present_ttl) builder.append(ttl); return builder.toHashCode(); }
/** 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 IllegalArgumentException(); } switch (field) { case NAME: return isSetName(); case VALUE: return isSetValue(); case TIMESTAMP: return isSetTimestamp(); case TTL: return isSetTtl(); } throw new IllegalStateException(); }
/** 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 IllegalArgumentException(); } switch (field) { case NAME: return isSetName(); case VALUE: return isSetValue(); case TIMESTAMP: return isSetTimestamp(); case TTL: return isSetTtl(); } throw new IllegalStateException(); }
/** 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 IllegalArgumentException(); } switch (field) { case NAME: return isSetName(); case VALUE: return isSetValue(); case TIMESTAMP: return isSetTimestamp(); case TTL: return isSetTtl(); } throw new IllegalStateException(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, Column struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeBinary(struct.name); oprot.writeFieldEnd(); } if (struct.value != null) { if (struct.isSetValue()) { oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeBinary(struct.value); oprot.writeFieldEnd(); } } if (struct.isSetTimestamp()) { oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); oprot.writeI64(struct.timestamp); oprot.writeFieldEnd(); } if (struct.isSetTtl()) { oprot.writeFieldBegin(TTL_FIELD_DESC); oprot.writeI32(struct.ttl); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
/** * Performs a deep copy on <i>other</i>. */ public Column(Column other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name); ; } if (other.isSetValue()) { this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); ; } this.timestamp = other.timestamp; this.ttl = other.ttl; }
/** * Performs a deep copy on <i>other</i>. */ public Column(Column other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name); ; } if (other.isSetValue()) { this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); ; } this.timestamp = other.timestamp; this.ttl = other.ttl; }
/** * Performs a deep copy on <i>other</i>. */ public Column(Column other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name); ; } if (other.isSetValue()) { this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); ; } this.timestamp = other.timestamp; this.ttl = other.ttl; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, Column struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBinary(struct.name); BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } if (struct.isSetTimestamp()) { optionals.set(1); } if (struct.isSetTtl()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetValue()) { oprot.writeBinary(struct.value); } if (struct.isSetTimestamp()) { oprot.writeI64(struct.timestamp); } if (struct.isSetTtl()) { oprot.writeI32(struct.ttl); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, Column struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBinary(struct.name); BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } if (struct.isSetTimestamp()) { optionals.set(1); } if (struct.isSetTtl()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetValue()) { oprot.writeBinary(struct.value); } if (struct.isSetTimestamp()) { oprot.writeI64(struct.timestamp); } if (struct.isSetTtl()) { oprot.writeI32(struct.ttl); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, Column struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBinary(struct.name); BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } if (struct.isSetTimestamp()) { optionals.set(1); } if (struct.isSetTtl()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetValue()) { oprot.writeBinary(struct.value); } if (struct.isSetTimestamp()) { oprot.writeI64(struct.timestamp); } if (struct.isSetTtl()) { oprot.writeI32(struct.ttl); } }
/** * Validates the data part of the column (everything in the column object but the name, which is assumed to be valid) */ public static void validateColumnData(CFMetaData metadata, ByteBuffer scName, Column column) throws org.apache.cassandra.exceptions.InvalidRequestException { validateTtl(metadata, column); if (!column.isSetValue()) throw new org.apache.cassandra.exceptions.InvalidRequestException("Column value is required"); if (!column.isSetTimestamp()) throw new org.apache.cassandra.exceptions.InvalidRequestException("Column timestamp is required"); try { LegacyLayout.LegacyCellName cn = LegacyLayout.decodeCellName(metadata, scName, column.name); cn.column.type.validateCellValue(column.value); } catch (UnknownColumnException e) { throw new org.apache.cassandra.exceptions.InvalidRequestException(e.getMessage()); } catch (MarshalException me) { if (logger.isTraceEnabled()) logger.trace("rejecting invalid value {}", ByteBufferUtil.bytesToHex(summarize(column.value))); throw new org.apache.cassandra.exceptions.InvalidRequestException(String.format("(%s) [%s][%s][%s] failed validation", me.getMessage(), metadata.ksName, metadata.cfName, (getThriftColumnNameComparator(metadata, scName)).getString(column.name))); } }