/** * @param blocks Blocks to write. * @return Future that will be completed after put is done. */ @SuppressWarnings("unchecked") private GridFuture<?> storeBlocksAsync(Map<GridGgfsBlockKey, byte[]> blocks) { assert !blocks.isEmpty(); if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { try { try { ggfs.awaitDeletesAsync().get(trashPurgeTimeout); } catch (GridFutureTimeoutException ignore) { // Ignore. } // Additional size check. if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) return new GridFinishedFuture<Object>(ggfsCtx.kernalContext(), new GridGgfsOutOfSpaceException("Failed to write data block (GGFS maximum data size " + "exceeded) [used=" + dataCachePrj.ggfsDataSpaceUsed() + ", allowed=" + dataCachePrj.ggfsDataSpaceMax() + ']')); } catch (GridException e) { return new GridFinishedFuture<>(ggfsCtx.kernalContext(), new GridException("Failed to store data " + "block due to unexpected exception.", e)); } } return dataCachePrj.putAllAsync(blocks); }
/** * @param blocks Blocks to write. * @return Future that will be completed after put is done. */ @SuppressWarnings("unchecked") private GridFuture<?> storeBlocksAsync(Map<GridGgfsBlockKey, byte[]> blocks) { assert !blocks.isEmpty(); if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { try { try { ggfs.awaitDeletesAsync().get(trashPurgeTimeout); } catch (GridFutureTimeoutException ignore) { // Ignore. } // Additional size check. if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) return new GridFinishedFuture<Object>(ggfsCtx.kernalContext(), new GridGgfsOutOfSpaceException("Failed to write data block (GGFS maximum data size " + "exceeded) [used=" + dataCachePrj.ggfsDataSpaceUsed() + ", allowed=" + dataCachePrj.ggfsDataSpaceMax() + ']')); } catch (GridException e) { return new GridFinishedFuture<>(ggfsCtx.kernalContext(), new GridException("Failed to store data " + "block due to unexpected exception.", e)); } } return dataCachePrj.putAllAsync(blocks); }
if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { try { ggfs.awaitDeletesAsync().get(trashPurgeTimeout);
if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { try { ggfs.awaitDeletesAsync().get(trashPurgeTimeout);