<commit_before>/*
 *
 *  Copyright 2015 Netflix, Inc.
 *
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
 *     You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License 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 com.netflix.genie.common.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.netflix.genie.common.exceptions.GeniePreconditionException;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Cacheable;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OrderColumn;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Representation of the state of the Cluster object.
 *
 * @author skrishnan
 * @author amsharma
 * @author tgianos
 */
@Entity
@Cacheable(false)
@ApiModel(value = "A Cluster")
public class Cluster extends CommonEntityFields {

    private static final Logger LOG = LoggerFactory.getLogger(Cluster.class);

    /**
     * Status of cluster - UP, OUT_OF_SERVICE or TERMINATED.
     */
    @Basic(optional = false)
    @Enumerated(EnumType.STRING)
    @ApiModelProperty(
            value = "The status of the cluster",
            required = true,
            dataType = "string"
    )
    private ClusterStatus status;

    /**
     * The type of the cluster to use to figure out the job manager for this
     * cluster. eg: yarn, presto, mesos etc. The mapping JobManager will be
     * specified using the property:
     * netflix.genie.server.{clusterType}.JobManagerImpl
     */
    @Basic(optional = false)
    @ApiModelProperty(
            value = "The type of the cluster to use to figure out the job manager for this"
                    + " cluster. e.g.: yarn, presto, mesos etc. The mapping to a JobManager will be"
                    + " specified using the property: netflix.genie.server.{clusterType}.JobManagerImpl",
            required = true)
    private String clusterType;

    /**
     * Reference to all the configuration files needed for this cluster.
     */
    @ElementCollection(fetch = FetchType.EAGER)
    @ApiModelProperty(
            value = "All the configuration files needed for this cluster which will be downloaded pre-use",
            required = true)
    private Set<String> configs;

    /**
     * Set of tags for a cluster.
     */
    @ElementCollection(fetch = FetchType.EAGER)
    @ApiModelProperty(
            value = "The tags associated with this cluster",
            required = true)
    private Set<String> tags;

    /**
     * Commands supported on this cluster - e.g. prodhive, testhive, etc.
     */
    @ManyToMany(fetch = FetchType.EAGER)
    @OrderColumn
    @JsonIgnore
    private List<Command> commands;<commit_msg>Fixing the documentation for a cluster with the accurate property<commit_after>/*
 *
 *  Copyright 2015 Netflix, Inc.
 *
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
 *     You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License 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 com.netflix.genie.common.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.netflix.genie.common.exceptions.GeniePreconditionException;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Cacheable;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OrderColumn;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Representation of the state of the Cluster object.
 *
 * @author skrishnan
 * @author amsharma
 * @author tgianos
 */
@Entity
@Cacheable(false)
@ApiModel(value = "A Cluster")
public class Cluster extends CommonEntityFields {

    private static final Logger LOG = LoggerFactory.getLogger(Cluster.class);

    /**
     * Status of cluster - UP, OUT_OF_SERVICE or TERMINATED.
     */
    @Basic(optional = false)
    @Enumerated(EnumType.STRING)
    @ApiModelProperty(
            value = "The status of the cluster",
            required = true,
            dataType = "string"
    )
    private ClusterStatus status;

    /**
     * The type of the cluster to use to figure out the job manager for this
     * cluster. eg: yarn, presto, mesos etc. The mapping JobManager will be
     * specified using the property:
     * netflix.genie.server.{clusterType}.JobManagerImpl
     */
    @Basic(optional = false)
    @ApiModelProperty(
            value = "The type of the cluster to use to figure out the job manager for this"
                    + " cluster. e.g.: yarn, presto, mesos etc. The mapping to a JobManager will be"
                    + " specified using the property: com.netflix.genie.server.job.manager.<clusterType>.impl",
            required = true)
    private String clusterType;

    /**
     * Reference to all the configuration files needed for this cluster.
     */
    @ElementCollection(fetch = FetchType.EAGER)
    @ApiModelProperty(
            value = "All the configuration files needed for this cluster which will be downloaded pre-use",
            required = true)
    private Set<String> configs;

    /**
     * Set of tags for a cluster.
     */
    @ElementCollection(fetch = FetchType.EAGER)
    @ApiModelProperty(
            value = "The tags associated with this cluster",
            required = true)
    private Set<String> tags;

    /**
     * Commands supported on this cluster - e.g. prodhive, testhive, etc.
     */
    @ManyToMany(fetch = FetchType.EAGER)
    @OrderColumn
    @JsonIgnore
    private List<Command> commands;
{'fraction_non_alphanumeric': 0.08658068057080132, 'fraction_numerical': 0.0030186608122941823, 'mean_word_length': 3.0789031897034134, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6988648', 'n_tokens_mistral': 2022, 'n_tokens_neox': 1998, 'n_words': 658}