-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/coordinator, internal/coordinator/schedule: create schedule pkg
This moves the coordinator scheduler into a package. The span has also been moved into the schedule package. It also adds a mostly uimplemented fake scheduler. Updates golang/go#38337 Updates golang/go#48742 Change-Id: I980241e8e8ba2acafa38f732fe480e66d9d3a4f3 Reviewed-on: https://go-review.googlesource.com/c/build/+/368676 Trust: Carlos Amedee <[email protected]> Run-TryBot: Carlos Amedee <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information
1 parent
f45690d
commit c4e615e
Showing
10 changed files
with
237 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2018 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build go1.13 && (linux || darwin) | ||
// +build go1.13 | ||
// +build linux darwin | ||
|
||
package schedule | ||
|
||
import ( | ||
"context" | ||
|
||
"golang.org/x/build/buildlet" | ||
"golang.org/x/build/types" | ||
) | ||
|
||
// Fake is a fake scheduler. | ||
type Fake struct{} | ||
|
||
// NewFake returns a fake scheduler. | ||
func NewFake() *Fake { return &Fake{} } | ||
|
||
// State returns the state of the fake scheduler. | ||
func (f *Fake) State() (st SchedulerState) { return SchedulerState{} } | ||
|
||
// WaiterState is the waiter state of the fake scheduler. | ||
func (f *Fake) WaiterState(waiter *SchedItem) (ws types.BuildletWaitStatus) { | ||
return types.BuildletWaitStatus{} | ||
} | ||
|
||
// GetBuildlet returns a fake buildlet client for the requested buildlet. | ||
func (f *Fake) GetBuildlet(ctx context.Context, si *SchedItem) (*buildlet.Client, error) { | ||
return &buildlet.Client{}, nil | ||
} |
Oops, something went wrong.