/** {@inheritDoc} */ @Override public boolean removeCheckpoint(String key) { A.notNull(key, "key"); guard(); try { return ctx.checkpoint().removeCheckpoint(key); } finally { unguard(); } }
/** * @param ses Session. * @param key Key. * @return {@code True} if removed. * @throws GridException If failed. */ protected boolean removeCheckpoint0(GridTaskSessionInternal ses, String key) throws GridException { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); if (closed) throw new GridException("Failed to remove checkpoint (session closed): " + ses); checkFullSupport(); return ctx.checkpoint().removeCheckpoint(ses, key); }
/** * @param ses Session. * @param key Key. * @return Checkpoint. * @throws GridException If failed. */ protected <T> T loadCheckpoint0(GridTaskSessionInternal ses, String key) throws GridException { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); if (closed) throw new GridException("Failed to load checkpoint (session closed): " + ses); checkFullSupport(); return (T)ctx.checkpoint().loadCheckpoint(ses, key); }
/** * @param ses Session. * @param key Key. * @param state State. * @param scope Scope. * @param timeout Timeout. * @param overwrite Overwrite. * @throws GridException If failed. */ protected void saveCheckpoint0(GridTaskSessionInternal ses, String key, Object state, GridComputeTaskSessionScope scope, long timeout, boolean overwrite) throws GridException { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); A.ensure(timeout >= 0, "timeout >= 0"); if (closed) throw new GridException("Failed to save checkpoint (session closed): " + ses); checkFullSupport(); ctx.checkpoint().storeCheckpoint(ses, key, state, scope, timeout, overwrite); }
/** * @param ctx Context. * @param cfg Configuration to check for possible performance issues. */ private void suggestOptimizations(GridKernalContext ctx, GridConfiguration cfg) { GridPerformanceSuggestions perf = ctx.performance(); if (ctx.collision().enabled()) perf.add("Disable collision resolution (remove 'collisionSpi' from configuration)"); if (ctx.checkpoint().enabled()) perf.add("Disable checkpoints (remove 'checkpointSpi' from configuration)"); if (cfg.isPeerClassLoadingEnabled()) perf.add("Disable peer class loading (set 'peerClassLoadingEnabled' to false)"); if (cfg.isMarshalLocalJobs()) perf.add("Disable local jobs marshalling (set 'marshalLocalJobs' to false)"); if (cfg.getIncludeEventTypes() != null && cfg.getIncludeEventTypes().length != 0) perf.add("Disable grid events (remove 'includeEventTypes' from configuration)"); if (GridOptimizedMarshaller.available() && !(cfg.getMarshaller() instanceof GridOptimizedMarshaller)) perf.add("Enable optimized marshaller (set 'marshaller' to " + GridOptimizedMarshaller.class.getSimpleName() + ')'); }
ctx.checkpoint().onSessionEnd(ses, true);
ctx.checkpoint().onSessionEnd(ses, false);