Search in sources :

Example 1 with DataOperation

use of es.bsc.compss.types.data.operation.DataOperation in project compss by bsc-wdc.

the class Dispatcher method processRequests.

public void processRequests() {
    DataOperation fOp;
    while (true) {
        fOp = queue.dequeue();
        if (fOp == null) {
            break;
        }
        // What kind of operation is requested?
        if (fOp instanceof ImmediateCopy) {
            // File transfer (copy)
            ImmediateCopy c = (ImmediateCopy) fOp;
            c.perform();
        } else if (fOp instanceof DeferredCopy) {
        // DO nothing
        } else {
            // fOp instanceof Delete
            Delete d = (Delete) fOp;
            performOperation(d);
        }
    }
}
Also used : DeferredCopy(es.bsc.compss.types.data.operation.copy.DeferredCopy) Delete(es.bsc.compss.types.data.operation.Delete) DataOperation(es.bsc.compss.types.data.operation.DataOperation) ImmediateCopy(es.bsc.compss.types.data.operation.copy.ImmediateCopy)

Example 2 with DataOperation

use of es.bsc.compss.types.data.operation.DataOperation in project compss by bsc-wdc.

the class GATAdaptor method init.

public void init() {
    // Create request queues
    copyQueue = new RequestQueue<DataOperation>();
    safeQueue = new RequestQueue<DataOperation>();
    String adaptor = System.getProperty(COMPSsConstants.GAT_FILE_ADAPTOR);
    if (debug) {
        logger.debug("Initializing GAT");
    }
    pool = new ThreadPool(GAT_POOL_SIZE, POOL_NAME, new Dispatcher(copyQueue));
    try {
        pool.startThreads();
    } catch (Exception e) {
        ErrorManager.error(THREAD_POOL_ERR, e);
    }
    safePool = new ThreadPool(SAFE_POOL_SIZE, SAFE_POOL_NAME, new Dispatcher(safeQueue));
    try {
        safePool.startThreads();
    } catch (Exception e) {
        ErrorManager.error(THREAD_POOL_ERR, e);
    }
    // GAT adaptor path
    if (debug) {
        logger.debug("Initializing GAT Tranfer Context");
    }
    transferContext = new GATContext();
    /*
         * We need to try the local adaptor when both source and target hosts are local, because ssh file adaptor cannot
         * perform local operations
         */
    transferContext.addPreference("File.adaptor.name", adaptor + ", srcToLocalToDestCopy, local");
}
Also used : DataOperation(es.bsc.compss.types.data.operation.DataOperation) GATContext(org.gridlab.gat.GATContext) ThreadPool(es.bsc.compss.util.ThreadPool) Dispatcher(es.bsc.compss.comm.Dispatcher) URISyntaxException(java.net.URISyntaxException) ConstructConfigurationException(es.bsc.compss.exceptions.ConstructConfigurationException)

Aggregations

DataOperation (es.bsc.compss.types.data.operation.DataOperation)2 Dispatcher (es.bsc.compss.comm.Dispatcher)1 ConstructConfigurationException (es.bsc.compss.exceptions.ConstructConfigurationException)1 Delete (es.bsc.compss.types.data.operation.Delete)1 DeferredCopy (es.bsc.compss.types.data.operation.copy.DeferredCopy)1 ImmediateCopy (es.bsc.compss.types.data.operation.copy.ImmediateCopy)1 ThreadPool (es.bsc.compss.util.ThreadPool)1 URISyntaxException (java.net.URISyntaxException)1 GATContext (org.gridlab.gat.GATContext)1