/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(ctx.kernalContext()); out.writeUTF(name); }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(ctx.kernalContext()); out.writeUTF(name); }
/** {@inheritDoc} */ @Override public <T> T unwrap(Class<T> cls) { if (cls.isAssignableFrom(Ignite.class)) return (T)cctx.kernalContext().grid(); else if (cls.isAssignableFrom(GridCacheContext.class)) return (T)cctx; else if (cls.isAssignableFrom(getClass())) return cls.cast(this); throw new IllegalArgumentException("Unwrapping to class is not supported: " + cls); }
/** * @param cctx Cache context. * @param timeout Transaction timeout. * @return Newly started SQL transaction. */ public static GridNearTxLocal txStart(GridCacheContext cctx, long timeout) { return txStart(cctx.kernalContext(), cctx, timeout); }
/** * @param cctx Cache context. */ public GridCacheMultiTxFuture(GridCacheContext<K, V> cctx) { if (log == null) log = U.logger(cctx.kernalContext(), logRef, GridCacheMultiTxFuture.class); }
/** * Checks if IndexinSPI is enabled. * * @return IndexingSPI enabled flag. */ private boolean isIndexingSpiEnabled() { return cctx.kernalContext().indexing().enabled(); }
/** * @param qry Query. * @return Filter. */ private IndexingQueryFilter filter(GridCacheQueryAdapter<?> qry) { if (qry.includeBackups()) return null; return new IndexingQueryFilterImpl(cctx.kernalContext(), AffinityTopologyVersion.NONE, null); }
/** * @param cctx Cache context. * @param tableName Target table name. */ TableCacheFilter(GridCacheContext cctx, String tableName) { this.cctx = cctx; this.tableName = tableName; cacheName = cctx.name(); query = cctx.kernalContext().query(); }
/** {@inheritDoc} */ @Override public GridNearTxLocal txStartEx(TransactionConcurrency concurrency, TransactionIsolation isolation) { IgniteTransactionsEx txs = ctx.kernalContext().cache().transactions(); return txs.txStartEx(ctx, concurrency, isolation); }
/** {@inheritDoc} */ @Override public void close() { try { if (rmvd) return; ctx.kernalContext().dataStructures().removeSet(name, ctx); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override public void enableStatistics(boolean enabled) { GridCacheContext<K, V> ctx = getContextSafe(); try { ctx.kernalContext().cache().enableStatistics(Collections.singleton(getName()), enabled); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(cctx.kernalContext()); U.writeString(out, name()); U.writeString(out, cctx.group().name()); }
/** * @param routineId Consume ID. */ public void cancelInternalQuery(UUID routineId) { try { cctx.kernalContext().continuous().stopRoutine(routineId).get(); } catch (IgniteCheckedException | IgniteException e) { if (log.isDebugEnabled()) log.debug("Failed to stop internal continuous query: " + e.getMessage()); } }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(cctx.kernalContext()); U.writeString(out, name()); U.writeString(out, cctx.group().name()); }
/** {@inheritDoc} */ @Override public IgniteFuture<?> closeAsync() { GridCacheContext<K, V> ctx = getContextSafe(); return new IgniteFutureImpl<>(ctx.kernalContext().cache().dynamicCloseCache(cacheName)); }
/** {@inheritDoc} */ @Override public final Map<K, V> getAll0(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer) throws IgniteCheckedException { A.notNull(keys, "keys"); String taskName = ctx.kernalContext().job().currentTaskName(); return getAllInternal(keys, ctx.readThrough(), taskName, deserializeBinary, false, needVer); }
/** {@inheritDoc} */ @Override protected UpdateSourceIterator<?> createIterator() throws IgniteCheckedException { checkPartitions(parts); return cctx.kernalContext().query().prepareDistributedUpdate(cctx, cacheIds, parts, schema, qry, params, flags, pageSize, 0, tx.topologyVersionSnapshot(), mvccSnapshot, new GridQueryCancel()); }
/** * @param type Event type. * @return {@code True} if event is recordable. */ public boolean isRecordable(int type) { GridCacheContext cctx0 = cctx; // Event recording is impossible in recovery mode. if (cctx0 != null && cctx0.kernalContext().recoveryMode()) return false; return cctx0 != null && cctx0.userCache() && cctx0.gridEvents().isRecordable(type) && !cctx0.config().isEventsDisabled(); }
/** */ protected GridNearTxLocal checkCurrentTx() { if (!ctx.mvccEnabled()) return ctx.tm().threadLocalTx(ctx); try { return MvccUtils.currentTx(ctx.kernalContext(), null); } catch (MvccUtils.UnsupportedTxModeException | MvccUtils.NonMvccTransactionException e) { throw new TransactionException(e.getMessage()); } }
/** {@inheritDoc} */ @Override public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation) { A.notNull(concurrency, "concurrency"); A.notNull(isolation, "isolation"); TransactionConfiguration cfg = CU.transactionConfiguration(ctx, ctx.kernalContext().config()); return txStart( concurrency, isolation, cfg.getDefaultTxTimeout(), 0 ); }