/** * Returns checkpoint manager instance for given Grid. * * @param ignite Grid instance. * @return Checkpoint manager. */ private GridCheckpointManager checkpoints(Ignite ignite) { assert ignite != null; return ((IgniteKernal) ignite).context().checkpoint(); }
/** * @param ses Session. * @param key Key. * @return {@code True} if removed. * @throws IgniteException If failed. */ protected boolean removeCheckpoint0(GridTaskSessionInternal ses, String key) throws IgniteException { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); if (closed) throw new IgniteException("Failed to remove checkpoint (session closed): " + ses); checkFullSupport(); return ctx.checkpoint().removeCheckpoint(ses, key); }
/** * @param ses Session. * @param key Key. * @return Checkpoint. * @throws IgniteException If failed. */ protected <T> T loadCheckpoint0(GridTaskSessionInternal ses, String key) { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); if (closed) throw new IgniteException("Failed to load checkpoint (session closed): " + ses); checkFullSupport(); try { return (T) ctx.checkpoint().loadCheckpoint(ses, key); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** * @param ses Session. * @param key Key. * @param state State. * @param scope Scope. * @param timeout Timeout. * @param overwrite Overwrite. * @throws IgniteException If failed. */ protected void saveCheckpoint0(GridTaskSessionInternal ses, String key, Object state, ComputeTaskSessionScope scope, long timeout, boolean overwrite) throws IgniteException { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); A.ensure(timeout >= 0, "timeout >= 0"); if (closed) throw new IgniteException("Failed to save checkpoint (session closed): " + ses); checkFullSupport(); try { ctx.checkpoint().storeCheckpoint(ses, key, state, scope, timeout, overwrite); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
ctx.checkpoint().onSessionEnd(ses, true);
ctx.checkpoint().onSessionEnd(ses, false);
/** * @param ses Session. * @param key Key. * @return {@code True} if removed. * @throws IgniteException If failed. */ protected boolean removeCheckpoint0(GridTaskSessionInternal ses, String key) throws IgniteException { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); if (closed) throw new IgniteException("Failed to remove checkpoint (session closed): " + ses); checkFullSupport(); return ctx.checkpoint().removeCheckpoint(ses, key); }
/** * @param ses Session. * @param key Key. * @return Checkpoint. * @throws IgniteException If failed. */ protected <T> T loadCheckpoint0(GridTaskSessionInternal ses, String key) { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); if (closed) throw new IgniteException("Failed to load checkpoint (session closed): " + ses); checkFullSupport(); try { return (T) ctx.checkpoint().loadCheckpoint(ses, key); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** * @param ses Session. * @param key Key. * @param state State. * @param scope Scope. * @param timeout Timeout. * @param overwrite Overwrite. * @throws IgniteException If failed. */ protected void saveCheckpoint0(GridTaskSessionInternal ses, String key, Object state, ComputeTaskSessionScope scope, long timeout, boolean overwrite) throws IgniteException { assert ses != null; // Internal call, so assert should be enough. A.notNull(key, "key"); A.ensure(timeout >= 0, "timeout >= 0"); if (closed) throw new IgniteException("Failed to save checkpoint (session closed): " + ses); checkFullSupport(); try { ctx.checkpoint().storeCheckpoint(ses, key, state, scope, timeout, overwrite); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
ctx.checkpoint().onSessionEnd(ses, true);
ctx.checkpoint().onSessionEnd(ses, false);