Search in sources :

Example 1 with CommandShutdownACK

use of es.bsc.compss.nio.commands.CommandShutdownACK in project compss by bsc-wdc.

the class NIOWorker method shutdown.

// Shutdown the worker, at this point there are no active transfers
@Override
public void shutdown(Connection closingConnection) {
    WORKER_LOGGER.debug("Entering shutdown method on worker");
    // Stop the Data Manager
    dataManager.stop();
    // Finish the main thread
    if (closingConnection != null) {
        closingConnection.sendCommand(new CommandShutdownACK());
        closingConnection.finishConnection();
    }
    TM.shutdown(closingConnection);
    // End storage
    String storageConf = System.getProperty(COMPSsConstants.STORAGE_CONF);
    if (storageConf != null && !storageConf.equals("") && !storageConf.equals("null")) {
        try {
            StorageItf.finish();
        } catch (StorageException e) {
            WORKER_LOGGER.error("Error releasing storage library: " + e.getMessage(), e);
        }
    }
    // Remove workingDir
    if (removeWD) {
        WORKER_LOGGER.debug("Erasing Worker Sandbox WorkingDir: " + this.workingDir);
        try {
            removeFolder(this.workingDir);
        } catch (IOException ioe) {
            WORKER_LOGGER.error("Exception", ioe);
        }
    }
    WORKER_LOGGER.debug("Finish shutdown method on worker");
}
Also used : CommandShutdownACK(es.bsc.compss.nio.commands.CommandShutdownACK) IOException(java.io.IOException) StorageException(storage.StorageException)

Aggregations

CommandShutdownACK (es.bsc.compss.nio.commands.CommandShutdownACK)1 IOException (java.io.IOException)1 StorageException (storage.StorageException)1