gorealis: github.com/paypal/gorealis Index | Files | Directories

package realis

import "github.com/paypal/gorealis"

Package realis provides the ability to use Thrift API to communicate with Apache Aurora.

Index

Package Files

clusters.go container.go errors.go job.go logger.go monitors.go realis.go realis_admin.go retry.go updatejob.go util.go zk.go

Constants

const (
    CPU resourceType = iota
    RAM
    DISK
    GPU
)

Variables

var ActiveJobUpdateStates = make(map[aurora.JobUpdateStatus]bool)

ActiveJobUpdateStates - States a Job Update may be in where it is considered active.

var ActiveStates = make(map[aurora.ScheduleStatus]bool)

ActiveStates - States a task may be in when active.

var AwaitingPulseJobUpdateStates = make(map[aurora.JobUpdateStatus]bool)

AwaitingPulseJobUpdateStates - States a job update may be in where it is waiting for a pulse.

var LiveStates = make(map[aurora.ScheduleStatus]bool)

LiveStates - States a task may be in when it is live (e.g. able to take traffic)

var SlaveAssignedStates = make(map[aurora.ScheduleStatus]bool)

SlaveAssignedStates - States a task may be in when it has already been assigned to a Mesos agent.

var TerminalStates = make(map[aurora.ScheduleStatus]bool)

TerminalStates - Set of states a task may not transition away from.

func ExponentialBackoff Uses

func ExponentialBackoff(backoff Backoff, logger logger, condition ConditionFunc) error

ExponentialBackoff is a modified version of the Kubernetes exponential-backoff code. It repeats a condition check with exponential backoff and checks the condition up to Steps times, increasing the wait by multiplying the previous duration by Factor.

If Jitter is greater than zero, a random amount of each duration is added (between duration and duration*(1+jitter)).

If the condition never returns true, ErrWaitTimeout is returned. Errors do not cause the function to return.

func IsTemporary Uses

func IsTemporary(err error) bool

IsTemporary indicates whether the error passed in as an argument implements the temporary interface and if the Temporary function returns true.

func IsTimeout Uses

func IsTimeout(err error) bool

IsTimeout returns true if the error being passed as an argument implements the Timeout interface and the Timedout function returns true.

func Jitter Uses

func Jitter(duration time.Duration, maxFactor float64) time.Duration

Jitter returns a time.Duration between duration and duration + maxFactor * duration.

This allows clients to avoid converging on periodic behavior. If maxFactor is 0.0, a suggested default value will be chosen.

func LeaderFromZK Uses

func LeaderFromZK(cluster Cluster) (string, error)

LeaderFromZK - Retrieves current Aurora leader from ZK.

func LeaderFromZKOpts Uses

func LeaderFromZKOpts(options ...ZKOpt) (string, error)

LeaderFromZKOpts - Retrieves current Aurora leader from ZK with a custom configuration.

func LoadClusters Uses

func LoadClusters(config string) (map[string]Cluster, error)

LoadClusters loads clusters.json file traditionally located at /etc/aurora/clusters.json for use with a gorealis client

func NewTemporaryError Uses

func NewTemporaryError(err error) *temporaryErr

NewTemporaryError creates a new error which satisfies the Temporary interface.

func NewUpdateSettings Uses

func NewUpdateSettings() *aurora.JobUpdateSettings

NewUpdateSettings return an opinionated set of job update settings.

func ToRetryCount Uses

func ToRetryCount(err error) *retryErr

ToRetryCount is a helper function for testing verification to avoid whitebox testing as well as keeping retryErr as a private. Should NOT be used under any other context.

type AuroraJob Uses

type AuroraJob struct {
    // contains filtered or unexported fields
}

AuroraJob is a structure to collect all information pertaining to an Aurora job.

func (*AuroraJob) AddDedicatedConstraint Uses

func (j *AuroraJob) AddDedicatedConstraint(role, name string) Job

AddDedicatedConstraint allows the user to add a dedicated constraint to a Job configuration.

func (*AuroraJob) AddLabel Uses

func (j *AuroraJob) AddLabel(key string, value string) Job

