Search in sources :

Example 1 with StorageEndpoint

use of org.apache.crail.storage.StorageEndpoint in project incubator-crail by apache.

the class EndpointCache method getDataEndpoint.

public StorageEndpoint getDataEndpoint(DataNodeInfo dataNodeInfo) throws IOException, InterruptedException {
    StorageEndpointCache cache = storageCaches.get(dataNodeInfo.getStorageType());
    StorageEndpoint endpoint = cache.getDataEndpoint(dataNodeInfo);
    return endpoint;
// return storageCaches.get(dataNodeInfo.getStorageType()).getDataEndpoint(dataNodeInfo);
}
Also used : StorageEndpoint(org.apache.crail.storage.StorageEndpoint)

Example 2 with StorageEndpoint

use of org.apache.crail.storage.StorageEndpoint in project incubator-crail by apache.

the class CoreStream method prepareAndTrigger.

private StorageFuture prepareAndTrigger(CoreSubOperation opDesc, CrailBuffer dataBuf, BlockInfo block) throws Exception {
    try {
        StorageEndpoint endpoint = endpointCache.getDataEndpoint(block.getDnInfo());
        dataBuf.clear();
        dataBuf.position(opDesc.getBufferPosition());
        dataBuf.limit(dataBuf.position() + opDesc.getLen());
        StorageFuture subFuture = trigger(endpoint, opDesc, dataBuf, block);
        incStats(endpoint.isLocal());
        return subFuture;
    } catch (IOException e) {
        LOG.info("ERROR: failed data operation");
        e.printStackTrace();
        throw e;
    }
}
Also used : StorageFuture(org.apache.crail.storage.StorageFuture) StorageEndpoint(org.apache.crail.storage.StorageEndpoint) IOException(java.io.IOException)

Aggregations

StorageEndpoint (org.apache.crail.storage.StorageEndpoint)2 IOException (java.io.IOException)1 StorageFuture (org.apache.crail.storage.StorageFuture)1