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);
}
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;
}
}
Aggregations