Class TimestampOption

  • All Implemented Interfaces:
    java.io.Serializable

    public final class TimestampOption
    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​(long timestampInMicroSeconds)
      Timestamp option for write with a constant timestamp.
      static java.lang.String constant​(java.time.Duration duration)
      Timestamp option for write with a constant timestamp.
      static TimestampOption from​(java.lang.String timestamp)  
      static TimestampOption now()  
      static java.lang.String perRow​(java.lang.String timeStampColumnName)
      Timestamp option for writes with timestamp per Row.
      java.lang.String toCQLString​(java.util.function.Function<java.lang.String,​java.lang.String> maybeQuoteFunction)  
      boolean withTimestamp()  
      • Methods inherited from class java.lang.Object

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

      • from

        public static TimestampOption from​(java.lang.String timestamp)
      • constant

        public static java.lang.String constant​(long timestampInMicroSeconds)
        Timestamp option for write with a constant timestamp. When same values for timestamp should be used for all rows in a bulk write call use this option.
        Parameters:
        timestampInMicroSeconds - timestamp value in microseconds
        Returns:
        timestamp option
      • constant

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

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

        public java.lang.String columnName()
      • withTimestamp

        public boolean withTimestamp()
      • toCQLString

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