/** * Leaves busy state. */ private void leaveBusy() { busyLock.leaveBusy(); } }
/** * Leaves busy state. */ private void leaveBusy() { busyLock.leaveBusy(); }
/** * */ final void onProcessEnd() { busyLock.leaveBusy(); }
/** * Leaves busy state. */ private void leaveBusy() { busyLock.leaveBusy(); }
/** {@inheritDoc} */ @Override public void onUpdated(final Iterable<CacheEntryEvent<?, ?>> deps) { GridSpinBusyLock busyLock = GridServiceProcessor.this.busyLock; if (busyLock == null || !busyLock.enterBusy()) return; try { depExe.execute(new DepRunnable() { @Override public void run0() { onSystemCacheUpdated(deps); } }); } finally { busyLock.leaveBusy(); } } }
/** {@inheritDoc} */ @Nullable @Override public HadoopCounters counters(HadoopJobId jobId) throws IgniteCheckedException { if (busyLock.enterBusy()) { try { return proc.counters(jobId); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to get job counters (grid is stopping)."); }
/** {@inheritDoc} */ @Nullable @Override public HadoopJobStatus status(HadoopJobId jobId) throws IgniteCheckedException { if (busyLock.enterBusy()) { try { return proc.status(jobId); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to get job status (grid is stopping)."); }
/** {@inheritDoc} */ @Nullable @Override public IgniteInternalFuture<?> finishFuture(HadoopJobId jobId) throws IgniteCheckedException { if (busyLock.enterBusy()) { try { return proc.finishFuture(jobId); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to get job finish future (grid is stopping)."); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> submit(HadoopJobId jobId, HadoopJobInfo jobInfo) { if (busyLock.enterBusy()) { try { return proc.submit(jobId, jobInfo); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to submit job (grid is stopping)."); }
/** {@inheritDoc} */ @Override public HadoopJobId nextJobId() { if (busyLock.enterBusy()) { try { return proc.nextJobId(); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to get next job ID (grid is stopping)."); }
@Override public void run() { if (!busyLock.enterBusy()) return; try { locNodeHnd.apply(finalLocNode, finalMsg); } finally { busyLock.leaveBusy(); } } }, plc).listen(logger);
/** {@inheritDoc} */ @Override public boolean kill(HadoopJobId jobId) throws IgniteCheckedException { if (busyLock.enterBusy()) { try { return proc.kill(jobId); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to kill job (grid is stopping)."); } }
/** * @param cacheInfo Cache context info. * @param removeIdx If {@code true}, will remove index. */ public void onCacheStop(GridCacheContextInfo cacheInfo, boolean removeIdx) { if (idx == null) return; if (!busyLock.enterBusy()) return; try { onCacheStop0(cacheInfo, removeIdx); } finally { busyLock.leaveBusy(); } }
/** * @param nodeId Node ID to fail. * @param warning Warning message to be shown on all nodes. */ public void failNode(UUID nodeId, @Nullable String warning) { if (!busyLock.enterBusy()) return; try { getSpi().failNode(nodeId, warning); } finally { busyLock.leaveBusy(); } }
@Override public void onMessage(UUID nodeId, Object msg, byte plc) { GridSpinBusyLock l = desc.indexing().busyLock(); if (!l.enterBusy()) return; try { onMessage0(nodeId, msg); } finally { l.leaveBusy(); } } };
/** * @param cacheName Cache name. * @param key Key. * @throws IgniteCheckedException Thrown in case of any errors. */ public void remove(String cacheName, Object key) throws IgniteCheckedException { assert key != null; assert enabled(); if (!busyLock.enterBusy()) throw new IllegalStateException("Failed to remove from index (grid is stopping)."); try { getSpi().remove(cacheName, key); } finally { busyLock.leaveBusy(); } }
/** * @param nodeId ID of the node. * @return {@code True} if ping succeeded. */ public boolean pingNodeNoError(UUID nodeId) { assert nodeId != null; if (!busyLock.enterBusy()) return false; try { return getSpi().pingNode(nodeId); } catch (IgniteException ignored) { return false; } finally { busyLock.leaveBusy(); } }
@SuppressWarnings("deprecation") @Override public void onMessage(UUID nodeId, Object msg, byte plc) { if (!busyLock.enterBusy()) return; try { if (msg instanceof GridCacheQueryMarshallable) ((GridCacheQueryMarshallable)msg).unmarshall(ctx.config().getMarshaller(), ctx); GridMapQueryExecutor.this.onMessage(nodeId, msg); } finally { busyLock.leaveBusy(); } } });
@Override protected void body() throws InterruptedException { while (!isCancelled()) { DataStreamerImpl<K, V> ldr = flushQ.take(); if (!busyLock.enterBusy()) return; try { if (ldr.isClosed()) continue; ldr.tryFlush(); flushQ.offer(ldr); } finally { busyLock.leaveBusy(); } } } });
/** {@inheritDoc} */ @Override public void remove(GridCacheContext cctx, KeyCacheObject key, int partId) throws IgniteCheckedException { if (!busyLock.enterBusy()) throw new NodeStoppingException("Operation has been cancelled (node is stopping)."); try { int cacheId = grp.sharedGroup() ? cctx.cacheId() : CU.UNDEFINED_CACHE_ID; assert cctx.shared().database().checkpointLockIsHeldByThread(); CacheDataRow oldRow = dataTree.remove(new SearchRow(cacheId, key)); finishRemove(cctx, key, oldRow); } finally { busyLock.leaveBusy(); } }