Safe HaskellNone




Core Framework & Executor types

Masters & Slaves

data MasterInfo Source

Describes a master. This will probably have more fields in the future which might be used, for example, to link a framework web UI to a master web UI.

data SlaveInfo Source

Describes a slave. Note that the slaveInfoSlaveID field is only available after a slave is registered with the master, and is made available here to facilitate re-registration. If checkpoint is set, the slave is checkpointing its own information and potentially frameworks' information (if a framework has checkpointing enabled).

Frameworks & Executors

data ExecutorInfo Source




executorInfoExecutorId :: !ExecutorID
executorInfoFrameworkId :: !FrameworkID
executorInfoCommandInfo :: !CommandInfo
executorInfoContainerInfo :: !(Maybe ContainerInfo)

Executor provided with a container will launch the container with the executor's CommandInfo and we expect the container to act as a Mesos executor.

executorInfoResources :: ![Resource]
executorInfoName :: !(Maybe ByteString)
executorInfoSource :: !(Maybe ByteString)

Source is an identifier style string used by frameworks to track the source of an executor. This is useful when it's possible for different executor ids to be related semantically.

NOTE: Source is exposed alongside the resource usage of the executor via JSON on the slave. This allows users to import usage information into a time series database for monitoring.

executorInfoData_ :: !(Maybe ByteString)

data FrameworkInfo Source

Describes a framework. If the user field is set to an empty string Mesos will automagically set it to the current user. Note that the ID is only available after a framework has registered, however, it is included here in order to facilitate scheduler failover (i.e., if it is set then the SchedulerDriver expects the scheduler is performing failover). The amount of time that the master will wait for the scheduler to failover before removing the framework is specified by frameworkFailoverTimeout. If frameworkCheckpoint is set, framework pid, executor pids and status updates are checkpointed to disk by the slaves. Checkpointing allows a restarted slave to reconnect with old executors and recover status updates, at the cost of disk I/O. The frameworkRole field is used to group frameworks for allocation decisions, depending on the allocation policy being used. If the frameworkHostname field is set to an empty string Mesos will automagically set it to the current hostname.

Resource allocation

data Request Source

Describes a request for resources that can be used by a framework to proactively influence the allocator.




requestSlaveId :: !(Maybe SlaveID)

If value is provided, then this request is assumed to only apply to resources on the given slave.

requestResources :: ![Resource]

newtype Filters Source




filtersRefuseSeconds :: Maybe Double

Time to consider unused resources refused. Note that all unused resources will be considered refused and use the default value (below) regardless of whether Filters was passed to SchedulerDriver::launchTasks. You MUST pass Filters with this field set to change this behavior (i.e., get another offer which includes unused resources sooner or later than the default).

Defaults to 5.0 if not set.

Launching Tasks

data TaskInfo Source

Describes a task. Passed from the scheduler all the way to an executor (see SchedulerDriver::launchTasks and Executor::launchTask).

A different executor can be used to launch this task, and subsequent tasks meant for the same executor can reuse the same ExecutorInfo struct.




taskInfoName :: !ByteString
taskInfoId' :: !TaskID
taskInfoSlaveId :: !SlaveID
taskInfoResources :: ![Resource]
taskInfoImplementation :: !TaskExecutionInfo
taskInfoData_ :: !(Maybe ByteString)
taskInfoContainer :: !(Maybe ContainerInfo)

Task provided with a container will launch the container as part of this task paired with the task's CommandInfo.

taskInfoHealthCheck :: !(Maybe HealthCheck)

