Search in sources :

Example 1 with AMWorkerEvent

use of com.tencent.angel.master.worker.worker.AMWorkerEvent in project angel by Tencent.

the class WorkerManager method startAllWorker.

/**
 * init and start all workers
 */
public void startAllWorker() {
    LOG.info("to start all workers.....");
    try {
        writeLock.lock();
        initWorkers();
        for (int i = 0; i < workerGroupMap.size(); i++) {
            AMWorkerGroup group = workerGroupMap.get(new WorkerGroupId(i));
            for (AMWorker worker : group.getWorkerSet()) {
                worker.handle(new AMWorkerEvent(AMWorkerEventType.SCHEDULE, worker.getId()));
            }
        }
        isInited = true;
    } finally {
        writeLock.unlock();
    }
}
Also used : AMWorkerGroup(com.tencent.angel.master.worker.workergroup.AMWorkerGroup) AMWorker(com.tencent.angel.master.worker.worker.AMWorker) AMWorkerEvent(com.tencent.angel.master.worker.worker.AMWorkerEvent) WorkerGroupId(com.tencent.angel.worker.WorkerGroupId)

Aggregations

AMWorker (com.tencent.angel.master.worker.worker.AMWorker)1 AMWorkerEvent (com.tencent.angel.master.worker.worker.AMWorkerEvent)1 AMWorkerGroup (com.tencent.angel.master.worker.workergroup.AMWorkerGroup)1 WorkerGroupId (com.tencent.angel.worker.WorkerGroupId)1