<commit_before>/*
 * 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.
 */

namespace java org.apache.aurora.gen
namespace py gen.apache.aurora.api

// Thrift interface definition for the aurora scheduler.

enum ResponseCode {
  INVALID_REQUEST = 0,
  OK              = 1,
  ERROR           = 2,
  WARNING         = 3,
  AUTH_FAILED     = 4,
  LOCK_ERROR      = 5  // Raised when a Lock-protected operation failed due to lock validation.
}

const i32 THRIFT_API_VERSION = 3

struct APIVersion {
  1: required i32 major
}

// Scheduler Thrift API Version. Increment this when breaking backwards compatibility.
const APIVersion CURRENT_API_VERSION = {'major': THRIFT_API_VERSION}

// Aurora executor framework name.
const string AURORA_EXECUTOR_NAME = 'AuroraExecutor'

struct Identity {
  1: string role
  2: string user
}

struct SessionKey {
  4: optional string mechanism  // The name of the authentication mechanism, which
                                // instructs the server how to interpret the data field.
  5: optional binary data       // A blob of data that the server may use for authentication.
}

struct ResourceAggregate {
  1: double numCpus  // Number of CPU cores allotted.
  2: i64 ramMb       // Megabytes of RAM allotted.
  3: i64 diskMb      // Megabytes of disk space allotted.
}

// A single host attribute.
struct Attribute {
  1: string name
  2: set<string> values
}

enum MaintenanceMode {
  NONE      = 1,
  SCHEDULED = 2,
  DRAINING  = 3,
  DRAINED   = 4
}

// The attributes assigned to a host.
struct HostAttributes {
  1: string          host
  2: set<Attribute>  attributes
  3: optional MaintenanceMode mode
  4: optional string slaveId
}

// A constraint that specifies an explicit set of values, at least one of which must be present
// on a host for a task to be scheduled there.
struct ValueConstraint {
  1: bool negated       // If true, treat this as a 'not' - to avoid specific values.
  2: set<string> values
}

// A constraint the specifies the maximum number of active tasks on a host with a matching
// attribute that may be scheduled simultaneously.
struct LimitConstraint {
  1: i32 limit
}

// Types of constraints that may be applied to a task.
union TaskConstraint {
  1: ValueConstraint value
  2: LimitConstraint limit
}

// A constraint that defines whether a task may be scheduled on a host.
struct Constraint {
  1: string name
  2: TaskConstraint constraint
}

struct Package {
  1: string role
  2: string name
  3: i32 version
}

// Arbitrary key-value metadata to be included into TaskConfig.
struct Metadata {
  1: string key
  2: string value
}

// A unique identifier for a Job.
struct JobKey {
  1: string role        // Mesos role (Unix service account), for example "mesos"
  2: string environment // Environment, for example "devel"
  3: string name        // Name, for example "labrat"
}

// A unique lock key.
union LockKey {
  1: JobKey job
}

// A generic lock struct to facilitate context specific resource/operation serialization.
struct Lock {
  1: LockKey key                // ID of the lock - unique per storage
  2: string token               // UUID - facilitating soft lock authorization
  3: string user                // Lock owner
  4: i64 timestampMs            // Lock creation timestamp in milliseconds
  5: optional string message    // Optional message to record with the lock
}

// Defines the required lock validation level.
enum LockValidation {
  CHECKED   = 0   // The lock must be valid in order to be released.
  UNCHECKED = 1   // The lock will be released without validation (aka “force release”).
}

// A unique identifier for the active task within a job.<commit_msg>Remove smart quotes from api.thrift<commit_after>/*
 * 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.
 */

namespace java org.apache.aurora.gen
namespace py gen.apache.aurora.api

// Thrift interface definition for the aurora scheduler.

enum ResponseCode {
  INVALID_REQUEST = 0,
  OK              = 1,
  ERROR           = 2,
  WARNING         = 3,
  AUTH_FAILED     = 4,
  LOCK_ERROR      = 5  // Raised when a Lock-protected operation failed due to lock validation.
}

const i32 THRIFT_API_VERSION = 3

struct APIVersion {
  1: required i32 major
}

// Scheduler Thrift API Version. Increment this when breaking backwards compatibility.
const APIVersion CURRENT_API_VERSION = {'major': THRIFT_API_VERSION}

// Aurora executor framework name.
const string AURORA_EXECUTOR_NAME = 'AuroraExecutor'

struct Identity {
  1: string role
  2: string user
}

struct SessionKey {
  4: optional string mechanism  // The name of the authentication mechanism, which
                                // instructs the server how to interpret the data field.
  5: optional binary data       // A blob of data that the server may use for authentication.
}

struct ResourceAggregate {
  1: double numCpus  // Number of CPU cores allotted.
  2: i64 ramMb       // Megabytes of RAM allotted.
  3: i64 diskMb      // Megabytes of disk space allotted.
}

// A single host attribute.
struct Attribute {
  1: string name
  2: set<string> values
}

enum MaintenanceMode {
  NONE      = 1,
  SCHEDULED = 2,
  DRAINING  = 3,
  DRAINED   = 4
}

// The attributes assigned to a host.
struct HostAttributes {
  1: string          host
  2: set<Attribute>  attributes
  3: optional MaintenanceMode mode
  4: optional string slaveId
}

// A constraint that specifies an explicit set of values, at least one of which must be present
// on a host for a task to be scheduled there.
struct ValueConstraint {
  1: bool negated       // If true, treat this as a 'not' - to avoid specific values.
  2: set<string> values
}

// A constraint the specifies the maximum number of active tasks on a host with a matching
// attribute that may be scheduled simultaneously.
struct LimitConstraint {
  1: i32 limit
}

// Types of constraints that may be applied to a task.
union TaskConstraint {
  1: ValueConstraint value
  2: LimitConstraint limit
}

// A constraint that defines whether a task may be scheduled on a host.
struct Constraint {
  1: string name
  2: TaskConstraint constraint
}

struct Package {
  1: string role
  2: string name
  3: i32 version
}

// Arbitrary key-value metadata to be included into TaskConfig.
struct Metadata {
  1: string key
  2: string value
}

// A unique identifier for a Job.
struct JobKey {
  1: string role        // Mesos role (Unix service account), for example "mesos"
  2: string environment // Environment, for example "devel"
  3: string name        // Name, for example "labrat"
}

// A unique lock key.
union LockKey {
  1: JobKey job
}

// A generic lock struct to facilitate context specific resource/operation serialization.
struct Lock {
  1: LockKey key                // ID of the lock - unique per storage
  2: string token               // UUID - facilitating soft lock authorization
  3: string user                // Lock owner
  4: i64 timestampMs            // Lock creation timestamp in milliseconds
  5: optional string message    // Optional message to record with the lock
}

// Defines the required lock validation level.
enum LockValidation {
  CHECKED   = 0   // The lock must be valid in order to be released.
  UNCHECKED = 1   // The lock will be released without validation (aka "force release").
}

// A unique identifier for the active task within a job.
{'fraction_non_alphanumeric': 0.06613250418560153, 'fraction_numerical': 0.015785697201626404, 'mean_word_length': 2.8292124542124544, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, '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': '3394143', 'n_tokens_mistral': 2343, 'n_tokens_neox': 2258, 'n_words': 1083}