/** * <tt>ctx.gateway().readLock()</tt> */ private void guard() { ctx.gateway().readLock(); }
/** * <tt>ctx.gateway().readLock()</tt> */ private void guard() { ctx.gateway().readLock(); }
/** * <tt>ctx.gateway().readLock()</tt> */ private void guard() { ctx.gateway().readLock(); }
/** * <tt>ctx.gateway().readLock()</tt> */ private void guard() { ctx.gateway().readLock(); }
/** * <tt>ctx.gateway().readLock()</tt> */ private void guard() { ctx.gateway().readLock(); }
/** * <tt>ctx.gateway().readLock()</tt> */ private void guard() { ctx.gateway().readLock(); }
/** * <tt>ctx.gateway().readLock()</tt> */ protected void guard() { assert ctx != null; ctx.gateway().readLock(); }
/** {@inheritDoc} */ @Nullable @Override public String latestVersion() { ctx.gateway().readLock(); try { return verChecker != null ? verChecker.latestVersion() : null; } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Nullable @Override public GridProductLicense license() { ctx.gateway().readLock(); try { return ctx.license().license(); } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public GridProjection projection() { ctx.gateway().readLock(); try { return projection0(); } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public GridProjection forLocal() { ctx.gateway().readLock(); try { return new GridProjectionAdapter(this, ctx, null, Collections.singleton(cfg.getNodeId())); } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public void updateLicense(String lic) throws GridProductLicenseException { ctx.gateway().readLock(); try { ctx.license().updateLicense(lic); } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public void addEventsToStage(String stageName, Collection<?> evts) throws GridException { A.notNull(stageName, "stageName"); A.ensure(!F.isEmpty(evts), "evts cannot be empty or null"); ctx.gateway().readLock(); try { addEvents0(null, 0, U.currentTimeMillis(), null, Collections.singleton(ctx.localNodeId()), stageName, evts); } finally { ctx.gateway().readUnlock(); } }
/** * Enter a cache call. */ public void enter() { if (ctx.deploymentEnabled()) ctx.deploy().onEnter(); // Must unlock in case of unexpected errors to avoid // deadlocks during kernal stop. try { ctx.kernalContext().gateway().readLock(); } catch (IllegalStateException e) { // This exception is thrown only in case if grid has already been stopped // and we must not call readUnlock. throw e; } catch (RuntimeException | Error e) { try { ctx.kernalContext().gateway().readUnlock(); } catch (IllegalMonitorStateException ignore) { // No-op. } throw e; } }
/** {@inheritDoc} */ @Override public <R> Collection<R> query(GridClosure<GridStreamerContext, R> clo, Collection<GridNode> nodes) throws GridException { ctx.gateway().readLock(); try { GridProjection prj = projection0(); if (!F.isEmpty(nodes)) prj = prj.forNodes(nodes); long startTime = U.currentTimeMillis(); Collection<R> res = prj.compute().execute(new GridStreamerQueryTask<>(clo, streamer.name()), null).get(); streamer.onQueryCompleted(U.currentTimeMillis() - startTime, prj.nodes().size()); return res; } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public void broadcast(GridInClosure<GridStreamerContext> clo, Collection<GridNode> nodes) throws GridException { ctx.gateway().readLock(); try { GridProjection prj = projection0(); if (!F.isEmpty(nodes)) prj = prj.forNodes(nodes); prj.compute().execute(new GridStreamerBroadcastTask(clo, streamer.name()), null).get(); } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public <R1, R2> R2 reduce(GridClosure<GridStreamerContext, R1> clo, GridReducer<R1, R2> rdc, Collection<GridNode> nodes) throws GridException { ctx.gateway().readLock(); try { GridProjection prj = projection0(); if (!F.isEmpty(nodes)) prj = prj.forNodes(nodes); return prj.compute().execute(new GridStreamerReduceTask<>(clo, rdc, streamer.name()), null).get(); } finally { ctx.gateway().readUnlock(); } }
ctx.kernalContext().gateway().readLock();