
software.amazon.awssdk.services.glue.model.CrawlerMetrics Maven / Gradle / Ivy
/*
* 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.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;
/**
*
* Metrics for a specified crawler.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CrawlerMetrics implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CRAWLER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CrawlerName").getter(getter(CrawlerMetrics::crawlerName)).setter(setter(Builder::crawlerName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlerName").build()).build();
private static final SdkField TIME_LEFT_SECONDS_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("TimeLeftSeconds").getter(getter(CrawlerMetrics::timeLeftSeconds))
.setter(setter(Builder::timeLeftSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeLeftSeconds").build()).build();
private static final SdkField STILL_ESTIMATING_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("StillEstimating").getter(getter(CrawlerMetrics::stillEstimating))
.setter(setter(Builder::stillEstimating))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StillEstimating").build()).build();
private static final SdkField LAST_RUNTIME_SECONDS_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("LastRuntimeSeconds").getter(getter(CrawlerMetrics::lastRuntimeSeconds))
.setter(setter(Builder::lastRuntimeSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastRuntimeSeconds").build())
.build();
private static final SdkField MEDIAN_RUNTIME_SECONDS_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("MedianRuntimeSeconds").getter(getter(CrawlerMetrics::medianRuntimeSeconds))
.setter(setter(Builder::medianRuntimeSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MedianRuntimeSeconds").build())
.build();
private static final SdkField TABLES_CREATED_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("TablesCreated").getter(getter(CrawlerMetrics::tablesCreated)).setter(setter(Builder::tablesCreated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TablesCreated").build()).build();
private static final SdkField TABLES_UPDATED_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("TablesUpdated").getter(getter(CrawlerMetrics::tablesUpdated)).setter(setter(Builder::tablesUpdated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TablesUpdated").build()).build();
private static final SdkField TABLES_DELETED_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("TablesDeleted").getter(getter(CrawlerMetrics::tablesDeleted)).setter(setter(Builder::tablesDeleted))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TablesDeleted").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CRAWLER_NAME_FIELD,
TIME_LEFT_SECONDS_FIELD, STILL_ESTIMATING_FIELD, LAST_RUNTIME_SECONDS_FIELD, MEDIAN_RUNTIME_SECONDS_FIELD,
TABLES_CREATED_FIELD, TABLES_UPDATED_FIELD, TABLES_DELETED_FIELD));
private static final long serialVersionUID = 1L;
private final String crawlerName;
private final Double timeLeftSeconds;
private final Boolean stillEstimating;
private final Double lastRuntimeSeconds;
private final Double medianRuntimeSeconds;
private final Integer tablesCreated;
private final Integer tablesUpdated;
private final Integer tablesDeleted;
private CrawlerMetrics(BuilderImpl builder) {
this.crawlerName = builder.crawlerName;
this.timeLeftSeconds = builder.timeLeftSeconds;
this.stillEstimating = builder.stillEstimating;
this.lastRuntimeSeconds = builder.lastRuntimeSeconds;
this.medianRuntimeSeconds = builder.medianRuntimeSeconds;
this.tablesCreated = builder.tablesCreated;
this.tablesUpdated = builder.tablesUpdated;
this.tablesDeleted = builder.tablesDeleted;
}
/**
*
* The name of the crawler.
*
*
* @return The name of the crawler.
*/
public final String crawlerName() {
return crawlerName;
}
/**
*
* The estimated time left to complete a running crawl.
*
*
* @return The estimated time left to complete a running crawl.
*/
public final Double timeLeftSeconds() {
return timeLeftSeconds;
}
/**
*
* True if the crawler is still estimating how long it will take to complete this run.
*
*
* @return True if the crawler is still estimating how long it will take to complete this run.
*/
public final Boolean stillEstimating() {
return stillEstimating;
}
/**
*
* The duration of the crawler's most recent run, in seconds.
*
*
* @return The duration of the crawler's most recent run, in seconds.
*/
public final Double lastRuntimeSeconds() {
return lastRuntimeSeconds;
}
/**
*
* The median duration of this crawler's runs, in seconds.
*
*
* @return The median duration of this crawler's runs, in seconds.
*/
public final Double medianRuntimeSeconds() {
return medianRuntimeSeconds;
}
/**
*
* The number of tables created by this crawler.
*
*
* @return The number of tables created by this crawler.
*/
public final Integer tablesCreated() {
return tablesCreated;
}
/**
*
* The number of tables updated by this crawler.
*
*
* @return The number of tables updated by this crawler.
*/
public final Integer tablesUpdated() {
return tablesUpdated;
}
/**
*
* The number of tables deleted by this crawler.
*
*
* @return The number of tables deleted by this crawler.
*/
public final Integer tablesDeleted() {
return tablesDeleted;
}
@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(crawlerName());
hashCode = 31 * hashCode + Objects.hashCode(timeLeftSeconds());
hashCode = 31 * hashCode + Objects.hashCode(stillEstimating());
hashCode = 31 * hashCode + Objects.hashCode(lastRuntimeSeconds());
hashCode = 31 * hashCode + Objects.hashCode(medianRuntimeSeconds());
hashCode = 31 * hashCode + Objects.hashCode(tablesCreated());
hashCode = 31 * hashCode + Objects.hashCode(tablesUpdated());
hashCode = 31 * hashCode + Objects.hashCode(tablesDeleted());
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 CrawlerMetrics)) {
return false;
}
CrawlerMetrics other = (CrawlerMetrics) obj;
return Objects.equals(crawlerName(), other.crawlerName()) && Objects.equals(timeLeftSeconds(), other.timeLeftSeconds())
&& Objects.equals(stillEstimating(), other.stillEstimating())
&& Objects.equals(lastRuntimeSeconds(), other.lastRuntimeSeconds())
&& Objects.equals(medianRuntimeSeconds(), other.medianRuntimeSeconds())
&& Objects.equals(tablesCreated(), other.tablesCreated())
&& Objects.equals(tablesUpdated(), other.tablesUpdated())
&& Objects.equals(tablesDeleted(), other.tablesDeleted());
}
/**
* 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("CrawlerMetrics").add("CrawlerName", crawlerName()).add("TimeLeftSeconds", timeLeftSeconds())
.add("StillEstimating", stillEstimating()).add("LastRuntimeSeconds", lastRuntimeSeconds())
.add("MedianRuntimeSeconds", medianRuntimeSeconds()).add("TablesCreated", tablesCreated())
.add("TablesUpdated", tablesUpdated()).add("TablesDeleted", tablesDeleted()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CrawlerName":
return Optional.ofNullable(clazz.cast(crawlerName()));
case "TimeLeftSeconds":
return Optional.ofNullable(clazz.cast(timeLeftSeconds()));
case "StillEstimating":
return Optional.ofNullable(clazz.cast(stillEstimating()));
case "LastRuntimeSeconds":
return Optional.ofNullable(clazz.cast(lastRuntimeSeconds()));
case "MedianRuntimeSeconds":
return Optional.ofNullable(clazz.cast(medianRuntimeSeconds()));
case "TablesCreated":
return Optional.ofNullable(clazz.cast(tablesCreated()));
case "TablesUpdated":
return Optional.ofNullable(clazz.cast(tablesUpdated()));
case "TablesDeleted":
return Optional.ofNullable(clazz.cast(tablesDeleted()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy