Unreserves all the resources for all the slaves for the role.
3138
def unreserve_resources(role):
    
    state = dcos_agents_state()
    if not state or 'slaves' not in state.keys():
        return False
    all_success = True
    for agent in state['slaves']:
        if not unreserve_resource(agent, role):
            all_success = False
    return all_success
1004704
public void shutdown() {
        for (Connection connection : _connectionMap.values()) {
            connection.shutdown();
        }

        for (Connection connection : _privilegedConnectionMap.values()) {
            connection.shutdown();
        }

        _factory.releaseExternalResources();
    }
1371782
@Override
	void releaseAllResources() throws IOException {
		if (isReleased.compareAndSet(false, true)) {

			// Gather all exclusive buffers and recycle them to global pool in batch, because
			// we do not want to trigger redistribution of buffers after each recycle.
			final List<MemorySegment> exclusiveRecyclingSegments = new ArrayList<>();

			synchronized (receivedBuffers) {
				Buffer buffer;
				while ((buffer = receivedBuffers.poll()) != null) {
					if (buffer.getRecycler() == this) {
						exclusiveRecyclingSegments.add(buffer.getMemorySegment());
					} else {
						buffer.recycleBuffer();
					}
				}
			}
			synchronized (bufferQueue) {
				bufferQueue.releaseAll(exclusiveRecyclingSegments);
			}

			if (exclusiveRecyclingSegments.size() > 0) {
				inputGate.returnExclusiveSegments(exclusiveRecyclingSegments);
			}

			// The released flag has to be set before closing the connection to ensure that
			// buffers received concurrently with closing are properly recycled.
			if (partitionRequestClient != null) {
				partitionRequestClient.close(this);
			} else {
				connectionManager.closeOpenChannelConnections(connectionId);
			}
		}
	}
1020002
private void relinquishResource(ZooKeeper zookeeper, String poolNode, int resource) {
        logger.debug("Relinquishing claimed resource {}.", resource);
        try {
            zookeeper.delete(poolNode + "/" + Integer.toString(resource), -1);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        } catch (KeeperException e) {
            logger.error("Failed to remove resource claim node {}/{}", poolNode, resource);
        }
    }
998386
private function cleanupSlaveConnections()
    {
        foreach ($this->config['database']['connections'] as $name => $connection) {
            if (count($connection['slaves']) <= 0) {
                unset($this->config['database']['connections'][$name]['slaves']);
            }
        }
    }
1010625
public void releaseAllResources()
    {
        super.releaseAllResources();
        synchronized (poolSynch)
        {
            if (!poolMap.isEmpty())
            {
                Collection pools = poolMap.values();
                Iterator iterator = pools.iterator();
                ObjectPool op = null;
                while (iterator.hasNext())
                {
                    try
                    {
                        op = (ObjectPool) iterator.next();
                        op.close();
                    }
                    catch (Exception e)
                    {
                        log.error("Exception occured while closing ObjectPool " + op, e);
                    }
                }
                poolMap.clear();
            }
            dsMap.clear();
        }
    }
255787
def destroy_volumes(role):
    
    state = dcos_agents_state()
    if not state or 'slaves' not in state.keys():
        return False
    all_success = True
    for agent in state['slaves']:
        if not destroy_volume(agent, role):
            all_success = False
    return all_success
177289
public void shutdown() {
		Iterator<ExclusionFilterFactory> itr = factories.iterator();
		while (itr.hasNext()) {
			ExclusionFilterFactory i = itr.next();
			i.shutdown();
		}
	}
195784
public function dropAllTables()
    {
        $this->disableForeignKeyConstraints();

        $this->connection->statement($this->grammar->compileDropAllTables());

        $this->enableForeignKeyConstraints();
    }
1050867
public void free()
    {
        super.free();
        try
        {
            if (this.getHandle(DBConstants.DATA_SOURCE_HANDLE) != null)
                ((BaseBuffer)this.getHandle(DBConstants.DATA_SOURCE_HANDLE)).free();
        } catch (DBException ex)    {
            // Never
        }
        if (m_pTable != null)
            m_pTable.removePTableOwner(this, true);      // Free or decrement the use count of the physical table
        m_pTable = null;
    }
485955
def cleanup(self):
        
        try:
            self.unload_lime()
        except AttributeError as ex:
            pass
        self.tunnel.cleanup()
        self.shell.cleanup()
1018716
def revoke(self, role):
        
        if role in self.roles:
            self.roles.remove(role)
1176056
@CommandArgument
  public void clean() {
    for (int i = 0; i < jobProgressStates.size();) {
      ProgressState state = jobProgressStates.get(i);
      if (state.isCancelled() || state.isComplete()) {
        jobProgressStates.remove(i);
      } else {
        i++;
      }
    }
  }
1311027
@Override
    public final void destroy()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "destroy", new Object[] { _resource, _xid });

        if (!_completed)
        {
            // If we created an XAResource by reconnectRM we need to destroy it
            if (_recoveredRM != null)
            {
                _recoveredRM.closeConnection();
                _recoveredRM = null;
                if (_recovery)
                {
                    if (_recoveryData != null)
                        _recoveryData.decrementCount();
                }
            }
            _completed = true;
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "destroy");
    }
398121
public function purgeAll() {
		
		if ($this->useFallback) {
			if ($this->log) {
				$this->log->trace("Purging the whole file cache.");
			}
			$files = glob($this->getDirectory()."*");
			foreach ($files as $filename) {
				unlink($filename);
			}
			return;
		}
		
		apc_clear_cache('user');
	}
707954
void clearPrivileges() {

        roles.clear();
        directRightsMap.clear();
        grantedRightsMap.clear();
        fullRightsMap.clear();

        isAdmin = false;
    }
180161
def clear(self):
        
        self.states[:] = 0
        self.actions[:] = 0
        self.rewards[:] = 0
        self.terminate_flags[:] = 0
        self.top = 0
        self.size = 0