@Override public Object call() throws Exception { futs.add(kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME, false, true, false, null)); return null; } }, threadNum, "cache-stopper");
@Override public Object call() throws Exception { ignite1.compute(ignite1.cluster().forNode(ignite0.localNode())).call(new IgniteCallable<Object>() { @Override public Object call() throws Exception { jobCtx.setAttribute("test-attr", new BrokenAttribute()); return null; } }); return null; } }, IgniteException.class, null);
/** Checks that a bean with the specified group and name is available and has the expected attribute */ private void checkBean(String grp, String name, String attributeName, Object expAttributeVal) throws Exception { ObjectName mBeanName = IgniteUtils.makeMBeanName(grid().name(), grp, name); Object attributeVal = grid().configuration().getMBeanServer().getAttribute(mBeanName, attributeName); assertEquals(expAttributeVal, attributeVal); } }
/** {@inheritDoc} */ @Override protected VisorBinaryMetadataCollectorTaskResult run(VisorBinaryMetadataCollectorTaskArg arg) { Marshaller marsh = ignite.configuration().getMarshaller(); IgniteBinary binary = marsh == null || marsh instanceof BinaryMarshaller ? ignite.binary() : null; return new VisorBinaryMetadataCollectorTaskResult(0L, VisorBinaryMetadata.list(binary)); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); startGrids(2); grid(0).cluster().active(true); AuthorizationContext.context(grid(0).context().authentication().authenticate("ignite", "ignite")); grid(0).context().authentication().addUser("another_user", "passwd"); AuthorizationContext.clear(); }
/** * Convert object to binary form. * * @param src Source object. * @return Result. */ private Object toBinary(Object src) { return platformCtx.kernalContext().grid().binary().toBinary(src); }
/** * */ public void consistencyCheck(IgniteEx ignite) { IgniteCache<Integer, TestValue> cache = ignite.getOrCreateCache(cacheName); for (int key = 0; key < KEYS_SPACE; key++) { TestValue expectedVal = locCache.get(key); TestValue actualVal = cache.get(key); Assert.assertEquals("Consistency check failed for: " + cache.getName() + ", key=" + key, expectedVal, actualVal); } }
/** * @param ignite Ignite. * @param keysCnt Keys count. */ private void checkData(IgniteEx ignite, int keysCnt, int multiplier) { log.info("Check data: " + ignite.name() + ", keys=" + keysCnt); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); for (int k = 0; k < keysCnt; k++) Assert.assertEquals("node = " + ignite.name() + ", key = " + k, (Integer) (k * multiplier), cache.get(k)); }
/** {@inheritDoc} */ @Override protected Void run(VisorChangeGridActiveStateTaskArg arg) { ignite.active(arg.isActive()); return null; }
/** * * @param g */ protected void checkIsClientFlag(IgniteEx g) { boolean isClientDiscovery = g.context().discovery().localNode().isClient(); boolean isClientConfig = g.configuration().isClientMode() == null ? false : g.configuration().isClientMode(); assertEquals(isClientConfig, isClientDiscovery); }
/** * @param cacheName Cache name. * @throws Exception If failed. */ private void createCacheWithAffinity(String cacheName) throws Exception { CacheConfiguration ccfg = cacheConfiguration(grid(0).name()); ccfg.setName(cacheName); ccfg.setAffinity(new DummyAffinity()); grid(0).createCache(ccfg); }
@Override public Void call() throws Exception { barrier.await(); grid(3).compute().withNoFailover().broadcast(new IgniteRunnable() { @Override public void run() { // No-op. } }); return null; } });
@Override public Void call() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).putAll(m); return null; } }, CacheWriterException.class, null);
@Override public void run() { try { ignite0.cluster().active(true); } catch (Exception ignore) { // No-op. } } });
/** * @param backups Backups number. * @throws Exception If failed. */ private void doStartGrids(int backups) throws Exception { this.backups = backups; startGrids(GRID_CNT); awaitPartitionMapExchange(); log.info("Grids: "); for (int i = 0; i < GRID_CNT; i++) log.info(grid(i).name() + ": " + grid(i).localNode().id()); }
/** * @param ctx Kernal context. */ @SuppressWarnings("deprecation") public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { super(ctx); marsh = ctx.grid().configuration().getMarshaller(); }
/** * @throws Exception On error. */ @Test public void testEvictPagesWithDiskStorageWithOtherCacheInGroup() throws Exception { persistenceEnabled = true; startGrid(); grid().active(true); grid().getOrCreateCache(cacheConfiguration("cacheWithoutOnHeapCache", false)); checkRowCacheOnPageEviction(); }
@Override public void run() { for (IgniteEx ig : grids()) { try { cls.apply(ig); } catch (AssertionError e) { System.out.println("Assertion on " + ig.name()); throw e; } } } };