Rename schedcfg -> schedulerConfig

This commit is contained in:
Dr. Stefan Schimanski 2015-10-25 11:55:05 -07:00
parent beaaf81ee3
commit 8e3c648ca0
4 changed files with 20 additions and 20 deletions

View File

@ -301,7 +301,7 @@ func (k *KubernetesMesosScheduler) NewPluginConfig(terminate <-chan struct{}, mu
podsWatcher *cache.ListWatch) *PluginConfig { podsWatcher *cache.ListWatch) *PluginConfig {
// Watch and queue pods that need scheduling. // Watch and queue pods that need scheduling.
updates := make(chan queue.Entry, k.schedcfg.UpdatesBacklog) updates := make(chan queue.Entry, k.schedulerConfig.UpdatesBacklog)
podUpdates := &podStoreAdapter{queue.NewHistorical(updates)} podUpdates := &podStoreAdapter{queue.NewHistorical(updates)}
reflector := cache.NewReflector(podsWatcher, &api.Pod{}, podUpdates, 0) reflector := cache.NewReflector(podsWatcher, &api.Pod{}, podUpdates, 0)
@ -316,7 +316,7 @@ func (k *KubernetesMesosScheduler) NewPluginConfig(terminate <-chan struct{}, mu
} }
eh := &errorHandler{ eh := &errorHandler{
api: kapi, api: kapi,
backoff: backoff.New(k.schedcfg.InitialPodBackoff.Duration, k.schedcfg.MaxPodBackoff.Duration), backoff: backoff.New(k.schedulerConfig.InitialPodBackoff.Duration, k.schedulerConfig.MaxPodBackoff.Duration),
qr: q, qr: q,
} }
startLatch := make(chan struct{}) startLatch := make(chan struct{})

View File

@ -482,7 +482,7 @@ func newLifecycleTest(t *testing.T) lifecycleTest {
Version: testapi.Default.Version(), Version: testapi.Default.Version(),
}), }),
PodScheduler: malgorithm.NewFCFSPodScheduler(strategy, apiServer.LookupNode), PodScheduler: malgorithm.NewFCFSPodScheduler(strategy, apiServer.LookupNode),
Schedcfg: *schedcfg.CreateDefaultConfig(), SchedulerConfig: *schedcfg.CreateDefaultConfig(),
LookupNode: apiServer.LookupNode, LookupNode: apiServer.LookupNode,
}) })

View File

