MCPcopy Create free account
hub / github.com/apache/mesos / removeFramework

Method removeFramework

src/slave/slave.cpp:7343–7388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7341
7342
7343void Slave::removeFramework(Framework* framework)
7344{
7345 CHECK_NOTNULL(framework);
7346
7347 LOG(INFO)<< "Cleaning up framework " << framework->id();
7348
7349 CHECK(framework->state == Framework::RUNNING ||
7350 framework->state == Framework::TERMINATING);
7351
7352 // We only remove frameworks once they become idle.
7353 CHECK(framework->idle());
7354
7355 // Close all task status update streams for this framework.
7356 taskStatusUpdateManager->cleanup(framework->id());
7357
7358 // Schedule the framework work and meta directories for garbage
7359 // collection.
7360 // TODO(vinod): Move the responsibility of gc'ing to the
7361 // Framework struct.
7362
7363 const string path = paths::getFrameworkPath(
7364 flags.work_dir, info.id(), framework->id());
7365
7366 os::utime(path); // Update the modification time.
7367 garbageCollect(path);
7368
7369 if (framework->info.checkpoint()) {
7370 // Schedule the framework meta directory to get garbage collected.
7371 const string path = paths::getFrameworkPath(
7372 metaDir, info.id(), framework->id());
7373
7374 os::utime(path); // Update the modification time.
7375 garbageCollect(path);
7376 }
7377
7378 frameworks.erase(framework->id());
7379
7380 // Pass ownership of the framework pointer.
7381 completedFrameworks.set(framework->id(), Owned<Framework>(framework));
7382
7383 updateDrainStatus();
7384
7385 if (state == TERMINATING && frameworks.empty()) {
7386 terminate(self());
7387 }
7388}
7389
7390
7391void Slave::shutdownExecutor(

Callers 2

ACTION_PFunction · 0.45

Calls 10

getFrameworkPathFunction · 0.85
utimeFunction · 0.85
idleMethod · 0.80
checkpointMethod · 0.80
terminateFunction · 0.50
idMethod · 0.45
cleanupMethod · 0.45
eraseMethod · 0.45
setMethod · 0.45
emptyMethod · 0.45

Tested by 2

ACTION_PFunction · 0.36