@Override public Boolean call() throws Exception { return ig.active(); } }
@Override public Boolean call() throws Exception { return ig.active(); } });
/** {@inheritDoc} */ @Override public void active(boolean active) { checkIgnite(); g.active(active); }
/** {@inheritDoc} */ @Override public boolean active() { checkIgnite(); return g.active(); }
@Override public Void call() throws Exception { barrier.await(); ig3C.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig1B.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig1C.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig1B.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig3B.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig2C.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig2B.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig2B.active(true); return null; } });
@Override public Void call() throws Exception { barrier.await(); ig3B.active(true); return null; } });
/** * Starts and activates new grid with given index. * * @param idx Index of the grid to start. * @return Started and activated grid. * @throws Exception If anything failed. */ @NotNull private Ignite startActivateGrid(int idx) throws Exception { final Ignite ignite = startGrid(idx); ignite.active(true); return ignite; }
/** * @throws Exception If failed. */ @Test public void testSemaphoreVolatility() throws Exception { Ignite ignite = startGrids(4); ignite.active(true); IgniteSemaphore sem = ignite.semaphore("test", 10, false, true); assert sem != null; stopAllGrids(); ignite = startGrids(4); ignite.active(true); sem = ignite.semaphore("test", 10, false, false); assert sem == null; }
/** * @throws Exception If failed. */ @Test public void testLatchVolatility() throws Exception { Ignite ignite = startGrids(4); ignite.active(true); IgniteCountDownLatch latch = ignite.countDownLatch("test", 10, false, true); assert latch != null; stopAllGrids(); ignite = startGrids(4); ignite.active(true); latch = ignite.countDownLatch("test", 10, false, false); assert latch == null; }
/** */ private Map<Integer, Integer> startGridsAndLoadData(int srvs) throws Exception { Ignite srv = startGrids(srvs); srv.active(true); srv.createCaches(Arrays.asList(cacheConfigurations1())); Map<Integer, Integer> cacheData = new LinkedHashMap<>(); for (int i = 1; i <= 100; i++) { for (CacheConfiguration ccfg : cacheConfigurations1()) { srv.cache(ccfg.getName()).put(-i, i); cacheData.put(-i, i); } } return cacheData; }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); stopAllGrids(); final Ignite crd = startGrid(DUMMY_GRID_NAME); crd.active(true); startGrid("client"); }
/** * @throws Exception If failed. */ @Test public void testCreateDropCache() throws Exception { ccfgs = new CacheConfiguration[]{cacheConfiguration(GROUP1, "c1", PARTITIONED, ATOMIC, 1) .setIndexedTypes(Integer.class, Person.class)}; Ignite ignite = startGrid(); ignite.active(true); ignite.cache("c1").destroy(); stopGrid(); }