AddLabel adds a Mesos label to the job. Note that Aurora will add the prefix "org.apache.aurora.metadata." to the beginning of each key.

func (*AuroraJob) AddLimitConstraint Uses

func (j *AuroraJob) AddLimitConstraint(name string, limit int32) Job

AddLimitConstraint allows the user to limit how many tasks form the same Job are run on a single host. From Aurora Docs: A constraint that specifies the maximum number of active tasks on a host with a matching attribute that may be scheduled simultaneously.

func (*AuroraJob) AddNamedPorts Uses

func (j *AuroraJob) AddNamedPorts(names ...string) Job

AddNamedPorts adds a named port to the job configuration These are random ports as it's not currently possible to request specific ports using Aurora.

func (*AuroraJob) AddPorts Uses

func (j *AuroraJob) AddPorts(num int) Job

AddPorts adds a request for a number of ports to the job configuration. The names chosen for these ports will be org.apache.aurora.port.X, where X is the current port count for the job configuration starting at 0. These are random ports as it's not currently possible to request specific ports using Aurora.

func (*AuroraJob) AddURIs Uses

func (j *AuroraJob) AddURIs(extract bool, cache bool, values ...string) Job

AddURIs adds a list of URIs with the same extract and cache configuration. Scheduler must have --enable_mesos_fetcher flag enabled. Currently there is no duplicate detection.

func (*AuroraJob) AddValueConstraint Uses

func (j *AuroraJob) AddValueConstraint(name string, negated bool, values ...string) Job

AddValueConstraint allows the user to add a value constrain to the job to limiti which agents the job's tasks can be run on. From Aurora Docs: Add a Value constraint name - Mesos slave attribute that the constraint is matched against. If negated = true , treat this as a 'not' - to avoid specific values. Values - list of values we look for in attribute name

func (*AuroraJob) CPU Uses

func (j *AuroraJob) CPU(cpus float64) Job

CPU sets the amount of CPU each task will use in an Aurora Job.

func (*AuroraJob) Container Uses

func (j *AuroraJob) Container(container Container) Job

Container sets a container to run for the job configuration to run.

func (*AuroraJob) CronCollisionPolicy Uses

func (j *AuroraJob) CronCollisionPolicy(policy aurora.CronCollisionPolicy) Job

CronCollisionPolicy allows the user to decide what happens if two or more instances of the same Cron job need to run.

func (*AuroraJob) CronSchedule Uses

func (j *AuroraJob) CronSchedule(cron string) Job

CronSchedule allows the user to configure a cron schedule for this job to run in.

func (*AuroraJob) Disk Uses

func (j *AuroraJob) Disk(disk int64) Job

Disk sets the amount of Disk each task will use in an Aurora Job.

func (*AuroraJob) Environment Uses

func (j *AuroraJob) Environment(env string) Job

Environment sets the Job Key environment.

func (*AuroraJob) ExecutorData Uses

func (j *AuroraJob) ExecutorData(data string) Job

ExecutorData sets the data blob that will be passed to the Mesos executor.

func (*AuroraJob) ExecutorName Uses

func (j *AuroraJob) ExecutorName(name string) Job

ExecutorName sets the name of the executor that will the task will be configured to.

func (*AuroraJob) GPU Uses

func (j *AuroraJob) GPU(gpu int64) Job

GPU sets the amount of GPU each task will use in an Aurora Job.

func (*AuroraJob) GetInstanceCount Uses

func (j *AuroraJob) GetInstanceCount() int32

GetInstanceCount returns how many tasks this Job contains.

func (*AuroraJob) InstanceCount Uses

func (j *AuroraJob) InstanceCount(instCount int32) Job

InstanceCount sets how many instances of the task to run for this Job.

func (*AuroraJob) IsService Uses

func (j *AuroraJob) IsService(isService bool) Job

IsService returns true if the job is a long term running job or false if it is an ad-hoc job.

func (*AuroraJob) JobConfig Uses

func (j *AuroraJob) JobConfig() *aurora.JobConfiguration

JobConfig returns the job's configuration.

func (*AuroraJob) JobKey Uses

func (j *AuroraJob) JobKey() *aurora.JobKey

