/** {@inheritDoc} */ @Override public GridFuture<?> awaitDeletesAsync() throws GridException { Collection<GridUuid> ids = meta.pendingDeletes(); if (!ids.isEmpty()) { if (log.isDebugEnabled()) log.debug("Constructing delete future for trash entries: " + ids); GridCompoundFuture<Object, Object> resFut = new GridCompoundFuture<>(ggfsCtx.kernalContext()); for (GridUuid id : ids) { GridFutureAdapter<Object> fut = new GridFutureAdapter<>(ggfsCtx.kernalContext()); GridFuture<Object> oldFut = delFuts.putIfAbsent(id, fut); if (oldFut != null) resFut.add(oldFut); else { if (meta.exists(id)) resFut.add(fut); else { fut.onDone(); delFuts.remove(id, fut); } } } resFut.markInitialized(); return resFut; } else return new GridFinishedFuture<>(ggfsCtx.kernalContext()); }
/** {@inheritDoc} */ @Override public GridFuture<?> awaitDeletesAsync() throws GridException { Collection<GridUuid> ids = meta.pendingDeletes(); if (!ids.isEmpty()) { if (log.isDebugEnabled()) log.debug("Constructing delete future for trash entries: " + ids); GridCompoundFuture<Object, Object> resFut = new GridCompoundFuture<>(ggfsCtx.kernalContext()); for (GridUuid id : ids) { GridFutureAdapter<Object> fut = new GridFutureAdapter<>(ggfsCtx.kernalContext()); GridFuture<Object> oldFut = delFuts.putIfAbsent(id, fut); if (oldFut != null) resFut.add(oldFut); else { if (meta.exists(id)) resFut.add(fut); else { fut.onDone(); delFuts.remove(id, fut); } } } resFut.markInitialized(); return resFut; } else return new GridFinishedFuture<>(ggfsCtx.kernalContext()); }