Package com.influxdb.client.write
Class WriteParameters
java.lang.Object
com.influxdb.client.write.WriteParameters
Write API parameters.
Supports to specify:
bucket
- Specifies the destination bucket for writes.org
- Specifies the destination organization for writes.precision
- Precision for unix timestamps in the line protocol of the request payload.-
consistency
- The write consistency for the point. InfluxDB assumes that the write consistency isWriteConsistency.ONE
if you do not specify consistency. See the InfluxDB Enterprise documentation for detailed descriptions of each consistency option. Available with InfluxDB Enterprise clusters only!
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWriteParameters
(WritePrecision precision, WriteConsistency consistency) Construct WriteAPI parameters.WriteParameters
(String bucket, String org, WritePrecision precision) The backward internal constructor, please useWriteParameters(String, String, WritePrecision, WriteConsistency)
.WriteParameters
(String bucket, String org, WritePrecision precision, WriteConsistency consistency) Construct WriteAPI parameters. -
Method Summary
Modifier and TypeMethodDescriptionbucketSafe
(InfluxDBClientOptions options) void
check
(InfluxDBClientOptions options) Enforces that the destinationbucket
and destinationorganization
are defined.consistencySafe
(InfluxDBClientOptions options) copy
(WritePrecision precision, InfluxDBClientOptions options) Copy current parameters with new precision.boolean
int
hashCode()
orgSafe
(InfluxDBClientOptions options) precisionSafe
(InfluxDBClientOptions options)
-
Field Details
-
DEFAULT_WRITE_PRECISION
-
-
Constructor Details
-
WriteParameters
public WriteParameters(@Nullable String bucket, @Nullable String org, @Nullable WritePrecision precision, @Nullable WriteConsistency consistency) Construct WriteAPI parameters.- Parameters:
bucket
- The destination bucket for writes. If it is not specified then useInfluxDBClientOptions.getBucket()
.org
- The destination organization for writes. If it is not specified then useInfluxDBClientOptions.getOrg()
.precision
- Precision for unix timestamps in the line protocol of the request payload. If it is not specified then useWritePrecision.NS
.consistency
- The write consistency for the point. For more info seeWriteParameters
.
-
WriteParameters
Construct WriteAPI parameters.- Parameters:
precision
- Precision for unix timestamps in the line protocol of the request payload. If it is not specified then useWritePrecision.NS
.consistency
- The write consistency for the point. For more info seeWriteParameters
.
-
WriteParameters
public WriteParameters(@Nonnull String bucket, @Nonnull String org, @Nonnull WritePrecision precision) The backward internal constructor, please useWriteParameters(String, String, WritePrecision, WriteConsistency)
.- Parameters:
bucket
- The destination bucket for writes.org
- The destination organization for writes.precision
- Precision for unix timestamps in the line protocol of the request payload.
-
-
Method Details
-
orgSafe
- Parameters:
options
- with default value- Returns:
- The destination organization for writes.
-
bucketSafe
- Parameters:
options
- with default value- Returns:
- The destination bucket for writes.
-
precisionSafe
- Parameters:
options
- with default value- Returns:
- Precision for unix timestamps in the line protocol of the request payload.
-
consistencySafe
- Parameters:
options
- with default value- Returns:
- The write consistency for the point.
-
check
Enforces that the destinationbucket
and destinationorganization
are defined.- Parameters:
options
- with default values- Throws:
IllegalArgumentException
- if the bucket or organization is not defined
-
copy
@Nonnull public WriteParameters copy(@Nonnull WritePrecision precision, @Nonnull InfluxDBClientOptions options) Copy current parameters with new precision.- Parameters:
precision
- new precisionoptions
- default values- Returns:
- copied parameters
-
equals
-
hashCode
public int hashCode()
-