Class TTLOption
- java.lang.Object
-
- org.apache.cassandra.spark.bulkwriter.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.StringcolumnName()static java.lang.Stringconstant(int ttlInSeconds)TTL option for write with a constant TTL.static java.lang.Stringconstant(java.time.Duration duration)TTL option for write with a constant TTL.static TTLOptionforever()static TTLOptionfrom(java.lang.String ttl)static java.lang.StringperRow(java.lang.String ttlColumnName)TTL option for writes with TTL per Row.java.lang.StringtoCQLString(java.util.function.Function<java.lang.String,java.lang.String> maybeQuoteFunction)booleanwithTTl()
-
-
-
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 byttlColumnName- 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)
-
-