<commit_before>package mesosphere.marathon.api.v1

import mesosphere.mesos.TaskBuilder
import mesosphere.marathon.{ContainerInfo, Protos}
import mesosphere.marathon.state.{MarathonState, Timestamp, Timestamped}
import mesosphere.marathon.Protos.{MarathonTask, Constraint}
import mesosphere.marathon.tasks.TaskTracker
import mesosphere.marathon.health.HealthCheck
import mesosphere.marathon.api.validation.FieldConstraints._
import mesosphere.marathon.api.validation.PortIndices
import com.fasterxml.jackson.annotation.{
  JsonIgnore,
  JsonIgnoreProperties,
  JsonProperty
}
import org.apache.mesos.Protos.TaskState
import scala.collection.JavaConverters._
import java.lang.{Integer => JInt, Double => JDouble}
import mesosphere.mesos.protos.{Resource, ScalarResource}


/**
 * @author <NAME>
 */

@PortIndices
@JsonIgnoreProperties(ignoreUnknown = true)
case class AppDefinition(

  @FieldNotEmpty
  @FieldPattern(regexp = "^[A-Za-z0-9_.-]+$")
  id: String = "",

  cmd: String = "",

  env: Map[String, String] = Map.empty,

  @FieldMin(0)
  instances: JInt = AppDefinition.DEFAULT_INSTANCES,

  cpus: JDouble = AppDefinition.DEFAULT_CPUS,

  mem: JDouble = AppDefinition.DEFAULT_MEM,

  @FieldPattern(regexp="^(//cmd)|(/?[^/]+(/[^/]+)*)|$")
  executor: String = "",

  constraints: Set[Constraint] = Set(),

  uris: Seq[String] = Seq(),

  @FieldPortsArray
  ports: Seq[JInt] = AppDefinition.DEFAULT_PORTS,

  /**
   * Number of new tasks this app may spawn per second in response to
   * terminated tasks. This prevents frequently failing apps from spamming
   * the cluster.<commit_msg>Enforce LDH conventions for app names.<commit_after>package mesosphere.marathon.api.v1

import mesosphere.mesos.TaskBuilder
import mesosphere.marathon.{ContainerInfo, Protos}
import mesosphere.marathon.state.{MarathonState, Timestamp, Timestamped}
import mesosphere.marathon.Protos.{MarathonTask, Constraint}
import mesosphere.marathon.tasks.TaskTracker
import mesosphere.marathon.health.HealthCheck
import mesosphere.marathon.api.validation.FieldConstraints._
import mesosphere.marathon.api.validation.PortIndices
import com.fasterxml.jackson.annotation.{
  JsonIgnore,
  JsonIgnoreProperties,
  JsonProperty
}
import org.apache.mesos.Protos.TaskState
import scala.collection.JavaConverters._
import java.lang.{Integer => JInt, Double => JDouble}
import mesosphere.mesos.protos.{Resource, ScalarResource}


/**
 * @author <NAME>
 */

@PortIndices
@JsonIgnoreProperties(ignoreUnknown = true)
case class AppDefinition(

  @FieldNotEmpty
  @FieldPattern(regexp = "^[a-z0-9.-]+$")
  id: String = "",

  cmd: String = "",

  env: Map[String, String] = Map.empty,

  @FieldMin(0)
  instances: JInt = AppDefinition.DEFAULT_INSTANCES,

  cpus: JDouble = AppDefinition.DEFAULT_CPUS,

  mem: JDouble = AppDefinition.DEFAULT_MEM,

  @FieldPattern(regexp="^(//cmd)|(/?[^/]+(/[^/]+)*)|$")
  executor: String = "",

  constraints: Set[Constraint] = Set(),

  uris: Seq[String] = Seq(),

  @FieldPortsArray
  ports: Seq[JInt] = AppDefinition.DEFAULT_PORTS,

  /**
   * Number of new tasks this app may spawn per second in response to
   * terminated tasks. This prevents frequently failing apps from spamming
   * the cluster.
{'fraction_non_alphanumeric': 0.1255073368716828, 'fraction_numerical': 0.002497658445207618, 'mean_word_length': 5.137931034482759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5562172', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1011, 'n_words': 214}