Documentation ¶
Index ¶
Constants ¶
View Source
const ( TASK_QUEUE_SIZE = 1 COORDINATE_URL = "http://127.0.0.1:3921/coordinate" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
func MakeCoordinator ¶
func MakeCoordinator(pluginPath string, nReduce int, fileNames []string) *Coordinator
func (*Coordinator) Server ¶
func (c *Coordinator) Server()
func (*Coordinator) String ¶
func (c *Coordinator) String() string
type PluginFuncs ¶
type PluginFuncs struct { MapFunc MapFunc ReduceFunc ReduceFunc }
type ReduceFunc ¶
type Task ¶
type Task struct { ID string `json:"id"` Type TaskType `json:"type"` Paths []string `json:"paths"` PluginPath string `json:"plugin_path"` NReduce int `json:"n_reduce"` Status TaskStatus `json:"status"` WorkerID string `json:"worker_id"` ReduceID int `json:"reduce_id"` }
func (*Task) Map ¶
func (task *Task) Map() TaskStatus
func (*Task) Reduce ¶
func (task *Task) Reduce() TaskStatus
func (*Task) Run ¶
func (task *Task) Run() (status TaskStatus)
type TaskStatus ¶
type TaskStatus int8
const ( TASK_SUCCESS TaskStatus = 0 TASK_FAILED TaskStatus = -1 TASK_PENDING TaskStatus = 1 TASK_RUNNING TaskStatus = 2 )
func (TaskStatus) String ¶
func (taskStatus TaskStatus) String() string
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func MakeWorker ¶
func MakeWorker() *Worker
type WorkerInfo ¶
type WorkerInfo struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.