question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WriteOptions.ttl method no longer accepts zero

See original GitHub issue

The method recently changed from Assert.isTrue(!ttl.isNegative(), "TTL must be greater than equal to zero"); to Assert.isTrue(!ttl.isNegative() && !ttl.isZero(), "TTL must be greater than equal to zero");

!ttl.isZero() was added, however,

  1. The message reported still makes it sound like 0 should be allowed
  2. The 0 seems to tell the Cassandra driver to disable TTL: https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/cqlCreateTable.html#tabProp__cqlTableDefaultTTL

It seems like 0 should be allowed, but if not the error message should be corrected.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
mp911decommented, May 19, 2022

We should allow zero to disable TTL.

1reaction
tudormarccommented, May 19, 2022

@mp911de PR submitted 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

TTL support in spring boot application using spring-data ...
Extend CassandraRepository to add save method that accepts TTL @NoRepositoryBean public interface ExtendedCassandraRepository<T, ...
Read more >
Apply TTL via CrudRepository.save(…) [DATACASS-534] #703
I would like to know if we can insert /update row with an feature of TTL in Spring Data Cassandra using repository interfaces....
Read more >
Using Time to Live
Time to Live (TTL) is a mechanism that allows you to automatically expire database records. TTL is expressed as the amount of time...
Read more >
How to give ttl in Cassandra when inserting data in batches?
Accepted answer. /** * Add a collection of inserts with given {@link WriteOptions} to the batch. * * @param entities the entities to...
Read more >
TtlDB - javadoc.io
TTL is accepted in seconds (int32_t)Timestamp(creation) is suffixed to ... Open1 at t=0 with ttl=4 and insert k1,k2, close at t=2; Open2 at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found