JobKey returns the job's configuration key.

func (*AuroraJob) MaxFailure Uses

func (j *AuroraJob) MaxFailure(maxFail int32) Job

MaxFailure sets how many failures to tolerate before giving up per Job.

func (*AuroraJob) Name Uses

func (j *AuroraJob) Name(name string) Job

Name sets the Job Key Name.

func (*AuroraJob) PartitionPolicy Uses

func (j *AuroraJob) PartitionPolicy(policy *aurora.PartitionPolicy) Job

PartitionPolicy sets a partition policy for the job configuration to implement.

func (*AuroraJob) RAM Uses

func (j *AuroraJob) RAM(ram int64) Job

RAM sets the amount of RAM each task will use in an Aurora Job.

func (*AuroraJob) Role Uses

func (j *AuroraJob) Role(role string) Job

Role sets the Job Key role.

func (*AuroraJob) SlaPolicy Uses

func (j *AuroraJob) SlaPolicy(policy *aurora.SlaPolicy) Job

SlaPolicy sets an SlaPolicy for the Job.

func (*AuroraJob) TaskConfig Uses

func (j *AuroraJob) TaskConfig() *aurora.TaskConfig

TaskConfig returns the job's task(shard) configuration.

func (*AuroraJob) Tier Uses

func (j *AuroraJob) Tier(tier string) Job

Tier sets the Tier for the Job.

type Backoff Uses

type Backoff struct {
    Duration time.Duration // the base duration
    Factor   float64       // Duration is multiplied by a factor each iteration
    Jitter   float64       // The amount of jitter applied each iteration
    Steps    int           // Exit with error after this many steps
}

Backoff determines how the retry mechanism should react after each failure and how many failures it should tolerate.

type ClientOption Uses

type ClientOption func(*config)

ClientOption is an alias for a function that modifies the realis config object

func BackOff Uses

func BackOff(b Backoff) ClientOption

BackOff is an alternative name for the Retry mechanism configuration.

func BasicAuth Uses

func BasicAuth(username, password string) ClientOption

BasicAuth sets authentication used against Apache Shiro in the Aurora scheduler

func Certspath Uses

func Certspath(certspath string) ClientOption

Certspath sets the directory where the server certificates to be used when connecting to an SSL enabled Aurora scheduler are stored.

func ClientCerts Uses

func ClientCerts(clientKey, clientCert string) ClientOption

ClientCerts allows users to set client key and certificate when connecting to an SSL enabled Aurora scheduler.

func Debug Uses

func Debug() ClientOption

Debug enables debug statements in the client.

func FailOnPermanentErrors Uses

func FailOnPermanentErrors() ClientOption

FailOnPermanentErrors allows the client to stop upon encountering a connection error the standard library considers permanent and return an error to the user.

func InsecureSkipVerify Uses

func InsecureSkipVerify(insecureSkipVerify bool) ClientOption

InsecureSkipVerify configures the client to not check for matching hosts names on certificates when using an SSL enabled Aurora scheduler.

func Retries Uses

func Retries(backoff Backoff) ClientOption

Retries configures the retry mechanism for the client

func SchedulerUrl Uses

func SchedulerUrl(url string) ClientOption

SchedulerUrl sets the immediate location of the current Aurora scheduler leader

func SetLogger Uses

func SetLogger(l logger) ClientOption

SetLogger allows the user to attach a logger that implements the logger interface in logger.go to the client.

func ThriftBinary Uses

func ThriftBinary() ClientOption

ThriftBinary configures the client to use the Thrift Binary protocol.

func ThriftJSON Uses

func ThriftJSON() ClientOption

ThriftJSON configures the client to use the Thrift JSON protocol.

func TimeoutMS Uses

func TimeoutMS(timeout int) ClientOption

TimeoutMS sets the connection timeout for an HTTP post request in Miliseconds

func Trace Uses

func Trace() ClientOption

Trace enables debug statements in the client.

func ZKCluster Uses

func ZKCluster(cluster *Cluster) ClientOption

ZKCluster sets a clusters.json provided cluster configuration to the client

func ZKUrl Uses

func ZKUrl(url string) ClientOption

ZKUrl sets the direct location of a Zookeeper node on which the Aurora leader registers itself

func ZookeeperOptions Uses

func ZookeeperOptions(opts ...ZKOpt) ClientOption

ZookeeperOptions allows users to override default settings for connecting to Zookeeper. See zk.go for what is possible to set as an option.

type Cluster Uses

type Cluster struct {
    Name          string `json:"name"`
    AgentRoot     string `json:"slave_root"`
    AgentRunDir   string `json:"slave_run_directory"`
    ZK            string `json:"zk"`
    ZKPort        int    `json:"zk_port"`
    SchedZKPath   string `json:"scheduler_zk_path"`
    SchedURI      string `json:"scheduler_uri"`
    ProxyURL      string `json:"proxy_url"`
    AuthMechanism string `json:"auth_mechanism"`
}

Cluster contains the definition of the clusters.json file used by the default Aurora client for configuration

func GetDefaultClusterFromZKUrl Uses

func GetDefaultClusterFromZKUrl(zkurl string) *Cluster

GetDefaultClusterFromZKUrl creates a cluster object from a Zoookeper url. This is deprecated in favor of using Zookeeper options.

type ConditionFunc Uses

type ConditionFunc func() (done bool, err error)

ConditionFunc returns true if the condition is satisfied, or an error if the loop should be aborted.

type Container Uses

type Container interface {
    Build() *aurora.Container
}

Container is an interface that defines a single function needed to create an Aurora container type. It exists because the code must support both Mesos and Docker containers.

type DockerContainer Uses

type DockerContainer struct {
    // contains filtered or unexported fields
}

DockerContainer is a vanilla Docker style container that can be used by Aurora Jobs.

func NewDockerContainer Uses

func NewDockerContainer() DockerContainer

NewDockerContainer creates a new Aurora compatible Docker container configuration.

func (DockerContainer) AddParameter Uses

func (c DockerContainer) AddParameter(name, value string) DockerContainer

AddParameter adds a parameter to be passed to Docker when the container is run.

func (DockerContainer) Build Uses

func (c DockerContainer) Build() *aurora.Container

Build creates an Aurora container based upon the configuration provided.

func (DockerContainer) Image Uses

func (c DockerContainer) Image(image string) DockerContainer

Image adds the name of a Docker image to be used by the Job when running.

type Job Uses

type Job interface {
    // Set Job Key environment.
    Environment(env string) Job
    Role(role string) Job
    Name(name string) Job
    CronSchedule(cron string) Job
    CronCollisionPolicy(policy aurora.CronCollisionPolicy) Job
    CPU(cpus float64) Job
    Disk(disk int64) Job
    RAM(ram int64) Job
    GPU(gpu int64) Job
    ExecutorName(name string) Job
    ExecutorData(data string) Job
    AddPorts(num int) Job
    AddLabel(key string, value string) Job
    AddNamedPorts(names ...string) Job
    AddLimitConstraint(name string, limit int32) Job
    AddValueConstraint(name string, negated bool, values ...string) Job

    // From Aurora Docs:
    // dedicated attribute. Aurora treats this specially, and only allows matching jobs
    // to run on these machines, and will only schedule matching jobs on these machines.
    // When a job is created, the scheduler requires that the $role component matches
    // the role field in the job configuration, and will reject the job creation otherwise.
    // A wildcard (*) may be used for the role portion of the dedicated attribute, which
    // will allow any owner to elect for a job to run on the host(s)
    AddDedicatedConstraint(role, name string) Job
    AddURIs(extract bool, cache bool, values ...string) Job
    JobKey() *aurora.JobKey
    JobConfig() *aurora.JobConfiguration
    TaskConfig() *aurora.TaskConfig
    IsService(isService bool) Job
    InstanceCount(instCount int32) Job
    GetInstanceCount() int32
    MaxFailure(maxFail int32) Job
    Container(container Container) Job
    PartitionPolicy(policy *aurora.PartitionPolicy) Job
    Tier(tier string) Job
    SlaPolicy(policy *aurora.SlaPolicy) Job
}