A health check for the task (currently in *alpha* and initial support will only be for TaskInfo's that have a CommandInfo).

data CommandInfo Source

Describes a command, executed via:

/bin/sh -c value

Any URIs specified are fetched before executing the command. If the executable field for an uri is set, executable file permission is set on the downloaded file. Otherwise, if the downloaded file has a recognized archive extension (currently [compressed] tar and zip) it is extracted into the executor's working directory. In addition, any environment variables are set before executing the command (so they can be used to "parameterize" your command).




commandInfoUris :: ![CommandURI]
commandInfoEnvironment :: !(Maybe [(ByteString, ByteString)])
commandInfoValue :: !CommandValue
commandInfoUser :: !(Maybe ByteString)

Enables executor and tasks to run as a specific user. If the user field is present both in FrameworkInfo and here, the CommandInfo user value takes precedence.

data Resource Source

Describes a resource on a machine. A resource can take on one of three types: scalar (double), a list of finite and discrete ranges (e.g., [1-10, 20-30]), or a set of items.

N.B. there is a slight deviation from the C++ API: the Haskell bindings convert Text values into a single element Set value in order to avoid having to expose yet another data type.

Task & Executor Status Updates

data Status Source

Indicates the state of the scheduler and executor driver after function calls.

data TaskState Source

Describes possible task states. IMPORTANT: Mesos assumes tasks that enter terminal states (see below) imply the task is no longer running and thus clean up any thing associated with the task (ultimately offering any resources being consumed by that task to another task).



Initial state. Framework status updates should not use.










newtype SlaveID Source

A unique ID assigned to a slave. Currently, a slave gets a new ID whenever it (re)registers with Mesos. Framework writers shouldn't assume any binding between a slave ID and and a hostname.



newtype OfferID Source

A unique ID assigned to an offer.



newtype TaskID Source

A framework generated ID to distinguish a task. The ID must remain unique while the task is active. However, a framework can reuse an ID _only_ if a previous task with the same ID has reached a terminal state (e.g., Finished, Lost, Killed, etc.). See isTerminal for a utility function to simplify checking task state.



newtype ExecutorID Source

A framework generated ID to distinguish an executor. Only one executor with the same ID can be active on the same slave at a time.



newtype ContainerID Source

A slave generated ID to distinguish a container. The ID must be unique between any active or completed containers on the slave. In particular, containers for different runs of the same (framework, executor) pair must be unique.



Containerization Support

data Mode Source



Mount the volume in R/W mode


Mount the volume as read-only

data ContainerType Source


Unknown Int

Not technically a container type. Represents the 'type' enum field if we get a container type that isn't Docker (e.g. from Mesos releases > 0.20)

Health Checks

Resource Usage & Performance Statistics

data ResourceStatistics Source

data ResourceUsage Source

Describes a snapshot of the resource usage for an executor.

Resource usage is for an executor. For tasks launched with an explicit executor, the executor id is provided. For tasks launched without an executor, our internal executor will be used. In this case, we provide the task id here instead, in order to make this message easier for schedulers to work with.




resourceUsageSlaveId :: !SlaveID
resourceUsageFrameworkId :: !FrameworkID
resourceUsageExecutorId :: !(Maybe ExecutorID)

If present, this executor was explicitly specified.

resourceUsageExecutorName :: !(Maybe ByteString)

If present, this executor was explicitly specified.

resourceUsageTaskId :: !(Maybe TaskID)

If present, this task did not have an executor.

resourceUsageStatistics :: !(Maybe ResourceStatistics)

If missing, the isolation module cannot provide resource usage.

data PerformanceStatistics Source




performanceStatisticsTimestamp :: !Double

Start of sample interval, in seconds since the Epoch.

performanceStatisticsDuration :: !Double

Duration of sample interval, in seconds.

performanceStatisticsCycles :: !(Maybe Word64)

Hardware events

performanceStatisticsStalledCyclesFrontend :: !(Maybe Word64)
performanceStatisticsStalledCyclesBackend :: !(Maybe Word64)
performanceStatisticsInstructions :: !(Maybe Word64)
performanceStatisticsCacheReferences :: !(Maybe Word64)
performanceStatisticsCacheMisses :: !(Maybe Word64)
performanceStatisticsBranches :: !(Maybe Word64)
performanceStatisticsBranchMisses :: !(Maybe Word64)
performanceStatisticsBusCycles :: !(Maybe Word64)
performanceStatisticsRefCycles :: !(Maybe Word64)
performanceStatisticsCpuClock :: !(Maybe Double)

Software events

performanceStatisticsTaskClock :: !(Maybe Double)
performanceStatisticsPageFaults :: !(Maybe Word64)
performanceStatisticsMinorFaults :: !(Maybe Word64)
performanceStatisticsMajorFaults :: !(Maybe Word64)
performanceStatisticsContextSwitches :: !(Maybe Word64)
performanceStatisticsCpuMigrations :: !(Maybe Word64)
performanceStatisticsAlignmentFaults :: !(Maybe Word64)
performanceStatisticsEmulationFaults :: !(Maybe Word64)
performanceStatisticsL1DcacheLoads :: !(Maybe Word64)

Hardware cache events

performanceStatisticsL1DcacheLoadMisses :: !(Maybe Word64)
performanceStatisticsL1DcacheStores :: !(Maybe Word64)
performanceStatisticsL1DcacheStoreMisses :: !(Maybe Word64)
performanceStatisticsL1DcachePrefetches :: !(Maybe Word64)
performanceStatisticsL1DcachePrefetchMisses :: !(Maybe Word64)
performanceStatisticsL1IcacheLoads :: !(Maybe Word64)
performanceStatisticsL1IcacheLoadMisses :: !(Maybe Word64)
performanceStatisticsL1IcachePrefetches :: !(Maybe Word64)
performanceStatisticsL1IcachePrefetchMisses :: !(Maybe Word64)
performanceStatisticsLlcLoads :: !(Maybe Word64)
performanceStatisticsLlcLoadMisses :: !(Maybe Word64)
performanceStatisticsLlcStores :: !(Maybe Word64)
performanceStatisticsLlcStoreMisses :: !(Maybe Word64)
performanceStatisticsLlcPrefetches :: !(Maybe Word64)
performanceStatisticsLlcPrefetchMisses :: !(Maybe Word64)
performanceStatisticsDtlbLoads :: !(Maybe Word64)
performanceStatisticsDtlbLoadMisses :: !(Maybe Word64)
performanceStatisticsDtlbStores :: !(Maybe Word64)
performanceStatisticsDtlbStoreMisses :: !(Maybe Word64)
performanceStatisticsDtlbPrefetches :: !(Maybe Word64)
performanceStatisticsDtlbPrefetchMisses :: !(Maybe Word64)
performanceStatisticsItlbLoads :: !(Maybe Word64)
performanceStatisticsItlbLoadMisses :: !(Maybe Word64)
performanceStatisticsBranchLoads :: !(Maybe Word64)
performanceStatisticsBranchLoadMisses :: !(Maybe Word64)
performanceStatisticsNodeLoads :: !(Maybe Word64)
performanceStatisticsNodeLoadMisses :: !(Maybe Word64)
performanceStatisticsNodeStores :: !(Maybe Word64)
performanceStatisticsNodeStoreMisses :: !(Maybe Word64)
performanceStatisticsNodePrefetches :: !(Maybe Word64)
performanceStatisticsNodePrefetchMisses :: !(Maybe Word64)


Eq PerformanceStatistics Source 
Show PerformanceStatistics Source 
HasTimestamp PerformanceStatistics Double Source 
HasDuration PerformanceStatistics Double Source 
HasPerformanceStatistics ResourceStatistics (Maybe PerformanceStatistics) Source 
HasTaskClock PerformanceStatistics (Maybe Double) Source 
HasStalledCyclesFrontend PerformanceStatistics (Maybe Word64) Source 
HasStalledCyclesBackend PerformanceStatistics (Maybe Word64) Source 
HasRefCycles PerformanceStatistics (Maybe Word64) Source 
HasPageFaults PerformanceStatistics (Maybe Word64) Source 
HasNodeStores PerformanceStatistics (Maybe Word64) Source 
HasNodeStoreMisses PerformanceStatistics (Maybe Word64) Source 
HasNodePrefetches PerformanceStatistics (Maybe Word64) Source 
HasNodePrefetchMisses PerformanceStatistics (Maybe Word64) Source 
HasNodeLoads PerformanceStatistics (Maybe Word64) Source 
HasNodeLoadMisses PerformanceStatistics (Maybe Word64) Source 
HasMinorFaults PerformanceStatistics (Maybe Word64) Source 
HasMajorFaults PerformanceStatistics (Maybe Word64) Source 
HasLlcStores PerformanceStatistics (Maybe Word64) Source 
HasLlcStoreMisses PerformanceStatistics (Maybe Word64) Source 
HasLlcPrefetches PerformanceStatistics (Maybe Word64) Source 
HasLlcPrefetchMisses PerformanceStatistics (Maybe Word64) Source 
HasLlcLoads PerformanceStatistics (Maybe Word64) Source 
HasLlcLoadMisses PerformanceStatistics (Maybe Word64) Source 
HasL1IcachePrefetches PerformanceStatistics (Maybe Word64) Source 
HasL1IcachePrefetchMisses PerformanceStatistics (Maybe Word64) Source 
HasL1IcacheLoads PerformanceStatistics (Maybe Word64) Source 
HasL1IcacheLoadMisses PerformanceStatistics (Maybe Word64) Source 
HasL1DcacheStores PerformanceStatistics (Maybe Word64) Source 
HasL1DcacheStoreMisses PerformanceStatistics (Maybe Word64) Source 
HasL1DcachePrefetches PerformanceStatistics (Maybe Word64) Source 
HasL1DcachePrefetchMisses PerformanceStatistics (Maybe Word64) Source 
HasL1DcacheLoads PerformanceStatistics (Maybe Word64) Source 
HasL1DcacheLoadMisses PerformanceStatistics (Maybe Word64) Source 
HasItlbLoads PerformanceStatistics (Maybe Word64) Source 
HasItlbLoadMisses PerformanceStatistics (Maybe Word64) Source 
HasInstructions PerformanceStatistics (Maybe Word64) Source 
HasEmulationFaults PerformanceStatistics (Maybe Word64) Source 
HasDtlbStores PerformanceStatistics (Maybe Word64) Source 
HasDtlbStoreMisses PerformanceStatistics (Maybe Word64) Source 
HasDtlbPrefetches PerformanceStatistics (Maybe Word64) Source 
HasDtlbPrefetchMisses PerformanceStatistics (Maybe Word64) Source 
HasDtlbLoads PerformanceStatistics (Maybe Word64) Source 
HasDtlbLoadMisses PerformanceStatistics (Maybe Word64) Source 
HasCycles PerformanceStatistics (Maybe Word64) Source 
HasCpuMigrations PerformanceStatistics (Maybe Word64) Source 
HasCpuClock PerformanceStatistics (Maybe Double) Source 
HasContextSwitches PerformanceStatistics (Maybe Word64) Source 
HasCacheReferences PerformanceStatistics (Maybe Word64) Source 
HasCacheMisses PerformanceStatistics (Maybe Word64) Source 
HasBusCycles PerformanceStatistics (Maybe Word64) Source 
HasBranches PerformanceStatistics (Maybe Word64) Source 
HasBranchMisses PerformanceStatistics (Maybe Word64) Source 
HasBranchLoads PerformanceStatistics (Maybe Word64) Source 
HasBranchLoadMisses PerformanceStatistics (Maybe Word64) Source 
HasAlignmentFaults PerformanceStatistics (Maybe Word64) Source 

Task Status

Credentials & ACLs

data Credential Source

Credential used for authentication.

NOTE: credentialPrincipal is used for authenticating the framework with the master. This is different from frameworkUser which is used to determine the user under which the framework's executors/tasks are run.