Class NanosecondConverter

java.lang.Object
com.influxdb.v3.client.internal.NanosecondConverter

public final class NanosecondConverter extends Object
Nanosecond converter.

Utility class converting epoch nanoseconds to epoch with a given precision.

  • Method Details

    • convertToNanos

      @Nullable public static BigInteger convertToNanos(@Nullable Number timestamp, WritePrecision precision)
      Convert timestamp in a given precision to nanoseconds.
      Parameters:
      timestamp - epoch timestamp
      precision - precision
      Returns:
      epoch timestamp in precision, can be null
    • convert

      public static BigInteger convert(Instant instant, WritePrecision precision)
      Convert Instant timestamp to a given precision.
      Parameters:
      instant - Instant timestamp
      precision - precision
      Returns:
      epoch timestamp in precision
    • getTimestampNano

      @Nullable public static BigInteger getTimestampNano(@Nonnull Object value, @Nonnull org.apache.arrow.vector.types.pojo.Field field)
      Convert Long or LocalDateTime to timestamp nanosecond.
      Parameters:
      value - the time in Long or LocalDateTime
      field - the arrow field metadata
      Returns:
      the time in nanosecond