Class TTLOption

  • All Implemented Interfaces:
    java.io.Serializable

    public final class TTLOption
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String columnName()  
      static java.lang.String constant​(int ttlInSeconds)
      TTL option for write with a constant TTL.
      static java.lang.String constant​(java.time.Duration duration)
      TTL option for write with a constant TTL.
      static TTLOption forever()  
      static TTLOption from​(java.lang.String ttl)  
      static java.lang.String perRow​(java.lang.String ttlColumnName)
      TTL option for writes with TTL per Row.
      java.lang.String toCQLString​(java.util.function.Function<java.lang.String,​java.lang.String> maybeQuoteFunction)  
      boolean withTTl()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • from

        public static TTLOption from​(java.lang.String ttl)
      • constant

        public static java.lang.String constant​(int ttlInSeconds)
        TTL option for write with a constant TTL. When same values for TTL should be used for all rows in a bulk write call use this option.
        Parameters:
        ttlInSeconds - ttl value in seconds
        Returns:
        TTLOption
      • constant

        public static java.lang.String constant​(java.time.Duration duration)
        TTL option for write with a constant TTL. When same values for TTL should be used for all rows in a bulk write call use this option.
        Parameters:
        duration - ttl value in Duration
        Returns:
        TTLOption
      • perRow

        public static java.lang.String perRow​(java.lang.String ttlColumnName)
        TTL option for writes with TTL per Row. When different TTL has to be used for different rows in a bulk write call use this option. It expects the input RDD to supply the TTL values as an additional column at each row of the RDD. The TTL value provider column is selected by ttlColumnName
        Parameters:
        ttlColumnName - column name which has TTL values for each row
        Returns:
        TTLOption
      • forever

        public static TTLOption forever()
      • columnName

        public java.lang.String columnName()
      • withTTl

        public boolean withTTl()
      • toCQLString

        public java.lang.String toCQLString​(java.util.function.Function<java.lang.String,​java.lang.String> maybeQuoteFunction)