Documentation ¶
Index ¶
- type Matcher
- type RecoveryHandler
- type Server
- type ServiceHandler
- func (h *ServiceHandler) AcquireHostOffers(ctx context.Context, body *hostsvc.AcquireHostOffersRequest) (response *hostsvc.AcquireHostOffersResponse, err error)
- func (h *ServiceHandler) CancelWatchEvent(ctx context.Context, req *hostsvc.CancelWatchRequest) (*hostsvc.CancelWatchResponse, error)
- func (h *ServiceHandler) ClusterCapacity(ctx context.Context, body *hostsvc.ClusterCapacityRequest) (response *hostsvc.ClusterCapacityResponse, err error)
- func (h *ServiceHandler) CreateVolumes(ctx context.Context, body *hostsvc.CreateVolumesRequest) (*hostsvc.CreateVolumesResponse, error)
- func (h *ServiceHandler) DestroyVolumes(ctx context.Context, body *hostsvc.DestroyVolumesRequest) (*hostsvc.DestroyVolumesResponse, error)
- func (h *ServiceHandler) DisableKillTasks(ctx context.Context, body *hostsvc.DisableKillTasksRequest) (*hostsvc.DisableKillTasksResponse, error)
- func (h *ServiceHandler) GetCompletedReservations(ctx context.Context, req *hostsvc.GetCompletedReservationRequest) (*hostsvc.GetCompletedReservationResponse, error)
- func (h *ServiceHandler) GetDrainingHosts(ctx context.Context, request *hostsvc.GetDrainingHostsRequest) (*hostsvc.GetDrainingHostsResponse, error)
- func (h *ServiceHandler) GetHostPoolCapacity(ctx context.Context, body *hostsvc.GetHostPoolCapacityRequest) (response *hostsvc.GetHostPoolCapacityResponse, err error)
- func (h *ServiceHandler) GetHosts(ctx context.Context, body *hostsvc.GetHostsRequest) (response *hostsvc.GetHostsResponse, err error)
- func (h *ServiceHandler) GetHostsByQuery(ctx context.Context, body *hostsvc.GetHostsByQueryRequest) (*hostsvc.GetHostsByQueryResponse, error)
- func (h *ServiceHandler) GetMesosAgentInfo(ctx context.Context, request *hostsvc.GetMesosAgentInfoRequest) (*hostsvc.GetMesosAgentInfoResponse, error)
- func (h *ServiceHandler) GetMesosMasterHostPort(ctx context.Context, body *hostsvc.MesosMasterHostPortRequest) (response *hostsvc.MesosMasterHostPortResponse, err error)
- func (h *ServiceHandler) GetOutstandingOffers(ctx context.Context, body *hostsvc.GetOutstandingOffersRequest) (*hostsvc.GetOutstandingOffersResponse, error)
- func (h *ServiceHandler) GetReserver() reserver.Reserver
- func (h *ServiceHandler) GetTasksByHostState(ctx context.Context, req *hostsvc.GetTasksByHostStateRequest) (response *hostsvc.GetTasksByHostStateResponse, err error)
- func (h *ServiceHandler) KillAndReserveTasks(ctx context.Context, body *hostsvc.KillAndReserveTasksRequest) (*hostsvc.KillAndReserveTasksResponse, error)
- func (h *ServiceHandler) KillTasks(ctx context.Context, body *hostsvc.KillTasksRequest) (*hostsvc.KillTasksResponse, error)
- func (h *ServiceHandler) LaunchTasks(ctx context.Context, req *hostsvc.LaunchTasksRequest) (response *hostsvc.LaunchTasksResponse, err error)
- func (h *ServiceHandler) MarkHostDrained(ctx context.Context, request *hostsvc.MarkHostDrainedRequest) (*hostsvc.MarkHostDrainedResponse, error)
- func (h *ServiceHandler) OfferOperations(ctx context.Context, req *hostsvc.OfferOperationsRequest) (*hostsvc.OfferOperationsResponse, error)
- func (h *ServiceHandler) ReleaseHostOffers(ctx context.Context, body *hostsvc.ReleaseHostOffersRequest) (response *hostsvc.ReleaseHostOffersResponse, err error)
- func (h *ServiceHandler) ReleaseHostsHeldForTasks(ctx context.Context, req *hostsvc.ReleaseHostsHeldForTasksRequest) (*hostsvc.ReleaseHostsHeldForTasksResponse, error)
- func (h *ServiceHandler) ReserveHosts(ctx context.Context, req *hostsvc.ReserveHostsRequest) (*hostsvc.ReserveHostsResponse, error)
- func (h *ServiceHandler) ReserveResources(ctx context.Context, body *hostsvc.ReserveResourcesRequest) (*hostsvc.ReserveResourcesResponse, error)
- func (h *ServiceHandler) ShutdownExecutors(ctx context.Context, body *hostsvc.ShutdownExecutorsRequest) (response *hostsvc.ShutdownExecutorsResponse, err error)
- func (h *ServiceHandler) UnreserveResources(ctx context.Context, body *hostsvc.UnreserveResourcesRequest) (*hostsvc.UnreserveResourcesResponse, error)
- func (h *ServiceHandler) WatchEventStreamEvent(req *hostsvc.WatchEventRequest, ...) error
- func (h *ServiceHandler) WatchHostSummaryEvent(req *hostsvc.WatchEventRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher keeps track of matched host offers for given constraints.
func NewMatcher ¶
func NewMatcher( hostFilter *hostsvc.HostFilter, evaluator constraints.Evaluator, hostPoolManager manager.HostPoolManager, filter filterSlackResources) *Matcher
NewMatcher returns a new instance of Matcher. hostFilter defines the constraints on matching a host such as resources, revocable. evaluator is used to validate constraints such as labels.
func (*Matcher) GetMatchingHosts ¶
GetMatchingHosts tries to match the hosts through Host filter and it returns the hostname-> AgentInfo for the matched hosts. If the filter does not match, it returns the error
type RecoveryHandler ¶
RecoveryHandler defines the interface to be called by leader election callbacks.
func NewRecoveryHandler ¶
func NewRecoveryHandler( parent tally.Scope, taskStore storage.TaskStore, ormStore *ormobjects.Store, hostCache hostcache.HostCache, ) RecoveryHandler
NewRecoveryHandler creates a recoveryHandler
type Server ¶
Server contains all structs necessary to run a hostmgr server. This struct also implements leader.Node interface so that it can perform leader election among multiple host manager server instances.
func NewServer ¶
func NewServer( parent tally.Scope, backgroundManager background.Manager, httpPort, grpcPort int, mesosDetector mesos.MasterDetector, mesosInbound mhttp.Inbound, mesosOutbound transport.Outbounds, reconciler reconcile.TaskReconciler, recoveryHandler RecoveryHandler, drainer drainer.Drainer, reserver reserver.Reserver, watchProcessor watchevent.WatchProcessor, plugin plugins.Plugin, hostCache hostcache.HostCache, mesosManager plugins.Plugin, hostPoolManager hpm.HostPoolManager, ) *Server
NewServer creates a host manager Server instance.
func (*Server) GainedLeadershipCallback ¶
GainedLeadershipCallback is the callback when the current node becomes the leader
func (*Server) GetID ¶
GetID function returns the peloton master address. This implements leader.Nomination.
func (*Server) HasGainedLeadership ¶
HasGainedLeadership returns true iff once GainedLeadershipCallback completes.
func (*Server) LostLeadershipCallback ¶
LostLeadershipCallback is the callback when the current node lost leadership.
func (*Server) ShutDownCallback ¶
ShutDownCallback is the callback to shut down gracefully if possible.
type ServiceHandler ¶
type ServiceHandler struct {
// contains filtered or unexported fields
}
ServiceHandler implements peloton.private.hostmgr.InternalHostService.
func NewServiceHandler ¶
func NewServiceHandler( d *yarpc.Dispatcher, metrics *metrics.Metrics, schedulerClient mpb.SchedulerClient, masterOperatorClient mpb.MasterOperatorClient, frameworkInfoProvider hostmgr_mesos.FrameworkInfoProvider, mesosConfig hostmgr_mesos.Config, mesosDetector hostmgr_mesos.MasterDetector, hmConfig *config.Config, slackResourceTypes []string, watchProcessor watchevent.WatchProcessor, hostPoolManager manager.HostPoolManager, goalStateDriver goalstate.Driver, hostInfoOps ormobjects.HostInfoOps, hostCache hostcache.HostCache, plugin plugins.Plugin, ) *ServiceHandler
NewServiceHandler creates a new ServiceHandler.
func NewTestServiceHandler ¶
func NewTestServiceHandler() *ServiceHandler
NewTestServiceHandler returns an empty new ServiceHandler ptr for testing.
func (*ServiceHandler) AcquireHostOffers ¶
func (h *ServiceHandler) AcquireHostOffers( ctx context.Context, body *hostsvc.AcquireHostOffersRequest, ) (response *hostsvc.AcquireHostOffersResponse, err error)
AcquireHostOffers implements InternalHostService.AcquireHostOffers.
func (*ServiceHandler) CancelWatchEvent ¶
func (h *ServiceHandler) CancelWatchEvent( ctx context.Context, req *hostsvc.CancelWatchRequest, ) (*hostsvc.CancelWatchResponse, error)
Cancel cancels a watch. The watch stream will get an error indicating watch was cancelled and the stream will be closed.
func (*ServiceHandler) ClusterCapacity ¶
func (h *ServiceHandler) ClusterCapacity( ctx context.Context, body *hostsvc.ClusterCapacityRequest, ) (response *hostsvc.ClusterCapacityResponse, err error)
ClusterCapacity fetches the allocated resources to the framework
func (*ServiceHandler) CreateVolumes ¶
func (h *ServiceHandler) CreateVolumes( ctx context.Context, body *hostsvc.CreateVolumesRequest) ( *hostsvc.CreateVolumesResponse, error)
CreateVolumes implements InternalHostService.CreateVolumes.
func (*ServiceHandler) DestroyVolumes ¶
func (h *ServiceHandler) DestroyVolumes( ctx context.Context, body *hostsvc.DestroyVolumesRequest) ( *hostsvc.DestroyVolumesResponse, error)
DestroyVolumes implements InternalHostService.DestroyVolumes.
func (*ServiceHandler) DisableKillTasks ¶
func (h *ServiceHandler) DisableKillTasks( ctx context.Context, body *hostsvc.DisableKillTasksRequest, ) (*hostsvc.DisableKillTasksResponse, error)
DisableKillTasks toggles the flag to disable send kill tasks request to mesos master
func (*ServiceHandler) GetCompletedReservations ¶
func (h *ServiceHandler) GetCompletedReservations( ctx context.Context, req *hostsvc.GetCompletedReservationRequest, ) (*hostsvc.GetCompletedReservationResponse, error)
GetCompletedReservations gets the completed host reservations from reserver. Based on the reserver it returns the list of completed Reservations (hostsvc.CompletedReservation) or return the NoFound Error.
func (*ServiceHandler) GetDrainingHosts ¶
func (h *ServiceHandler) GetDrainingHosts( ctx context.Context, request *hostsvc.GetDrainingHostsRequest, ) (*hostsvc.GetDrainingHostsResponse, error)
GetDrainingHosts implements InternalHostService.GetDrainingHosts
func (*ServiceHandler) GetHostPoolCapacity ¶
func (h *ServiceHandler) GetHostPoolCapacity( ctx context.Context, body *hostsvc.GetHostPoolCapacityRequest, ) (response *hostsvc.GetHostPoolCapacityResponse, err error)
GetHostPoolCapacity fetches the resources for all host-pools.
func (*ServiceHandler) GetHosts ¶
func (h *ServiceHandler) GetHosts( ctx context.Context, body *hostsvc.GetHostsRequest, ) (response *hostsvc.GetHostsResponse, err error)
GetHosts implements InternalHostService.GetHosts. This function gets the hosts based on resource requirements and constraints passed in the request through hostsvc.HostFilter
func (*ServiceHandler) GetHostsByQuery ¶
func (h *ServiceHandler) GetHostsByQuery( ctx context.Context, body *hostsvc.GetHostsByQueryRequest, ) (*hostsvc.GetHostsByQueryResponse, error)
GetHostsByQuery implements InternalHostService.GetHostsByQuery. This function gets host resources from offer pool and filters host list based on the requirements passed in the request through hostsvc.HostFilter.
func (*ServiceHandler) GetMesosAgentInfo ¶
func (h *ServiceHandler) GetMesosAgentInfo( ctx context.Context, request *hostsvc.GetMesosAgentInfoRequest, ) (*hostsvc.GetMesosAgentInfoResponse, error)
GetMesosAgentInfo implements InternalHostService.GetMesosAgentInfo Returns Mesos agent info for a single agent or all agents.
func (*ServiceHandler) GetMesosMasterHostPort ¶
func (h *ServiceHandler) GetMesosMasterHostPort( ctx context.Context, body *hostsvc.MesosMasterHostPortRequest, ) (response *hostsvc.MesosMasterHostPortResponse, err error)
GetMesosMasterHostPort returns the Leader Mesos Master hostname and port.
func (*ServiceHandler) GetOutstandingOffers ¶
func (h *ServiceHandler) GetOutstandingOffers( ctx context.Context, body *hostsvc.GetOutstandingOffersRequest, ) (*hostsvc.GetOutstandingOffersResponse, error)
GetOutstandingOffers returns all the offers present in offer pool.
func (*ServiceHandler) GetReserver ¶
func (h *ServiceHandler) GetReserver() reserver.Reserver
GetReserver returns the reserver object
func (*ServiceHandler) GetTasksByHostState ¶
func (h *ServiceHandler) GetTasksByHostState( ctx context.Context, req *hostsvc.GetTasksByHostStateRequest, ) (response *hostsvc.GetTasksByHostStateResponse, err error)
GetTasksByHostState gets tasks on hosts in the specified host state.
func (*ServiceHandler) KillAndReserveTasks ¶
func (h *ServiceHandler) KillAndReserveTasks( ctx context.Context, body *hostsvc.KillAndReserveTasksRequest, ) (*hostsvc.KillAndReserveTasksResponse, error)
KillAndReserveTasks implements InternalHostService.KillAndReserveTasks.
func (*ServiceHandler) KillTasks ¶
func (h *ServiceHandler) KillTasks( ctx context.Context, body *hostsvc.KillTasksRequest) ( *hostsvc.KillTasksResponse, error)
KillTasks implements InternalHostService.KillTasks.
func (*ServiceHandler) LaunchTasks ¶
func (h *ServiceHandler) LaunchTasks( ctx context.Context, req *hostsvc.LaunchTasksRequest, ) (response *hostsvc.LaunchTasksResponse, err error)
LaunchTasks implements InternalHostService.LaunchTasks.
func (*ServiceHandler) MarkHostDrained ¶
func (h *ServiceHandler) MarkHostDrained( ctx context.Context, request *hostsvc.MarkHostDrainedRequest, ) (*hostsvc.MarkHostDrainedResponse, error)
MarkHostDrained implements InternalHostService.MarkHostDrained Mark the host as drained. This method is called by Resource Manager Drainer when there are no tasks on the DRAINING host
func (*ServiceHandler) OfferOperations ¶
func (h *ServiceHandler) OfferOperations( ctx context.Context, req *hostsvc.OfferOperationsRequest) ( *hostsvc.OfferOperationsResponse, error)
OfferOperations implements InternalHostService.OfferOperations.
func (*ServiceHandler) ReleaseHostOffers ¶
func (h *ServiceHandler) ReleaseHostOffers( ctx context.Context, body *hostsvc.ReleaseHostOffersRequest, ) (response *hostsvc.ReleaseHostOffersResponse, err error)
ReleaseHostOffers implements InternalHostService.ReleaseHostOffers.
func (*ServiceHandler) ReleaseHostsHeldForTasks ¶
func (h *ServiceHandler) ReleaseHostsHeldForTasks( ctx context.Context, req *hostsvc.ReleaseHostsHeldForTasksRequest, ) (*hostsvc.ReleaseHostsHeldForTasksResponse, error)
ReleaseHostsHeldForTasks releases the hosts which are held for the tasks provided
func (*ServiceHandler) ReserveHosts ¶
func (h *ServiceHandler) ReserveHosts( ctx context.Context, req *hostsvc.ReserveHostsRequest, ) (*hostsvc.ReserveHostsResponse, error)
ReserveHosts reserves the host for a specified task in the request. Host Manager will keep the host offers to itself till the time it does not have enough offers to itself and once that's fulfilled it will return the reservation with the offer to placement engine. till the time reservation is fulfilled or reservation timeout , offers from that host will not be given to any other placement engine.
func (*ServiceHandler) ReserveResources ¶
func (h *ServiceHandler) ReserveResources( ctx context.Context, body *hostsvc.ReserveResourcesRequest) ( *hostsvc.ReserveResourcesResponse, error)
ReserveResources implements InternalHostService.ReserveResources.
func (*ServiceHandler) ShutdownExecutors ¶
func (h *ServiceHandler) ShutdownExecutors( ctx context.Context, body *hostsvc.ShutdownExecutorsRequest, ) (response *hostsvc.ShutdownExecutorsResponse, err error)
ShutdownExecutors implements InternalHostService.ShutdownExecutors.
func (*ServiceHandler) UnreserveResources ¶
func (h *ServiceHandler) UnreserveResources( ctx context.Context, body *hostsvc.UnreserveResourcesRequest) ( *hostsvc.UnreserveResourcesResponse, error)
UnreserveResources implements InternalHostService.UnreserveResources.
func (*ServiceHandler) WatchEventStreamEvent ¶
func (h *ServiceHandler) WatchEventStreamEvent( req *hostsvc.WatchEventRequest, stream hostsvc.InternalHostServiceServiceWatchEventStreamEventYARPCServer, ) error
func (*ServiceHandler) WatchHostSummaryEvent ¶
func (h *ServiceHandler) WatchHostSummaryEvent( req *hostsvc.WatchEventRequest, stream hostsvc.InternalHostServiceServiceWatchHostSummaryEventYARPCServer, ) error
WatchHostSummaryEvent creates a watch to get notified about changes to Host Summary event. Changed objects are streamed back to the caller till the watch is cancelled.
Directories ¶
Path | Synopsis |
---|---|
factory
|
|
Package mesos is copied from mesos-uns-bridge/mesos/detector.go with modifications : 1) refer to forked mesos-go dependencies
|
Package mesos is copied from mesos-uns-bridge/mesos/detector.go with modifications : 1) refer to forked mesos-go dependencies |
mesos-go
* * This package is forked from https://github.com/mesos/mesos-go/tree/master
|
* * This package is forked from https://github.com/mesos/mesos-go/tree/master |
mesos-go/detector
The detector package houses implementation of master detectors.
|
The detector package houses implementation of master detectors. |
mesos-go/detector/zoo
Zookeeper-based mesos-master leaderhip detection.
|
Zookeeper-based mesos-master leaderhip detection. |
mesos-go/upid
Package upid defines the UPID type and some utilities of the UPID.
|
Package upid defines the UPID type and some utilities of the UPID. |
p2k
|
|