Job inteface is used to define a set of functions an Aurora Job object must implemement. TODO(rdelvalle): Consider getting rid of the Job interface

func NewJob Uses

func NewJob() Job

NewJob is used to create a Job object with everything initialized.

type LevelLogger Uses

type LevelLogger struct {
    // contains filtered or unexported fields
}

LevelLogger is a logger that can be configured to output different levels of information: Debug and Trace. Trace should only be enabled when very in depth information about the sequence of events a function took is needed.

func (*LevelLogger) EnableDebug Uses

func (l *LevelLogger) EnableDebug(enable bool)

EnableDebug enables debug level logging for the LevelLogger

func (*LevelLogger) EnableTrace Uses

func (l *LevelLogger) EnableTrace(enable bool)

EnableTrace enables trace level logging for the LevelLogger

type MesosContainer Uses

type MesosContainer struct {
    // contains filtered or unexported fields
}

MesosContainer is a Mesos style container that can be used by Aurora Jobs.

func NewMesosContainer Uses

func NewMesosContainer() MesosContainer

NewMesosContainer creates a Mesos style container to be configured and built for use by an Aurora Job.

func (MesosContainer) AppcImage Uses

func (c MesosContainer) AppcImage(name, imageID string) MesosContainer

AppcImage configures the Mesos container to use an image in the Appc format to run the container.

func (MesosContainer) Build Uses

func (c MesosContainer) Build() *aurora.Container

Build creates a Mesos style Aurora container configuration to be passed on to the Aurora Job.

func (MesosContainer) DockerImage Uses

func (c MesosContainer) DockerImage(name, tag string) MesosContainer

DockerImage configures the Mesos container to use a specific Docker image when being run.

type Monitor Uses

type Monitor struct {
    Client Realis
}

Monitor is a wrapper for the Realis client which allows us to have functions with the same name for Monitoring purposes. TODO(rdelvalle): Deprecate monitors and instead add prefix Monitor to all functions in this file like it is done in V2.

func (*Monitor) HostMaintenance Uses

func (m *Monitor) HostMaintenance(
    hosts []string,
    modes []aurora.MaintenanceMode,
    interval, timeout int) (map[string]bool, error)

HostMaintenance will monitor host status until all hosts match the status provided. Returns a map where the value is true if the host is in one of the desired mode(s) or false if it is not as of the time when the monitor exited.

func (*Monitor) Instances Uses

func (m *Monitor) Instances(
    key *aurora.JobKey,
    instances int32,
    interval, timeout int) (bool, error)

Instances will monitor a Job until all instances enter one of the LIVE_STATES

func (*Monitor) JobUpdate Uses

func (m *Monitor) JobUpdate(
    updateKey aurora.JobUpdateKey,
    interval int,
    timeout int) (bool, error)

JobUpdate polls the scheduler every certain amount of time to see if the update has entered a terminal state.

func (*Monitor) JobUpdateQuery Uses

func (m *Monitor) JobUpdateQuery(
    updateQuery aurora.JobUpdateQuery,
    interval time.Duration,
    timeout time.Duration) ([]*aurora.JobUpdateSummary, error)

JobUpdateQuery polls the scheduler every certain amount of time to see if the query call returns any results.

func (*Monitor) JobUpdateStatus Uses

func (m *Monitor) JobUpdateStatus(
    updateKey aurora.JobUpdateKey,
    desiredStatuses map[aurora.JobUpdateStatus]bool,
    interval time.Duration,
    timeout time.Duration) (aurora.JobUpdateStatus, error)

JobUpdateStatus polls the scheduler every certain amount of time to see if the update has entered a specified state.

func (*Monitor) ScheduleStatus Uses

func (m *Monitor) ScheduleStatus(
    key *aurora.JobKey,
    instanceCount int32,
    desiredStatuses map[aurora.ScheduleStatus]bool,
    interval int,
    timeout int) (bool, error)

ScheduleStatus will monitor a Job until all instances enter a desired status. Defaults sets of desired statuses provided by the thrift API include: ACTIVE_STATES, SLAVE_ASSIGNED_STATES, LIVE_STATES, and TERMINAL_STATES

type NoopLogger Uses

