class PartitionDefferedDeleteQueueCleanupTask implements GridTimeoutObject {
    /** */
    private final IgniteUuid id = IgniteUuid.randomUuid();

    /** */
    private final long endTime;

    /** */
    private final long timeout;

    /** */
    private final GridCacheSharedContext cctx;

    /** */
    private final IgniteLogger log;

    /**
     * @param timeout Timeout.
     */
    public PartitionDefferedDeleteQueueCleanupTask(GridCacheSharedContext cctx, long timeout) {
        this.timeout = timeout;
        endTime = U.currentTimeMillis() + timeout;
        this.cctx = cctx;
        log = cctx.logger(getClass());
    }

    /** {@inheritDoc} */
    @Override public IgniteUuid timeoutId() {
        return id;
    }

    /** {@inheritDoc} */
    @Override public long endTime() {
        return endTime;
    }

    /** {@inheritDoc} */
    @Override public void onTimeout() {
        cctx.kernalContext().closure().runLocalSafe(new GridPlainRunnable() {
            @Override public void run() {<FILL_FUNCTION_BODY>}
        }, true);
    }
}

                try {
                    for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
                        if (grp.affinityNode()) {
                            GridDhtPartitionTopology top = null;

                            try {
                                top = grp.topology();
                            }
                            catch (IllegalStateException ignore) {
                                // Cache stopped.
                            }

                            if (top != null) {
                                for (GridDhtLocalPartition part : top.currentLocalPartitions())
                                    part.cleanupRemoveQueue();
                            }

                            if (cctx.kernalContext().isStopping())
                                return;
                        }
                    }
                }
                catch (Exception e) {
                    U.error(log, "Failed to cleanup removed cache items: " + e, e);
                }

                if (cctx.kernalContext().isStopping())
                    return;

                // Re-schedule task after finish.
                cctx.time().addTimeoutObject(new PartitionDefferedDeleteQueueCleanupTask(cctx, timeout));
            
<no_super_class>