@ThreadSafe public final class WriteParameters extends Object
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 is WriteConsistency.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!
Modifier and Type | Field and Description |
---|---|
static WritePrecision |
DEFAULT_WRITE_PRECISION |
Constructor and Description |
---|
WriteParameters(String bucket,
String org,
WritePrecision precision)
The backward internal constructor, please use
WriteParameters(String, String, WritePrecision, WriteConsistency) . |
WriteParameters(String bucket,
String org,
WritePrecision precision,
WriteConsistency consistency)
Construct WriteAPI parameters.
|
WriteParameters(WritePrecision precision,
WriteConsistency consistency)
Construct WriteAPI parameters.
|
Modifier and Type | Method and Description |
---|---|
String |
bucketSafe(InfluxDBClientOptions options) |
void |
check(InfluxDBClientOptions options)
Enforces that the destination
bucket and destination organization are defined. |
WriteConsistency |
consistencySafe(InfluxDBClientOptions options) |
WriteParameters |
copy(WritePrecision precision,
InfluxDBClientOptions options)
Copy current parameters with new precision.
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
orgSafe(InfluxDBClientOptions options) |
WritePrecision |
precisionSafe(InfluxDBClientOptions options) |
public static final WritePrecision DEFAULT_WRITE_PRECISION
public WriteParameters(@Nullable String bucket, @Nullable String org, @Nullable WritePrecision precision, @Nullable WriteConsistency consistency)
bucket
- The destination bucket for writes.
If it is not specified then use InfluxDBClientOptions.getBucket()
.org
- The destination organization for writes.
If it is not specified then use InfluxDBClientOptions.getOrg()
.precision
- Precision for unix timestamps in the line protocol of the request payload.
If it is not specified then use WritePrecision.NS
.consistency
- The write consistency for the point. For more info see WriteParameters
.public WriteParameters(@Nullable WritePrecision precision, @Nullable WriteConsistency consistency)
precision
- Precision for unix timestamps in the line protocol of the request payload.
If it is not specified then use WritePrecision.NS
.consistency
- The write consistency for the point. For more info see WriteParameters
.public WriteParameters(@Nonnull String bucket, @Nonnull String org, @Nonnull WritePrecision precision)
WriteParameters(String, String, WritePrecision, WriteConsistency)
.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.@Nonnull public String orgSafe(@Nonnull InfluxDBClientOptions options)
options
- with default value@Nonnull public String bucketSafe(@Nonnull InfluxDBClientOptions options)
options
- with default value@Nonnull public WritePrecision precisionSafe(@Nonnull InfluxDBClientOptions options)
options
- with default value@Nullable public WriteConsistency consistencySafe(@Nonnull InfluxDBClientOptions options)
options
- with default valuepublic void check(@Nonnull InfluxDBClientOptions options)
bucket
and destination organization
are defined.options
- with default valuesIllegalArgumentException
- if the bucket or organization is not defined@Nonnull public WriteParameters copy(@Nonnull WritePrecision precision, @Nonnull InfluxDBClientOptions options)
precision
- new precisionoptions
- default valuesCopyright © 2018–2022 InfluxData, Inc.. All rights reserved.