Search in sources :

Example 6 with HeartbeatThread

use of alluxio.heartbeat.HeartbeatThread in project alluxio by Alluxio.

the class DefaultMetricsMaster method start.

@Override
public void start(Boolean isLeader) throws IOException {
    super.start(isLeader);
    mMetricsStore.initMetricKeys();
    mMetricsStore.clear();
    if (isLeader) {
        getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_CLUSTER_METRICS_UPDATER, new ClusterMetricsUpdater(), ServerConfiguration.getMs(PropertyKey.MASTER_CLUSTER_METRICS_UPDATE_INTERVAL), ServerConfiguration.global(), mMasterContext.getUserState()));
    }
}
Also used : HeartbeatThread(alluxio.heartbeat.HeartbeatThread)

Example 7 with HeartbeatThread

use of alluxio.heartbeat.HeartbeatThread 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)

Example 8 with HeartbeatThread

use of alluxio.heartbeat.HeartbeatThread in project alluxio by Alluxio.

the class LineageMaster method start.

@Override
public void start(boolean isLeader) throws IOException {
    super.start(isLeader);
    if (isLeader) {
        getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_CHECKPOINT_SCHEDULING, new CheckpointSchedulingExecutor(this, mFileSystemMaster), Configuration.getInt(PropertyKey.MASTER_LINEAGE_CHECKPOINT_INTERVAL_MS)));
        getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_FILE_RECOMPUTATION, new RecomputeExecutor(new RecomputePlanner(mLineageStore, mFileSystemMaster), mFileSystemMaster), Configuration.getInt(PropertyKey.MASTER_LINEAGE_RECOMPUTE_INTERVAL_MS)));
    }
}
Also used : CheckpointSchedulingExecutor(alluxio.master.lineage.checkpoint.CheckpointSchedulingExecutor) HeartbeatThread(alluxio.heartbeat.HeartbeatThread) RecomputePlanner(alluxio.master.lineage.recompute.RecomputePlanner) RecomputeExecutor(alluxio.master.lineage.recompute.RecomputeExecutor)

Example 9 with HeartbeatThread

use of alluxio.heartbeat.HeartbeatThread in project alluxio by Alluxio.

the class FileSystemMaster method start.

@Override
public void start(boolean isLeader) throws IOException {
    if (isLeader) {
        // Only initialize root when isLeader because when initializing root, BlockMaster needs to
        // write journal entry, if it is not leader, BlockMaster won't have a writable journal.
        // If it is standby, it should be able to load the inode tree from leader's checkpoint.
        mInodeTree.initializeRoot(SecurityUtils.getOwnerFromLoginModule(), SecurityUtils.getGroupFromLoginModule(), Mode.createFullAccess().applyDirectoryUMask());
        String defaultUFS = Configuration.get(PropertyKey.UNDERFS_ADDRESS);
        try {
            mMountTable.add(new AlluxioURI(MountTable.ROOT), new AlluxioURI(defaultUFS), MountOptions.defaults().setShared(UnderFileSystemUtils.isObjectStorage(defaultUFS) && Configuration.getBoolean(PropertyKey.UNDERFS_OBJECT_STORE_MOUNT_SHARED_PUBLICLY)));
        } catch (FileAlreadyExistsException | InvalidPathException e) {
            throw new IOException("Failed to mount the default UFS " + defaultUFS);
        }
    }
    // Call super.start after mInodeTree is initialized because mInodeTree is needed to write
    // a journal entry during super.start. Call super.start before calling
    // getExecutorService() because the super.start initializes the executor service.
    super.start(isLeader);
    if (isLeader) {
        mTtlCheckerService = getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_TTL_CHECK, new MasterInodeTtlCheckExecutor(), Configuration.getInt(PropertyKey.MASTER_TTL_CHECKER_INTERVAL_MS)));
        mLostFilesDetectionService = getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_LOST_FILES_DETECTION, new LostFilesDetectionHeartbeatExecutor(), Configuration.getInt(PropertyKey.MASTER_HEARTBEAT_INTERVAL_MS)));
        if (Configuration.getBoolean(PropertyKey.MASTER_STARTUP_CONSISTENCY_CHECK_ENABLED)) {
            mStartupConsistencyCheck = getExecutorService().submit(new Callable<List<AlluxioURI>>() {

                @Override
                public List<AlluxioURI> call() throws Exception {
                    return startupCheckConsistency(ExecutorServiceFactories.fixedThreadPoolExecutorServiceFactory("startup-consistency-check", 32).create());
                }
            });
        }
    }
}
Also used : FileAlreadyExistsException(alluxio.exception.FileAlreadyExistsException) HeartbeatThread(alluxio.heartbeat.HeartbeatThread) IOException(java.io.IOException) InvalidPathException(alluxio.exception.InvalidPathException) Callable(java.util.concurrent.Callable) AlluxioURI(alluxio.AlluxioURI)

Example 10 with HeartbeatThread

use of alluxio.heartbeat.HeartbeatThread in project alluxio by Alluxio.

the class BlockMaster method start.

@Override
public void start(boolean isLeader) throws IOException {
    super.start(isLeader);
    mGlobalStorageTierAssoc = new MasterStorageTierAssoc();
    if (isLeader) {
        mLostWorkerDetectionService = getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_LOST_WORKER_DETECTION, new LostWorkerDetectionHeartbeatExecutor(), Configuration.getInt(PropertyKey.MASTER_HEARTBEAT_INTERVAL_MS)));
    }
}
Also used : MasterStorageTierAssoc(alluxio.MasterStorageTierAssoc) HeartbeatThread(alluxio.heartbeat.HeartbeatThread)

Aggregations

HeartbeatThread (alluxio.heartbeat.HeartbeatThread)13 IOException (java.io.IOException)3 AlluxioURI (alluxio.AlluxioURI)2 AsyncUserAccessAuditLogWriter (alluxio.master.audit.AsyncUserAccessAuditLogWriter)2 JournalContext (alluxio.master.journal.JournalContext)2 SessionCleaner (alluxio.worker.SessionCleaner)2 MasterStorageTierAssoc (alluxio.MasterStorageTierAssoc)1 PropertyKey (alluxio.PropertyKey)1 AlluxioException (alluxio.exception.AlluxioException)1 BlockAlreadyExistsException (alluxio.exception.BlockAlreadyExistsException)1 BlockDoesNotExistException (alluxio.exception.BlockDoesNotExistException)1 ConnectionFailedException (alluxio.exception.ConnectionFailedException)1 FileAlreadyExistsException (alluxio.exception.FileAlreadyExistsException)1 FileDoesNotExistException (alluxio.exception.FileDoesNotExistException)1 InvalidPathException (alluxio.exception.InvalidPathException)1 InvalidWorkerStateException (alluxio.exception.InvalidWorkerStateException)1 WorkerOutOfSpaceException (alluxio.exception.WorkerOutOfSpaceException)1 PermissionDeniedException (alluxio.exception.status.PermissionDeniedException)1 UnavailableException (alluxio.exception.status.UnavailableException)1 BackupLeaderRole (alluxio.master.backup.BackupLeaderRole)1