type NoopLogger struct{}

NoopLogger is a logger that can be attached to the client which will not print anything.

func (NoopLogger) Print Uses

func (NoopLogger) Print(a ...interface{})

Print is a NOOP function here.

func (NoopLogger) Printf Uses

func (NoopLogger) Printf(format string, a ...interface{})

Printf is a NOOP function here.

func (NoopLogger) Println Uses

func (NoopLogger) Println(a ...interface{})

Println is a NOOP function here.

type Realis Uses

type Realis interface {
    AbortJobUpdate(updateKey aurora.JobUpdateKey, message string) (*aurora.Response, error)
    AddInstances(instKey aurora.InstanceKey, count int32) (*aurora.Response, error)
    CreateJob(auroraJob Job) (*aurora.Response, error)
    CreateService(
        auroraJob Job,
        settings *aurora.JobUpdateSettings) (*aurora.Response, *aurora.StartJobUpdateResult_, error)
    DescheduleCronJob(key *aurora.JobKey) (*aurora.Response, error)
    FetchTaskConfig(instKey aurora.InstanceKey) (*aurora.TaskConfig, error)
    GetInstanceIds(key *aurora.JobKey, states []aurora.ScheduleStatus) ([]int32, error)
    GetJobUpdateSummaries(jobUpdateQuery *aurora.JobUpdateQuery) (*aurora.Response, error)
    GetTaskStatus(query *aurora.TaskQuery) ([]*aurora.ScheduledTask, error)
    GetTasksWithoutConfigs(query *aurora.TaskQuery) ([]*aurora.ScheduledTask, error)
    GetJobs(role string) (*aurora.Response, *aurora.GetJobsResult_, error)
    GetPendingReason(query *aurora.TaskQuery) (pendingReasons []*aurora.PendingReason, e error)
    JobUpdateDetails(updateQuery aurora.JobUpdateQuery) (*aurora.Response, error)
    KillJob(key *aurora.JobKey) (*aurora.Response, error)
    KillInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error)
    RemoveInstances(key *aurora.JobKey, count int32) (*aurora.Response, error)
    RestartInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error)
    RestartJob(key *aurora.JobKey) (*aurora.Response, error)
    RollbackJobUpdate(key aurora.JobUpdateKey, message string) (*aurora.Response, error)
    ScheduleCronJob(auroraJob Job) (*aurora.Response, error)
    StartJobUpdate(updateJob *UpdateJob, message string) (*aurora.Response, error)

    PauseJobUpdate(key *aurora.JobUpdateKey, message string) (*aurora.Response, error)
    ResumeJobUpdate(key *aurora.JobUpdateKey, message string) (*aurora.Response, error)
    PulseJobUpdate(key *aurora.JobUpdateKey) (*aurora.Response, error)
    StartCronJob(key *aurora.JobKey) (*aurora.Response, error)
    // TODO: Remove this method and make it private to avoid race conditions
    ReestablishConn() error
    RealisConfig() *config
    Close()

    // Admin functions
    DrainHosts(hosts ...string) (*aurora.Response, *aurora.DrainHostsResult_, error)
    SLADrainHosts(policy *aurora.SlaPolicy, timeout int64, hosts ...string) (*aurora.DrainHostsResult_, error)
    StartMaintenance(hosts ...string) (*aurora.Response, *aurora.StartMaintenanceResult_, error)
    EndMaintenance(hosts ...string) (*aurora.Response, *aurora.EndMaintenanceResult_, error)
    MaintenanceStatus(hosts ...string) (*aurora.Response, *aurora.MaintenanceStatusResult_, error)
    SetQuota(role string, cpu *float64, ram *int64, disk *int64) (*aurora.Response, error)
    GetQuota(role string) (*aurora.Response, error)
    Snapshot() error
    PerformBackup() error
    // Force an Implicit reconciliation between Mesos and Aurora
    ForceImplicitTaskReconciliation() error
    // Force an Explicit reconciliation between Mesos and Aurora
    ForceExplicitTaskReconciliation(batchSize *int32) error
}

