private int getTtl(CFMetaData metadata,Column column) { if (!column.isSetTtl()) return metadata.params.defaultTimeToLive; if (column.ttl == LivenessInfo.NO_TTL && metadata.params.defaultTimeToLive != LivenessInfo.NO_TTL) return LivenessInfo.NO_TTL; return column.ttl; }
private int getTtl(CFMetaData metadata,Column column) { if (!column.isSetTtl()) return metadata.params.defaultTimeToLive; if (column.ttl == LivenessInfo.NO_TTL && metadata.params.defaultTimeToLive != LivenessInfo.NO_TTL) return LivenessInfo.NO_TTL; return column.ttl; }
@Override public int getTtl() { return column.isSetTtl() ? column.getTtl() : 0; }
@Override public int getTtl() { return column.isSetTtl() ? column.getTtl() : 0; }
@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(); }
private static void validateTtl(Column column) throws org.apache.cassandra.exceptions.InvalidRequestException { if (column.isSetTtl()) { if (column.ttl <= 0) throw new org.apache.cassandra.exceptions.InvalidRequestException("ttl must be positive"); if (column.ttl > ExpiringCell.MAX_TTL) throw new org.apache.cassandra.exceptions.InvalidRequestException(String.format("ttl is too large. requested (%d) maximum (%d)", column.ttl, ExpiringCell.MAX_TTL)); } else { // if it's not set, then it should be zero -- here we are just checking to make sure Thrift doesn't change that contract with us. assert column.ttl == 0; } }
/** 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(); }
first = false; if (isSetTtl()) { if (!first) sb.append(", "); sb.append("ttl:");
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(); }
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(); }
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(); }
private static void validateTtl(CFMetaData metadata, Column column) throws org.apache.cassandra.exceptions.InvalidRequestException { if (column.isSetTtl()) { if (column.ttl < 0) throw new org.apache.cassandra.exceptions.InvalidRequestException("ttl must be greater or equal to 0"); if (column.ttl > Attributes.MAX_TTL) throw new org.apache.cassandra.exceptions.InvalidRequestException(String.format("ttl is too large. requested (%d) maximum (%d)", column.ttl, Attributes.MAX_TTL)); ExpirationDateOverflowHandling.maybeApplyExpirationDateOverflowPolicy(metadata, column.ttl, false); } else { ExpirationDateOverflowHandling.maybeApplyExpirationDateOverflowPolicy(metadata, metadata.params.defaultTimeToLive, true); // if it's not set, then it should be zero -- here we are just checking to make sure Thrift doesn't change that contract with us. assert column.ttl == 0; } }
private static void validateTtl(CFMetaData metadata, Column column) throws org.apache.cassandra.exceptions.InvalidRequestException { if (column.isSetTtl()) { if (column.ttl < 0) throw new org.apache.cassandra.exceptions.InvalidRequestException("ttl must be greater or equal to 0"); if (column.ttl > Attributes.MAX_TTL) throw new org.apache.cassandra.exceptions.InvalidRequestException(String.format("ttl is too large. requested (%d) maximum (%d)", column.ttl, Attributes.MAX_TTL)); ExpirationDateOverflowHandling.maybeApplyExpirationDateOverflowPolicy(metadata, column.ttl, false); } else { ExpirationDateOverflowHandling.maybeApplyExpirationDateOverflowPolicy(metadata, metadata.params.defaultTimeToLive, true); // if it's not set, then it should be zero -- here we are just checking to make sure Thrift doesn't change that contract with us. assert column.ttl == 0; } }
@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); } }