@ -76,7 +76,7 @@ type KubernetesMesosScheduler struct {
// Config related, write-once // Config related, write-once
schedcfg *schedcfg.Config schedulerConfig *schedcfg.Config
executor *mesos.ExecutorInfo executor *mesos.ExecutorInfo
executorGroup uint64 executorGroup uint64
client *client.Client client *client.Client
@ -110,7 +110,7 @@ type KubernetesMesosScheduler struct {
} }
type Config struct { type Config struct {
Schedcfg schedcfg.Config SchedulerConfig schedcfg.Config
Executor *mesos.ExecutorInfo Executor *mesos.ExecutorInfo
PodScheduler malgorithm.PodScheduler PodScheduler malgorithm.PodScheduler
Client *client.Client Client *client.Client
@ -125,7 +125,7 @@ type Config struct {
func New(config Config) *KubernetesMesosScheduler { func New(config Config) *KubernetesMesosScheduler {
var k *KubernetesMesosScheduler var k *KubernetesMesosScheduler
k = &KubernetesMesosScheduler{ k = &KubernetesMesosScheduler{
schedcfg: &config.Schedcfg, schedulerConfig: &config.SchedulerConfig,
RWMutex: new(sync.RWMutex), RWMutex: new(sync.RWMutex),
executor: config.Executor, executor: config.Executor,
executorGroup: uid.Parse(config.Executor.ExecutorId.GetValue()).Group(), executorGroup: uid.Parse(config.Executor.ExecutorId.GetValue()).Group(),
@ -165,9 +165,9 @@ func New(config Config) *KubernetesMesosScheduler {
return errOnce.Send(errOuter).Err() return errOnce.Send(errOuter).Err()
}, },
// remember expired offers so that we can tell if a previously scheduler offer relies on one // remember expired offers so that we can tell if a previously scheduler offer relies on one
LingerTTL: config.Schedcfg.OfferLingerTTL.Duration, LingerTTL: config.SchedulerConfig.OfferLingerTTL.Duration,
TTL: config.Schedcfg.OfferTTL.Duration, TTL: config.SchedulerConfig.OfferTTL.Duration,
ListenerDelay: config.Schedcfg.ListenerDelay.Duration, ListenerDelay: config.SchedulerConfig.ListenerDelay.Duration,
}), }),
slaveHostNames: slave.NewRegistry(), slaveHostNames: slave.NewRegistry(),
taskRegistry: podtask.NewInMemoryRegistry(), taskRegistry: podtask.NewInMemoryRegistry(),
@ -217,7 +217,7 @@ func (k *KubernetesMesosScheduler) InstallDebugHandlers(mux *http.ServeMux) {
w.WriteHeader(http.StatusServiceUnavailable) w.WriteHeader(http.StatusServiceUnavailable)
}, k.terminate) }, k.terminate)
select { select {
case <-time.After(k.schedcfg.HttpHandlerTimeout.Duration): case <-time.After(k.schedulerConfig.HttpHandlerTimeout.Duration):
log.Warningf("timed out waiting for request to be processed") log.Warningf("timed out waiting for request to be processed")
w.WriteHeader(http.StatusServiceUnavailable) w.WriteHeader(http.StatusServiceUnavailable)
return return
@ -294,8 +294,8 @@ func (k *KubernetesMesosScheduler) onInitialRegistration(driver bindings.Schedul
defer close(k.registration) defer close(k.registration)
if k.failoverTimeout > 0 { if k.failoverTimeout > 0 {
refreshInterval := k.schedcfg.FrameworkIdRefreshInterval.Duration refreshInterval := k.schedulerConfig.FrameworkIdRefreshInterval.Duration
if k.failoverTimeout < k.schedcfg.FrameworkIdRefreshInterval.Duration.Seconds() { if k.failoverTimeout < k.schedulerConfig.FrameworkIdRefreshInterval.Duration.Seconds() {
refreshInterval = time.Duration(math.Max(1, k.failoverTimeout/2)) * time.Second refreshInterval = time.Duration(math.Max(1, k.failoverTimeout/2)) * time.Second
} }
go runtime.Until(k.storeFrameworkId, refreshInterval, k.terminate) go runtime.Until(k.storeFrameworkId, refreshInterval, k.terminate)
@ -305,13 +305,13 @@ func (k *KubernetesMesosScheduler) onInitialRegistration(driver bindings.Schedul
r2 := k.makePodRegistryReconciler() r2 := k.makePodRegistryReconciler()
k.reconciler = newReconciler(k.asRegisteredMaster, k.makeCompositeReconciler(r1, r2), k.reconciler = newReconciler(k.asRegisteredMaster, k.makeCompositeReconciler(r1, r2),
k.reconcileCooldown, k.schedcfg.ExplicitReconciliationAbortTimeout.Duration, k.terminate) k.reconcileCooldown, k.schedulerConfig.ExplicitReconciliationAbortTimeout.Duration, k.terminate)
go k.reconciler.Run(driver) go k.reconciler.Run(driver)
if k.reconcileInterval > 0 { if k.reconcileInterval > 0 {
ri := time.Duration(k.reconcileInterval) * time.Second ri := time.Duration(k.reconcileInterval) * time.Second
time.AfterFunc(k.schedcfg.InitialImplicitReconciliationDelay.Duration, func() { runtime.Until(k.reconciler.RequestImplicit, ri, k.terminate) }) time.AfterFunc(k.schedulerConfig.InitialImplicitReconciliationDelay.Duration, func() { runtime.Until(k.reconciler.RequestImplicit, ri, k.terminate) })
log.Infof("will perform implicit task reconciliation at interval: %v after %v", ri, k.schedcfg.InitialImplicitReconciliationDelay.Duration) log.Infof("will perform implicit task reconciliation at interval: %v after %v", ri, k.schedulerConfig.InitialImplicitReconciliationDelay.Duration)
} }
} }
@ -714,8 +714,8 @@ func (k *KubernetesMesosScheduler) explicitlyReconcileTasks(driver bindings.Sche
for backoff := 1 * time.Second; first || remaining.Len() > 0; backoff = backoff * 2 { for backoff := 1 * time.Second; first || remaining.Len() > 0; backoff = backoff * 2 {
first = false first = false
// nothing to do here other than wait for status updates.. // nothing to do here other than wait for status updates..
if backoff > k.schedcfg.ExplicitReconciliationMaxBackoff.Duration { if backoff > k.schedulerConfig.ExplicitReconciliationMaxBackoff.Duration {
backoff = k.schedcfg.ExplicitReconciliationMaxBackoff.Duration backoff = k.schedulerConfig.ExplicitReconciliationMaxBackoff.Duration
} }
select { select {
case <-cancel: case <-cancel:

View File

@ -719,7 +719,7 @@ func (s *SchedulerServer) bootstrap(hks hyperkube.Interface, sc *schedcfg.Config
fcfs := malgorithm.NewFCFSPodScheduler(as, lookupNode) fcfs := malgorithm.NewFCFSPodScheduler(as, lookupNode)
mesosPodScheduler := scheduler.New(scheduler.Config{ mesosPodScheduler := scheduler.New(scheduler.Config{
Schedcfg: *sc, SchedulerConfig: *sc,
Executor: executor, Executor: executor,
PodScheduler: fcfs, PodScheduler: fcfs,
Client: client, Client: client,