Realis is an interface that defines the various APIs that may be used to communicate with the Apache Aurora scheduler. TODO(rdelvalle): Move documentation to interface in order to make godoc look better accessible Or get rid of the interface

func NewRealisClient Uses

func NewRealisClient(options ...ClientOption) (Realis, error)

NewRealisClient is a client implementation of the realis interface uses a retry mechanism for all Thrift Calls. It will retry all calls which result in a temporary failure as well as calls that fail due to an EOF being returned by the http client. Most permanent failures are now being caught by the thriftCallWithRetries function and not being retried but there may be corner cases not yet handled.

type UpdateJob Uses

type UpdateJob struct {
    Job // SetInstanceCount for job is hidden, access via full qualifier
    // contains filtered or unexported fields
}

UpdateJob is a structure to collect all information required to create job update.

func NewDefaultUpdateJob Uses

func NewDefaultUpdateJob(config *aurora.TaskConfig) *UpdateJob

NewDefaultUpdateJob creates an UpdateJob object with opinionated default settings.

func NewUpdateJob Uses

func NewUpdateJob(config *aurora.TaskConfig, settings *aurora.JobUpdateSettings) *UpdateJob

NewUpdateJob creates an UpdateJob object wihtout default settings.

func (*UpdateJob) BatchSize Uses

func (u *UpdateJob) BatchSize(size int32) *UpdateJob

BatchSize sets the max number of instances being updated at any given moment.

func (*UpdateJob) InstanceCount Uses

func (u *UpdateJob) InstanceCount(inst int32) *UpdateJob

InstanceCount sets instance count the job will have after the update.

func (*UpdateJob) MaxFailedInstances Uses

func (u *UpdateJob) MaxFailedInstances(inst int32) *UpdateJob

MaxFailedInstances sets the max number of FAILED instances to tolerate before terminating the update.

func (*UpdateJob) MaxPerInstanceFailures Uses

func (u *UpdateJob) MaxPerInstanceFailures(inst int32) *UpdateJob

MaxPerInstanceFailures sets the max number of instance failures to tolerate before marking instance as FAILED.

func (*UpdateJob) RollbackOnFail Uses

func (u *UpdateJob) RollbackOnFail(rollback bool) *UpdateJob

RollbackOnFail configure the job to rollback automatically after a job update fails.

func (*UpdateJob) WaitForBatchCompletion Uses

func (u *UpdateJob) WaitForBatchCompletion(batchWait bool) *UpdateJob

WaitForBatchCompletion configures the job update to wait for all instances in a group to be done before moving on.

func (*UpdateJob) WatchTime Uses

func (u *UpdateJob) WatchTime(ms int32) *UpdateJob

WatchTime sets the minimum number of seconds a shard must remain in RUNNING state before considered a success.

type ZKOpt Uses

type ZKOpt func(z *zkConfig)

ZKOpt - Configuration option for the Zookeeper client used.

func ZKBackoff Uses

func ZKBackoff(b Backoff) ZKOpt

ZKBackoff - Configuration for Retry mechanism used when connecting to Zookeeper. TODO(rdelvalle): Determine if this is really necessary as the ZK library already has a retry built in.

func ZKEndpoints Uses

func ZKEndpoints(endpoints ...string) ZKOpt

ZKEndpoints - Endpoints on which a Zookeeper instance is running to be used by the client.

func ZKLogger Uses

func ZKLogger(l logger) ZKOpt

ZKLogger - Attach a logger to the Zookeeper client in order to debug issues.

func ZKPath Uses

func ZKPath(path string) ZKOpt

ZKPath - Path to look for information in when connected to Zookeeper.

func ZKTimeout Uses

func ZKTimeout(d time.Duration) ZKOpt

ZKTimeout - How long to wait on a response from the Zookeeper instance before considering it dead.

Directories

PathSynopsis
examples
gen-go/apache/aurora
gen-go/apache/aurora/aurora_admin-remote
gen-go/apache/aurora/aurora_scheduler_manager-remote
gen-go/apache/aurora/read_only_scheduler-remote
responseHelper functions to process aurora.Response

Package realis imports 24 packages (graph) and is imported by 3 packages. Updated 2019-06-12. Refresh now. Tools for package owners.