All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputDescription Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon DynamoDB module holds the client classes that are used for communicating with Amazon DynamoDB Service

There is a newer version: 2.30.1
Show newest version
/*
 * Copyright 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.dynamodb.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents the provisioned throughput settings for the table, consisting of read and write capacity units, along with * data about increases and decreases. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ProvisionedThroughputDescription implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField LAST_INCREASE_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(ProvisionedThroughputDescription::lastIncreaseDateTime)).setter(setter(Builder::lastIncreaseDateTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastIncreaseDateTime").build()) .build(); private static final SdkField LAST_DECREASE_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(ProvisionedThroughputDescription::lastDecreaseDateTime)).setter(setter(Builder::lastDecreaseDateTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastDecreaseDateTime").build()) .build(); private static final SdkField NUMBER_OF_DECREASES_TODAY_FIELD = SdkField. builder(MarshallingType.LONG) .getter(getter(ProvisionedThroughputDescription::numberOfDecreasesToday)) .setter(setter(Builder::numberOfDecreasesToday)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfDecreasesToday").build()) .build(); private static final SdkField READ_CAPACITY_UNITS_FIELD = SdkField. builder(MarshallingType.LONG) .getter(getter(ProvisionedThroughputDescription::readCapacityUnits)).setter(setter(Builder::readCapacityUnits)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReadCapacityUnits").build()).build(); private static final SdkField WRITE_CAPACITY_UNITS_FIELD = SdkField. builder(MarshallingType.LONG) .getter(getter(ProvisionedThroughputDescription::writeCapacityUnits)).setter(setter(Builder::writeCapacityUnits)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WriteCapacityUnits").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays .asList(LAST_INCREASE_DATE_TIME_FIELD, LAST_DECREASE_DATE_TIME_FIELD, NUMBER_OF_DECREASES_TODAY_FIELD, READ_CAPACITY_UNITS_FIELD, WRITE_CAPACITY_UNITS_FIELD)); private static final long serialVersionUID = 1L; private final Instant lastIncreaseDateTime; private final Instant lastDecreaseDateTime; private final Long numberOfDecreasesToday; private final Long readCapacityUnits; private final Long writeCapacityUnits; private ProvisionedThroughputDescription(BuilderImpl builder) { this.lastIncreaseDateTime = builder.lastIncreaseDateTime; this.lastDecreaseDateTime = builder.lastDecreaseDateTime; this.numberOfDecreasesToday = builder.numberOfDecreasesToday; this.readCapacityUnits = builder.readCapacityUnits; this.writeCapacityUnits = builder.writeCapacityUnits; } /** *

* The date and time of the last provisioned throughput increase for this table. *

* * @return The date and time of the last provisioned throughput increase for this table. */ public Instant lastIncreaseDateTime() { return lastIncreaseDateTime; } /** *

* The date and time of the last provisioned throughput decrease for this table. *

* * @return The date and time of the last provisioned throughput decrease for this table. */ public Instant lastDecreaseDateTime() { return lastDecreaseDateTime; } /** *

* The number of provisioned throughput decreases for this table during this UTC calendar day. For current maximums * on provisioned throughput decreases, see Limits in the Amazon * DynamoDB Developer Guide. *

* * @return The number of provisioned throughput decreases for this table during this UTC calendar day. For current * maximums on provisioned throughput decreases, see Limits in the * Amazon DynamoDB Developer Guide. */ public Long numberOfDecreasesToday() { return numberOfDecreasesToday; } /** *

* The maximum number of strongly consistent reads consumed per second before DynamoDB returns a * ThrottlingException. Eventually consistent reads require less effort than strongly consistent reads, * so a setting of 50 ReadCapacityUnits per second provides 100 eventually consistent * ReadCapacityUnits per second. *

* * @return The maximum number of strongly consistent reads consumed per second before DynamoDB returns a * ThrottlingException. Eventually consistent reads require less effort than strongly * consistent reads, so a setting of 50 ReadCapacityUnits per second provides 100 eventually * consistent ReadCapacityUnits per second. */ public Long readCapacityUnits() { return readCapacityUnits; } /** *

* The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException. *

* * @return The maximum number of writes consumed per second before DynamoDB returns a * ThrottlingException. */ public Long writeCapacityUnits() { return writeCapacityUnits; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(lastIncreaseDateTime()); hashCode = 31 * hashCode + Objects.hashCode(lastDecreaseDateTime()); hashCode = 31 * hashCode + Objects.hashCode(numberOfDecreasesToday()); hashCode = 31 * hashCode + Objects.hashCode(readCapacityUnits()); hashCode = 31 * hashCode + Objects.hashCode(writeCapacityUnits()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ProvisionedThroughputDescription)) { return false; } ProvisionedThroughputDescription other = (ProvisionedThroughputDescription) obj; return Objects.equals(lastIncreaseDateTime(), other.lastIncreaseDateTime()) && Objects.equals(lastDecreaseDateTime(), other.lastDecreaseDateTime()) && Objects.equals(numberOfDecreasesToday(), other.numberOfDecreasesToday()) && Objects.equals(readCapacityUnits(), other.readCapacityUnits()) && Objects.equals(writeCapacityUnits(), other.writeCapacityUnits()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public String toString() { return ToString.builder("ProvisionedThroughputDescription").add("LastIncreaseDateTime", lastIncreaseDateTime()) .add("LastDecreaseDateTime", lastDecreaseDateTime()).add("NumberOfDecreasesToday", numberOfDecreasesToday()) .add("ReadCapacityUnits", readCapacityUnits()).add("WriteCapacityUnits", writeCapacityUnits()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "LastIncreaseDateTime": return Optional.ofNullable(clazz.cast(lastIncreaseDateTime())); case "LastDecreaseDateTime": return Optional.ofNullable(clazz.cast(lastDecreaseDateTime())); case "NumberOfDecreasesToday": return Optional.ofNullable(clazz.cast(numberOfDecreasesToday())); case "ReadCapacityUnits": return Optional.ofNullable(clazz.cast(readCapacityUnits())); case "WriteCapacityUnits": return Optional.ofNullable(clazz.cast(writeCapacityUnits())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ProvisionedThroughputDescription) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The date and time of the last provisioned throughput increase for this table. *

* * @param lastIncreaseDateTime * The date and time of the last provisioned throughput increase for this table. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastIncreaseDateTime(Instant lastIncreaseDateTime); /** *

* The date and time of the last provisioned throughput decrease for this table. *

* * @param lastDecreaseDateTime * The date and time of the last provisioned throughput decrease for this table. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastDecreaseDateTime(Instant lastDecreaseDateTime); /** *

* The number of provisioned throughput decreases for this table during this UTC calendar day. For current * maximums on provisioned throughput decreases, see Limits in the * Amazon DynamoDB Developer Guide. *

* * @param numberOfDecreasesToday * The number of provisioned throughput decreases for this table during this UTC calendar day. For * current maximums on provisioned throughput decreases, see Limits in the * Amazon DynamoDB Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder numberOfDecreasesToday(Long numberOfDecreasesToday); /** *

* The maximum number of strongly consistent reads consumed per second before DynamoDB returns a * ThrottlingException. Eventually consistent reads require less effort than strongly consistent * reads, so a setting of 50 ReadCapacityUnits per second provides 100 eventually consistent * ReadCapacityUnits per second. *

* * @param readCapacityUnits * The maximum number of strongly consistent reads consumed per second before DynamoDB returns a * ThrottlingException. Eventually consistent reads require less effort than strongly * consistent reads, so a setting of 50 ReadCapacityUnits per second provides 100 eventually * consistent ReadCapacityUnits per second. * @return Returns a reference to this object so that method calls can be chained together. */ Builder readCapacityUnits(Long readCapacityUnits); /** *

* The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException. *

* * @param writeCapacityUnits * The maximum number of writes consumed per second before DynamoDB returns a * ThrottlingException. * @return Returns a reference to this object so that method calls can be chained together. */ Builder writeCapacityUnits(Long writeCapacityUnits); } static final class BuilderImpl implements Builder { private Instant lastIncreaseDateTime; private Instant lastDecreaseDateTime; private Long numberOfDecreasesToday; private Long readCapacityUnits; private Long writeCapacityUnits; private BuilderImpl() { } private BuilderImpl(ProvisionedThroughputDescription model) { lastIncreaseDateTime(model.lastIncreaseDateTime); lastDecreaseDateTime(model.lastDecreaseDateTime); numberOfDecreasesToday(model.numberOfDecreasesToday); readCapacityUnits(model.readCapacityUnits); writeCapacityUnits(model.writeCapacityUnits); } public final Instant getLastIncreaseDateTime() { return lastIncreaseDateTime; } @Override public final Builder lastIncreaseDateTime(Instant lastIncreaseDateTime) { this.lastIncreaseDateTime = lastIncreaseDateTime; return this; } public final void setLastIncreaseDateTime(Instant lastIncreaseDateTime) { this.lastIncreaseDateTime = lastIncreaseDateTime; } public final Instant getLastDecreaseDateTime() { return lastDecreaseDateTime; } @Override public final Builder lastDecreaseDateTime(Instant lastDecreaseDateTime) { this.lastDecreaseDateTime = lastDecreaseDateTime; return this; } public final void setLastDecreaseDateTime(Instant lastDecreaseDateTime) { this.lastDecreaseDateTime = lastDecreaseDateTime; } public final Long getNumberOfDecreasesToday() { return numberOfDecreasesToday; } @Override public final Builder numberOfDecreasesToday(Long numberOfDecreasesToday) { this.numberOfDecreasesToday = numberOfDecreasesToday; return this; } public final void setNumberOfDecreasesToday(Long numberOfDecreasesToday) { this.numberOfDecreasesToday = numberOfDecreasesToday; } public final Long getReadCapacityUnits() { return readCapacityUnits; } @Override public final Builder readCapacityUnits(Long readCapacityUnits) { this.readCapacityUnits = readCapacityUnits; return this; } public final void setReadCapacityUnits(Long readCapacityUnits) { this.readCapacityUnits = readCapacityUnits; } public final Long getWriteCapacityUnits() { return writeCapacityUnits; } @Override public final Builder writeCapacityUnits(Long writeCapacityUnits) { this.writeCapacityUnits = writeCapacityUnits; return this; } public final void setWriteCapacityUnits(Long writeCapacityUnits) { this.writeCapacityUnits = writeCapacityUnits; } @Override public ProvisionedThroughputDescription build() { return new ProvisionedThroughputDescription(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy