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);
}
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()));
}
Aggregations