software.amazon.awssdk.services.firehose.model.ElasticsearchBufferingHints Maven / Gradle / Ivy
Show all versions of kinesis Show documentation
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.firehose.model;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.firehose.transform.ElasticsearchBufferingHintsMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes the buffering to perform before delivering data to the Amazon ES destination.
*
*/
@Generated("software.amazon.awssdk:codegen")
public class ElasticsearchBufferingHints implements StructuredPojo,
ToCopyableBuilder {
private final Integer intervalInSeconds;
private final Integer sizeInMBs;
private ElasticsearchBufferingHints(BuilderImpl builder) {
this.intervalInSeconds = builder.intervalInSeconds;
this.sizeInMBs = builder.sizeInMBs;
}
/**
*
* Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The
* default value is 300 (5 minutes).
*
*
* @return Buffer incoming data for the specified period of time, in seconds, before delivering it to the
* destination. The default value is 300 (5 minutes).
*/
public Integer intervalInSeconds() {
return intervalInSeconds;
}
/**
*
* Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is
* 5.
*
*
* We recommend setting this parameter to a value greater than the amount of data you typically ingest into the
* delivery stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the value should be 10 MB
* or higher.
*
*
* @return Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default
* value is 5.
*
* We recommend setting this parameter to a value greater than the amount of data you typically ingest into
* the delivery stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the value
* should be 10 MB or higher.
*/
public Integer sizeInMBs() {
return sizeInMBs;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(intervalInSeconds());
hashCode = 31 * hashCode + Objects.hashCode(sizeInMBs());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ElasticsearchBufferingHints)) {
return false;
}
ElasticsearchBufferingHints other = (ElasticsearchBufferingHints) obj;
return Objects.equals(intervalInSeconds(), other.intervalInSeconds()) && Objects.equals(sizeInMBs(), other.sizeInMBs());
}
@Override
public String toString() {
return ToString.builder("ElasticsearchBufferingHints").add("IntervalInSeconds", intervalInSeconds())
.add("SizeInMBs", sizeInMBs()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "IntervalInSeconds":
return Optional.of(clazz.cast(intervalInSeconds()));
case "SizeInMBs":
return Optional.of(clazz.cast(sizeInMBs()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
ElasticsearchBufferingHintsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination.
* The default value is 300 (5 minutes).
*
*
* @param intervalInSeconds
* Buffer incoming data for the specified period of time, in seconds, before delivering it to the
* destination. The default value is 300 (5 minutes).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder intervalInSeconds(Integer intervalInSeconds);
/**
*
* Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default
* value is 5.
*
*
* We recommend setting this parameter to a value greater than the amount of data you typically ingest into the
* delivery stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the value should be 10
* MB or higher.
*
*
* @param sizeInMBs
* Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The
* default value is 5.
*
* We recommend setting this parameter to a value greater than the amount of data you typically ingest
* into the delivery stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the
* value should be 10 MB or higher.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sizeInMBs(Integer sizeInMBs);
}
static final class BuilderImpl implements Builder {
private Integer intervalInSeconds;
private Integer sizeInMBs;
private BuilderImpl() {
}
private BuilderImpl(ElasticsearchBufferingHints model) {
intervalInSeconds(model.intervalInSeconds);
sizeInMBs(model.sizeInMBs);
}
public final Integer getIntervalInSeconds() {
return intervalInSeconds;
}
@Override
public final Builder intervalInSeconds(Integer intervalInSeconds) {
this.intervalInSeconds = intervalInSeconds;
return this;
}
public final void setIntervalInSeconds(Integer intervalInSeconds) {
this.intervalInSeconds = intervalInSeconds;
}
public final Integer getSizeInMBs() {
return sizeInMBs;
}
@Override
public final Builder sizeInMBs(Integer sizeInMBs) {
this.sizeInMBs = sizeInMBs;
return this;
}
public final void setSizeInMBs(Integer sizeInMBs) {
this.sizeInMBs = sizeInMBs;
}
@Override
public ElasticsearchBufferingHints build() {
return new ElasticsearchBufferingHints(this);
}
}
}