Class WriteOptions


  • @ThreadSafe
    public final class WriteOptions
    extends Object
    Write options.

    Supports to specify:

    • database - specifies the database to be used for InfluxDB operations
    • organization - specifies the organization to be used for InfluxDB operations
    • precision - specified the precision to use for the timestamp of points
    • Field Detail

      • DEFAULT_WRITE_PRECISION

        public static final WritePrecision DEFAULT_WRITE_PRECISION
        Default WritePrecision.
      • DEFAULT_GZIP_THRESHOLD

        public static final Integer DEFAULT_GZIP_THRESHOLD
        Default GZIP threshold.
      • DEFAULTS

        public static final WriteOptions DEFAULTS
        Default WriteOptions.
    • Constructor Detail

      • WriteOptions

        public WriteOptions​(@Nonnull
                            String database,
                            @Nonnull
                            WritePrecision precision,
                            @Nonnull
                            Integer gzipThreshold)
        Construct WriteAPI options.
        Parameters:
        database - The database to be used for InfluxDB operations.
        precision - The precision to use for the timestamp of points.
        gzipThreshold - The threshold for compressing request body.
    • Method Detail

      • databaseSafe

        @Nullable
        public String databaseSafe​(@Nonnull
                                   ClientConfig config)
        Parameters:
        config - with default value
        Returns:
        The destination database for writes.
      • precisionSafe

        @Nonnull
        public WritePrecision precisionSafe​(@Nonnull
                                            ClientConfig config)
        Parameters:
        config - with default value
        Returns:
        Precision for unix timestamps in the line protocol of the request payload.
      • gzipThresholdSafe

        @Nonnull
        public Integer gzipThresholdSafe​(@Nonnull
                                         ClientConfig config)
        Parameters:
        config - with default value
        Returns:
        Payload size threshold for compressing it.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object