software.amazon.awssdk.services.glue.model.RunMetrics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue Show documentation
Show all versions of glue Show documentation
The AWS Java SDK for AWS Glue module holds the client classes that are used for communicating
with AWS Glue Service
/*
* 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.glue.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.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;
/**
*
* Metrics for the optimizer run.
*
*
* This structure is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RunMetrics implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NUMBER_OF_BYTES_COMPACTED_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NumberOfBytesCompacted").getter(getter(RunMetrics::numberOfBytesCompacted))
.setter(setter(Builder::numberOfBytesCompacted))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfBytesCompacted").build())
.build();
private static final SdkField NUMBER_OF_FILES_COMPACTED_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NumberOfFilesCompacted").getter(getter(RunMetrics::numberOfFilesCompacted))
.setter(setter(Builder::numberOfFilesCompacted))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfFilesCompacted").build())
.build();
private static final SdkField NUMBER_OF_DPUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NumberOfDpus").getter(getter(RunMetrics::numberOfDpus)).setter(setter(Builder::numberOfDpus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfDpus").build()).build();
private static final SdkField JOB_DURATION_IN_HOUR_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("JobDurationInHour").getter(getter(RunMetrics::jobDurationInHour))
.setter(setter(Builder::jobDurationInHour))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobDurationInHour").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
NUMBER_OF_BYTES_COMPACTED_FIELD, NUMBER_OF_FILES_COMPACTED_FIELD, NUMBER_OF_DPUS_FIELD, JOB_DURATION_IN_HOUR_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String numberOfBytesCompacted;
private final String numberOfFilesCompacted;
private final String numberOfDpus;
private final String jobDurationInHour;
private RunMetrics(BuilderImpl builder) {
this.numberOfBytesCompacted = builder.numberOfBytesCompacted;
this.numberOfFilesCompacted = builder.numberOfFilesCompacted;
this.numberOfDpus = builder.numberOfDpus;
this.jobDurationInHour = builder.jobDurationInHour;
}
/**
*
* The number of bytes removed by the compaction job run.
*
*
* @return The number of bytes removed by the compaction job run.
*/
public final String numberOfBytesCompacted() {
return numberOfBytesCompacted;
}
/**
*
* The number of files removed by the compaction job run.
*
*
* @return The number of files removed by the compaction job run.
*/
public final String numberOfFilesCompacted() {
return numberOfFilesCompacted;
}
/**
*
* The number of DPU hours consumed by the job.
*
*
* @return The number of DPU hours consumed by the job.
*/
public final String numberOfDpus() {
return numberOfDpus;
}
/**
*
* The duration of the job in hours.
*
*
* @return The duration of the job in hours.
*/
public final String jobDurationInHour() {
return jobDurationInHour;
}
@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(numberOfBytesCompacted());
hashCode = 31 * hashCode + Objects.hashCode(numberOfFilesCompacted());
hashCode = 31 * hashCode + Objects.hashCode(numberOfDpus());
hashCode = 31 * hashCode + Objects.hashCode(jobDurationInHour());
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 RunMetrics)) {
return false;
}
RunMetrics other = (RunMetrics) obj;
return Objects.equals(numberOfBytesCompacted(), other.numberOfBytesCompacted())
&& Objects.equals(numberOfFilesCompacted(), other.numberOfFilesCompacted())
&& Objects.equals(numberOfDpus(), other.numberOfDpus())
&& Objects.equals(jobDurationInHour(), other.jobDurationInHour());
}
/**
* 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("RunMetrics").add("NumberOfBytesCompacted", numberOfBytesCompacted())
.add("NumberOfFilesCompacted", numberOfFilesCompacted()).add("NumberOfDpus", numberOfDpus())
.add("JobDurationInHour", jobDurationInHour()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "NumberOfBytesCompacted":
return Optional.ofNullable(clazz.cast(numberOfBytesCompacted()));
case "NumberOfFilesCompacted":
return Optional.ofNullable(clazz.cast(numberOfFilesCompacted()));
case "NumberOfDpus":
return Optional.ofNullable(clazz.cast(numberOfDpus()));
case "JobDurationInHour":
return Optional.ofNullable(clazz.cast(jobDurationInHour()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("NumberOfBytesCompacted", NUMBER_OF_BYTES_COMPACTED_FIELD);
map.put("NumberOfFilesCompacted", NUMBER_OF_FILES_COMPACTED_FIELD);
map.put("NumberOfDpus", NUMBER_OF_DPUS_FIELD);
map.put("JobDurationInHour", JOB_DURATION_IN_HOUR_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy