software.amazon.awssdk.services.emrserverless.model.MonitoringConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of emrserverless Show documentation
Show all versions of emrserverless Show documentation
The AWS Java SDK for EMR Serverless module holds the client classes that are used for
communicating with EMR Serverless.
/*
* 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.emrserverless.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
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;
/**
*
* The configuration setting for monitoring.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MonitoringConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField S3_MONITORING_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("s3MonitoringConfiguration")
.getter(getter(MonitoringConfiguration::s3MonitoringConfiguration))
.setter(setter(Builder::s3MonitoringConfiguration)).constructor(S3MonitoringConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("s3MonitoringConfiguration").build())
.build();
private static final SdkField MANAGED_PERSISTENCE_MONITORING_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("managedPersistenceMonitoringConfiguration")
.getter(getter(MonitoringConfiguration::managedPersistenceMonitoringConfiguration))
.setter(setter(Builder::managedPersistenceMonitoringConfiguration))
.constructor(ManagedPersistenceMonitoringConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("managedPersistenceMonitoringConfiguration").build()).build();
private static final SdkField CLOUD_WATCH_LOGGING_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("cloudWatchLoggingConfiguration")
.getter(getter(MonitoringConfiguration::cloudWatchLoggingConfiguration))
.setter(setter(Builder::cloudWatchLoggingConfiguration))
.constructor(CloudWatchLoggingConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cloudWatchLoggingConfiguration")
.build()).build();
private static final SdkField PROMETHEUS_MONITORING_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("prometheusMonitoringConfiguration")
.getter(getter(MonitoringConfiguration::prometheusMonitoringConfiguration))
.setter(setter(Builder::prometheusMonitoringConfiguration))
.constructor(PrometheusMonitoringConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("prometheusMonitoringConfiguration")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
S3_MONITORING_CONFIGURATION_FIELD, MANAGED_PERSISTENCE_MONITORING_CONFIGURATION_FIELD,
CLOUD_WATCH_LOGGING_CONFIGURATION_FIELD, PROMETHEUS_MONITORING_CONFIGURATION_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("s3MonitoringConfiguration", S3_MONITORING_CONFIGURATION_FIELD);
put("managedPersistenceMonitoringConfiguration", MANAGED_PERSISTENCE_MONITORING_CONFIGURATION_FIELD);
put("cloudWatchLoggingConfiguration", CLOUD_WATCH_LOGGING_CONFIGURATION_FIELD);
put("prometheusMonitoringConfiguration", PROMETHEUS_MONITORING_CONFIGURATION_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final S3MonitoringConfiguration s3MonitoringConfiguration;
private final ManagedPersistenceMonitoringConfiguration managedPersistenceMonitoringConfiguration;
private final CloudWatchLoggingConfiguration cloudWatchLoggingConfiguration;
private final PrometheusMonitoringConfiguration prometheusMonitoringConfiguration;
private MonitoringConfiguration(BuilderImpl builder) {
this.s3MonitoringConfiguration = builder.s3MonitoringConfiguration;
this.managedPersistenceMonitoringConfiguration = builder.managedPersistenceMonitoringConfiguration;
this.cloudWatchLoggingConfiguration = builder.cloudWatchLoggingConfiguration;
this.prometheusMonitoringConfiguration = builder.prometheusMonitoringConfiguration;
}
/**
*
* The Amazon S3 configuration for monitoring log publishing.
*
*
* @return The Amazon S3 configuration for monitoring log publishing.
*/
public final S3MonitoringConfiguration s3MonitoringConfiguration() {
return s3MonitoringConfiguration;
}
/**
*
* The managed log persistence configuration for a job run.
*
*
* @return The managed log persistence configuration for a job run.
*/
public final ManagedPersistenceMonitoringConfiguration managedPersistenceMonitoringConfiguration() {
return managedPersistenceMonitoringConfiguration;
}
/**
*
* The Amazon CloudWatch configuration for monitoring logs. You can configure your jobs to send log information to
* CloudWatch.
*
*
* @return The Amazon CloudWatch configuration for monitoring logs. You can configure your jobs to send log
* information to CloudWatch.
*/
public final CloudWatchLoggingConfiguration cloudWatchLoggingConfiguration() {
return cloudWatchLoggingConfiguration;
}
/**
*
* The monitoring configuration object you can configure to send metrics to Amazon Managed Service for Prometheus
* for a job run.
*
*
* @return The monitoring configuration object you can configure to send metrics to Amazon Managed Service for
* Prometheus for a job run.
*/
public final PrometheusMonitoringConfiguration prometheusMonitoringConfiguration() {
return prometheusMonitoringConfiguration;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(s3MonitoringConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(managedPersistenceMonitoringConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLoggingConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(prometheusMonitoringConfiguration());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof MonitoringConfiguration)) {
return false;
}
MonitoringConfiguration other = (MonitoringConfiguration) obj;
return Objects.equals(s3MonitoringConfiguration(), other.s3MonitoringConfiguration())
&& Objects.equals(managedPersistenceMonitoringConfiguration(), other.managedPersistenceMonitoringConfiguration())
&& Objects.equals(cloudWatchLoggingConfiguration(), other.cloudWatchLoggingConfiguration())
&& Objects.equals(prometheusMonitoringConfiguration(), other.prometheusMonitoringConfiguration());
}
/**
* 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 final String toString() {
return ToString.builder("MonitoringConfiguration").add("S3MonitoringConfiguration", s3MonitoringConfiguration())
.add("ManagedPersistenceMonitoringConfiguration", managedPersistenceMonitoringConfiguration())
.add("CloudWatchLoggingConfiguration", cloudWatchLoggingConfiguration())
.add("PrometheusMonitoringConfiguration", prometheusMonitoringConfiguration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "s3MonitoringConfiguration":
return Optional.ofNullable(clazz.cast(s3MonitoringConfiguration()));
case "managedPersistenceMonitoringConfiguration":
return Optional.ofNullable(clazz.cast(managedPersistenceMonitoringConfiguration()));
case "cloudWatchLoggingConfiguration":
return Optional.ofNullable(clazz.cast(cloudWatchLoggingConfiguration()));
case "prometheusMonitoringConfiguration":
return Optional.ofNullable(clazz.cast(prometheusMonitoringConfiguration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy