forked from runabol/tork
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package manager | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/golang-collections/collections/queue" | ||
"github.com/google/uuid" | ||
"github.com/tork/task" | ||
) | ||
|
||
type Manager struct { | ||
Pending queue.Queue | ||
TaskDB map[string][]task.Task | ||
EventDB map[string][]task.TaskEvent | ||
Workers []string | ||
WorkerTaskMap map[string][]uuid.UUID | ||
TaskWorkerMap map[uuid.UUID]string | ||
} | ||
|
||
func (m *Manager) SelectWorker() { | ||
fmt.Println("I will select an appropriate worker") | ||
} | ||
|
||
func (m *Manager) UpdateTasks() { | ||
fmt.Println("I will update tasks") | ||
} | ||
|
||
func (m *Manager) SendWork() { | ||
fmt.Println("I will send work to workers") | ||
} |
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,13 @@ | ||
package node | ||
|
||
type Node struct { | ||
Name string | ||
IP string | ||
Cores int | ||
Memory int | ||
MemoryAllocated int | ||
Disk int | ||
DiskAllocated int | ||
Role string | ||
TaskCount int | ||
} |
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,7 @@ | ||
package scheduler | ||
|
||
type Scheduler interface { | ||
SelectCandidateNodes() | ||
Score() | ||
Pick() | ||
} |
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