package com.lanyuanxiaoyao.service.configuration.entity.yarn;

import org.eclipse.collections.api.list.ImmutableList;

/**
 * Yarn 队列简单实体类
 *
 * @author lanyuanxiaoyao
 * @date 2023-04-22
 */
public final class YarnQueue {
    private String cluster;
    private String queueName;
    private String state;
    private String type;
    private Float capacity;
    private Float usedCapacity;
    private Float maxCapacity;
    private Float absoluteCapacity;
    private Float absoluteMaxCapacity;
    private Float absoluteUsedCapacity;
    private Float numApplications;
    private ResourcesUsed resourcesUsed;
    private Long allocatedContainers;
    private Long reservedContainers;
    private Long pendingContainers;
    private ResourcesUsed minEffectiveCapacity;
    private ResourcesUsed maxEffectiveCapacity;
    private ResourcesUsed maximumAllocation;
    private Integer queuePriority;
    private String orderingPolicyInfo;
    private Long maxApplications;
    private Long maxApplicationsPerUser;
    private Long numActiveApplications;
    private Long numPendingApplications;
    private Long numContainers;
    private Long userLimit;
    private Float userLimitFactor;
    private Float configuredMaxAMResourceLimit;
    private ResourcesUsed AMResourceLimit;
    private ResourcesUsed usedAMResource;
    private ResourcesUsed userAMResourceLimit;
    private Queues queues;
    private String webUrl;

    public String getCluster() {
        return cluster;
    }

    public YarnQueue setCluster(String cluster) {
        this.cluster = cluster;
        return this;
    }

    public String getQueueName() {
        return queueName;
    }

    public YarnQueue setQueueName(String queueName) {
        this.queueName = queueName;
        return this;
    }

    public String getState() {
        return state;
    }

    public String getType() {
        return type;
    }

    public Float getCapacity() {
        return capacity;
    }

    public Float getUsedCapacity() {
        return usedCapacity;
    }

    public Float getMaxCapacity() {
        return maxCapacity;
    }

    public Float getAbsoluteCapacity() {
        return absoluteCapacity;
    }

    public Float getAbsoluteMaxCapacity() {
        return absoluteMaxCapacity;
    }

    public Float getAbsoluteUsedCapacity() {
        return absoluteUsedCapacity;
    }

    public Float getNumApplications() {
        return numApplications;
    }

    public ResourcesUsed getResourcesUsed() {
        return resourcesUsed;
    }

    public Long getAllocatedContainers() {
        return allocatedContainers;
    }

    public Long getReservedContainers() {
        return reservedContainers;
    }

    public Long getPendingContainers() {
        return pendingContainers;
    }

    public ResourcesUsed getMinEffectiveCapacity() {
        return minEffectiveCapacity;
    }

    public ResourcesUsed getMaxEffectiveCapacity() {
        return maxEffectiveCapacity;
    }

    public ResourcesUsed getMaximumAllocation() {
        return maximumAllocation;
    }

    public Integer getQueuePriority() {
        return queuePriority;
    }

    public String getOrderingPolicyInfo() {
        return orderingPolicyInfo;
    }

    public Long getNumActiveApplications() {
        return numActiveApplications;
    }

    public Long getNumPendingApplications() {
        return numPendingApplications;
    }

    public Long getNumContainers() {
        return numContainers;
    }

    public Long getMaxApplications() {
        return maxApplications;
    }

    public Long getMaxApplicationsPerUser() {
        return maxApplicationsPerUser;
    }

    public Long getUserLimit() {
        return userLimit;
    }

    public Float getUserLimitFactor() {
        return userLimitFactor;
    }

    public Float getConfiguredMaxAMResourceLimit() {
        return configuredMaxAMResourceLimit;
    }

    public ResourcesUsed getAMResourceLimit() {
        return AMResourceLimit;
    }

    public ResourcesUsed getUsedAMResource() {
        return usedAMResource;
    }

    public ResourcesUsed getUserAMResourceLimit() {
        return userAMResourceLimit;
    }

    public Queues getQueues() {
        return queues;
    }

    public String getWebUrl() {
        return webUrl;
    }

    public YarnQueue setWebUrl(String webUrl) {
        this.webUrl = webUrl;
        return this;
    }

    @Override
    public String toString() {
        return "YarnQueue{" +
                "cluster='" + cluster + '\'' +
                ", queueName='" + queueName + '\'' +
                ", state='" + state + '\'' +
                ", type='" + type + '\'' +
                ", capacity=" + capacity +
                ", usedCapacity=" + usedCapacity +
                ", maxCapacity=" + maxCapacity +
                ", absoluteCapacity=" + absoluteCapacity +
                ", absoluteMaxCapacity=" + absoluteMaxCapacity +
                ", absoluteUsedCapacity=" + absoluteUsedCapacity +
                ", numApplications=" + numApplications +
                ", resourcesUsed=" + resourcesUsed +
                ", allocatedContainers=" + allocatedContainers +
                ", reservedContainers=" + reservedContainers +
                ", pendingContainers=" + pendingContainers +
                ", minEffectiveCapacity=" + minEffectiveCapacity +
                ", maxEffectiveCapacity=" + maxEffectiveCapacity +
                ", maximumAllocation=" + maximumAllocation +
                ", queuePriority=" + queuePriority +
                ", orderingPolicyInfo='" + orderingPolicyInfo + '\'' +
                ", maxApplications=" + maxApplications +
                ", maxApplicationsPerUser=" + maxApplicationsPerUser +
                ", numActiveApplications=" + numActiveApplications +
                ", numPendingApplications=" + numPendingApplications +
                ", numContainers=" + numContainers +
                ", userLimit=" + userLimit +
                ", userLimitFactor=" + userLimitFactor +
                ", configuredMaxAMResourceLimit=" + configuredMaxAMResourceLimit +
                ", AMResourceLimit=" + AMResourceLimit +
                ", usedAMResource=" + usedAMResource +
                ", userAMResourceLimit=" + userAMResourceLimit +
                ", queues=" + queues +
                ", webUrl='" + webUrl + '\'' +
                '}';
    }

    public static final class ResourcesUsed {
        private Long memory;
        private Long vCores;

        public Long getMemory() {
            return memory;
        }

        public Long getvCores() {
            return vCores;
        }

        @Override
        public String toString() {
            return "ResourcesUsed{" +
                    "memory=" + memory +
                    ", vCores=" + vCores +
                    '}';
        }
    }

    public static final class Queues {
        private ImmutableList<YarnQueue> queue;

        public ImmutableList<YarnQueue> getQueue() {
            return queue;
        }

        @Override
        public String toString() {
            return "Queues{" +
                    "queue=" + queue +
                    '}';
        }
    }
}
