Search in sources :

Example 1 with CommandHandlingExecutor

use of alluxio.worker.job.command.CommandHandlingExecutor in project alluxio by Alluxio.

the class CommandHandlingExecutorTest method before.

@Before
public void before() {
    mWorkerId = 0;
    mJobMasterClient = Mockito.mock(JobMasterClient.class);
    mTaskExecutorManager = PowerMockito.mock(TaskExecutorManager.class);
    WorkerNetAddress workerNetAddress = PowerMockito.mock(WorkerNetAddress.class);
    mUfsManager = Mockito.mock(UfsManager.class);
    mFileSystemContext = Mockito.mock(FileSystemContext.class);
    mFileSystem = Mockito.mock(FileSystem.class);
    JobServerContext ctx = new JobServerContext(mFileSystem, mFileSystemContext, mUfsManager);
    mCommandHandlingExecutor = new CommandHandlingExecutor(ctx, mTaskExecutorManager, mJobMasterClient, workerNetAddress);
}
Also used : JobMasterClient(alluxio.worker.job.JobMasterClient) TaskExecutorManager(alluxio.worker.job.task.TaskExecutorManager) JobServerContext(alluxio.job.JobServerContext) UfsManager(alluxio.underfs.UfsManager) WorkerNetAddress(alluxio.wire.WorkerNetAddress) FileSystem(alluxio.client.file.FileSystem) CommandHandlingExecutor(alluxio.worker.job.command.CommandHandlingExecutor) FileSystemContext(alluxio.client.file.FileSystemContext) Before(org.junit.Before)

Example 2 with CommandHandlingExecutor

use of alluxio.worker.job.command.CommandHandlingExecutor in project alluxio by Alluxio.

the class JobWorker method start.

@Override
public void start(WorkerNetAddress address) throws IOException {
    super.start(address);
    // Start serving metrics system, this will not block
    MetricsSystem.startSinks(ServerConfiguration.getString(PropertyKey.METRICS_CONF_FILE));
    try {
        JobWorkerIdRegistry.registerWorker(mJobMasterClient, address);
    } catch (ConnectionFailedException e) {
        LOG.error("Failed to connect to job master", e);
        throw Throwables.propagate(e);
    }
    mTaskExecutorManager = new TaskExecutorManager(ServerConfiguration.getInt(PropertyKey.JOB_WORKER_THREADPOOL_SIZE), address);
    mCommandHandlingService = getExecutorService().submit(new HeartbeatThread(HeartbeatContext.JOB_WORKER_COMMAND_HANDLING, new CommandHandlingExecutor(mJobServerContext, mTaskExecutorManager, mJobMasterClient, address), (int) ServerConfiguration.getMs(PropertyKey.JOB_MASTER_WORKER_HEARTBEAT_INTERVAL), ServerConfiguration.global(), ServerUserState.global()));
}
Also used : TaskExecutorManager(alluxio.worker.job.task.TaskExecutorManager) HeartbeatThread(alluxio.heartbeat.HeartbeatThread) CommandHandlingExecutor(alluxio.worker.job.command.CommandHandlingExecutor) ConnectionFailedException(alluxio.exception.ConnectionFailedException)

Aggregations

CommandHandlingExecutor (alluxio.worker.job.command.CommandHandlingExecutor)2 TaskExecutorManager (alluxio.worker.job.task.TaskExecutorManager)2 FileSystem (alluxio.client.file.FileSystem)1 FileSystemContext (alluxio.client.file.FileSystemContext)1 ConnectionFailedException (alluxio.exception.ConnectionFailedException)1 HeartbeatThread (alluxio.heartbeat.HeartbeatThread)1 JobServerContext (alluxio.job.JobServerContext)1 UfsManager (alluxio.underfs.UfsManager)1 WorkerNetAddress (alluxio.wire.WorkerNetAddress)1 JobMasterClient (alluxio.worker.job.JobMasterClient)1 Before (org.junit.Before)1