framework

package
v0.0.0-...-f9069c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFrameworkMaster  = "127.0.0.1:5050"
	DefaultFrameworkName    = "gonsumer"
	DefaultFrameworkRole    = "*"
	DefaultFrameworkTimeout = 365 * 24 * time.Hour
	DefaultFrameworkStorage = "file:/tmp/gonsumer.json"
)
View Source
const (
	ParamGroupID          = "group-id"
	ParamSubscription     = "subscription"
	ParamBootstrapBrokers = "bootstrap-brokers"
)

Variables

View Source
var (
	ErrGroupIDRequired = errors.New("Missing required parameter " + ParamGroupID)
	ErrGroupExists     = errors.New("Group already exists")
	ErrInternal        = errors.New("An error occurred")
)
View Source
var ErrEmptyZPath = errors.New("Specified blank path")
View Source
var ErrStorageUninitialized = errors.New("Storage is uninitialized")
View Source
var ErrUnsupportedStorage = errors.New("Unsupported storage")

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	SetFrameworkID(id string)
	GetFrameworkID() string

	AddGroup(group *Group)
	GetGroup(id string) *Group
	ExistsGroup(id string) bool
	GetGroups() []*Group
}

type Consumer

type Consumer struct {
	ID string `json:"id"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

func NewErrorResponse

func NewErrorResponse(msg string) *ErrorResponse

type FileStorage

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

func NewFileStorage

func NewFileStorage(file string) *FileStorage

func (*FileStorage) Load

func (fs *FileStorage) Load() ([]byte, error)

func (*FileStorage) Save

func (fs *FileStorage) Save(contents []byte) error

func (*FileStorage) String

func (fs *FileStorage) String() string

type Framework

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

func New

func New(config GonsumerFrameworkConfig) (*Framework, error)

func (*Framework) Start

func (f *Framework) Start() error

type GonsumerCluster

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

func NewGonsumerCluster

func NewGonsumerCluster() *GonsumerCluster

func (*GonsumerCluster) AddGroup

func (c *GonsumerCluster) AddGroup(group *Group)

func (*GonsumerCluster) ExistsGroup

func (c *GonsumerCluster) ExistsGroup(id string) bool

func (*GonsumerCluster) GetFrameworkID

func (c *GonsumerCluster) GetFrameworkID() string

func (*GonsumerCluster) GetGroup

func (c *GonsumerCluster) GetGroup(id string) *Group

func (*GonsumerCluster) GetGroups

func (c *GonsumerCluster) GetGroups() []*Group

func (*GonsumerCluster) MarshalJSON

func (c *GonsumerCluster) MarshalJSON() ([]byte, error)

func (*GonsumerCluster) SetFrameworkID

func (c *GonsumerCluster) SetFrameworkID(id string)

func (*GonsumerCluster) UnmarshalJSON

func (c *GonsumerCluster) UnmarshalJSON(bytes []byte) error

type GonsumerFrameworkConfig

type GonsumerFrameworkConfig struct {
	Api              string
	Master           string
	FrameworkName    string
	FrameworkRole    string
	FrameworkStorage string
	FrameworkTimeout time.Duration
	User             string
	BindIP           string
}

func NewConfig

func NewConfig() GonsumerFrameworkConfig

type GonsumerScheduler

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

func NewScheduler

func NewScheduler(storage Storage) (*GonsumerScheduler, error)

func (*GonsumerScheduler) Cluster

func (s *GonsumerScheduler) Cluster() Cluster

func (*GonsumerScheduler) Disconnected

func (s *GonsumerScheduler) Disconnected(scheduler.SchedulerDriver)

func (*GonsumerScheduler) Error

func (s *GonsumerScheduler) Error(driver scheduler.SchedulerDriver, err string)

func (*GonsumerScheduler) ExecutorLost

func (s *GonsumerScheduler) ExecutorLost(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, status int)

func (*GonsumerScheduler) FrameworkMessage

func (s *GonsumerScheduler) FrameworkMessage(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, message string)

func (*GonsumerScheduler) LoadClusterState

func (s *GonsumerScheduler) LoadClusterState() error

func (*GonsumerScheduler) OfferRescinded

func (s *GonsumerScheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID)

func (*GonsumerScheduler) Registered

func (s *GonsumerScheduler) Registered(driver scheduler.SchedulerDriver, id *mesos.FrameworkID, master *mesos.MasterInfo)

func (*GonsumerScheduler) Reregistered

func (s *GonsumerScheduler) Reregistered(driver scheduler.SchedulerDriver, master *mesos.MasterInfo)

func (*GonsumerScheduler) ResourceOffers

func (s *GonsumerScheduler) ResourceOffers(driver scheduler.SchedulerDriver, offers []*mesos.Offer)

func (*GonsumerScheduler) SaveClusterState

func (s *GonsumerScheduler) SaveClusterState() error

func (*GonsumerScheduler) Shutdown

func (s *GonsumerScheduler) Shutdown(driver scheduler.SchedulerDriver)

func (*GonsumerScheduler) SlaveLost

func (s *GonsumerScheduler) SlaveLost(driver scheduler.SchedulerDriver, slave *mesos.SlaveID)

func (*GonsumerScheduler) StatusUpdate

func (s *GonsumerScheduler) StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus)

type Group

type Group struct {
	ID               string   `json:"id"`
	Subscriptions    []string `json:"subscriptions"`
	BootstrapBrokers []string `json:"bootstrap_brokers"`

	Consumers []*Consumer `json:"consumers"`
}

type HTTPServer

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

func NewHttpServer

func NewHttpServer(address string, scheduler Scheduler) *HTTPServer

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

type Reconciler

type Reconciler struct {
	ReconcileDelay    time.Duration
	ReconcileMaxTries int
	// contains filtered or unexported fields
}

func NewReconciler

func NewReconciler() *Reconciler

func (*Reconciler) ExplicitReconcile

func (r *Reconciler) ExplicitReconcile(taskIDs []string, driver scheduler.SchedulerDriver) error

func (*Reconciler) ImplicitReconcile

func (r *Reconciler) ImplicitReconcile(driver scheduler.SchedulerDriver) error

func (*Reconciler) Update

func (r *Reconciler) Update(status *mesos.TaskStatus)

type Scheduler

type Scheduler interface {
	Cluster() Cluster
}

type Server

type Server interface {
	Start() error
}

type Storage

type Storage interface {
	Save([]byte) error
	Load() ([]byte, error)
}

func NewStorage

func NewStorage(storage string) (Storage, error)

type ZKStorage

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

func NewZKStorage

func NewZKStorage(zk string) (*ZKStorage, error)

func (*ZKStorage) Load

func (zs *ZKStorage) Load() ([]byte, error)

func (*ZKStorage) Save

func (zs *ZKStorage) Save(contents []byte) error

func (*ZKStorage) String

func (zs *ZKStorage) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL