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

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 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 getter(Function g) { return obj -> g.apply((CrawlerMetrics) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the crawler. *

* * @param crawlerName * The name of the crawler. * @return Returns a reference to this object so that method calls can be chained together. */ Builder crawlerName(String crawlerName); /** *

* The estimated time left to complete a running crawl. *

* * @param timeLeftSeconds * The estimated time left to complete a running crawl. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeLeftSeconds(Double timeLeftSeconds); /** *

* True if the crawler is still estimating how long it will take to complete this run. *

* * @param stillEstimating * True if the crawler is still estimating how long it will take to complete this run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stillEstimating(Boolean stillEstimating); /** *

* The duration of the crawler's most recent run, in seconds. *

* * @param lastRuntimeSeconds * The duration of the crawler's most recent run, in seconds. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastRuntimeSeconds(Double lastRuntimeSeconds); /** *

* The median duration of this crawler's runs, in seconds. *

* * @param medianRuntimeSeconds * The median duration of this crawler's runs, in seconds. * @return Returns a reference to this object so that method calls can be chained together. */ Builder medianRuntimeSeconds(Double medianRuntimeSeconds); /** *

* The number of tables created by this crawler. *

* * @param tablesCreated * The number of tables created by this crawler. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tablesCreated(Integer tablesCreated); /** *

* The number of tables updated by this crawler. *

* * @param tablesUpdated * The number of tables updated by this crawler. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tablesUpdated(Integer tablesUpdated); /** *

* The number of tables deleted by this crawler. *

* * @param tablesDeleted * The number of tables deleted by this crawler. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tablesDeleted(Integer tablesDeleted); } static final class BuilderImpl implements Builder { private String crawlerName; private Double timeLeftSeconds; private Boolean stillEstimating; private Double lastRuntimeSeconds; private Double medianRuntimeSeconds; private Integer tablesCreated; private Integer tablesUpdated; private Integer tablesDeleted; private BuilderImpl() { } private BuilderImpl(CrawlerMetrics model) { crawlerName(model.crawlerName); timeLeftSeconds(model.timeLeftSeconds); stillEstimating(model.stillEstimating); lastRuntimeSeconds(model.lastRuntimeSeconds); medianRuntimeSeconds(model.medianRuntimeSeconds); tablesCreated(model.tablesCreated); tablesUpdated(model.tablesUpdated); tablesDeleted(model.tablesDeleted); } public final String getCrawlerName() { return crawlerName; } public final void setCrawlerName(String crawlerName) { this.crawlerName = crawlerName; } @Override public final Builder crawlerName(String crawlerName) { this.crawlerName = crawlerName; return this; } public final Double getTimeLeftSeconds() { return timeLeftSeconds; } public final void setTimeLeftSeconds(Double timeLeftSeconds) { this.timeLeftSeconds = timeLeftSeconds; } @Override public final Builder timeLeftSeconds(Double timeLeftSeconds) { this.timeLeftSeconds = timeLeftSeconds; return this; } public final Boolean getStillEstimating() { return stillEstimating; } public final void setStillEstimating(Boolean stillEstimating) { this.stillEstimating = stillEstimating; } @Override public final Builder stillEstimating(Boolean stillEstimating) { this.stillEstimating = stillEstimating; return this; } public final Double getLastRuntimeSeconds() { return lastRuntimeSeconds; } public final void setLastRuntimeSeconds(Double lastRuntimeSeconds) { this.lastRuntimeSeconds = lastRuntimeSeconds; } @Override public final Builder lastRuntimeSeconds(Double lastRuntimeSeconds) { this.lastRuntimeSeconds = lastRuntimeSeconds; return this; } public final Double getMedianRuntimeSeconds() { return medianRuntimeSeconds; } public final void setMedianRuntimeSeconds(Double medianRuntimeSeconds) { this.medianRuntimeSeconds = medianRuntimeSeconds; } @Override public final Builder medianRuntimeSeconds(Double medianRuntimeSeconds) { this.medianRuntimeSeconds = medianRuntimeSeconds; return this; } public final Integer getTablesCreated() { return tablesCreated; } public final void setTablesCreated(Integer tablesCreated) { this.tablesCreated = tablesCreated; } @Override public final Builder tablesCreated(Integer tablesCreated) { this.tablesCreated = tablesCreated; return this; } public final Integer getTablesUpdated() { return tablesUpdated; } public final void setTablesUpdated(Integer tablesUpdated) { this.tablesUpdated = tablesUpdated; } @Override public final Builder tablesUpdated(Integer tablesUpdated) { this.tablesUpdated = tablesUpdated; return this; } public final Integer getTablesDeleted() { return tablesDeleted; } public final void setTablesDeleted(Integer tablesDeleted) { this.tablesDeleted = tablesDeleted; } @Override public final Builder tablesDeleted(Integer tablesDeleted) { this.tablesDeleted = tablesDeleted; return this; } @Override public CrawlerMetrics build() { return new CrawlerMetrics(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy