/** * @param cache Cache. * @param cnt Keys count. * @param startFrom Start value for keys search. * @return Collection of keys for which given cache is primary. */ protected <T> List<T> primaryKeys(IgniteCache<?, ?> cache, final int cnt, final T startFrom) { return findPrimaryKeys(cache, cnt, startFrom); }
/** * @param cache Cache. * @return Key for which given cache is primary. * @throws IgniteCheckedException If failed. */ protected <T> T primaryKey(IgniteCache<?, ?> cache, T startFrom) throws IgniteCheckedException { return primaryKeys(cache, 1, startFrom).get(0); }
Ignite ignite = ignite(i); assertTrue(futs.isEmpty()); GridCacheAdapter<Object, Integer> intCache = internalCache(i, cacheName); assertNull("Entry still has locks " + entry, entry.mvccAllLocal()); fail("Some transactions still exist");
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); client = false; startGridsMultiThreaded(NODES_CNT); client = true; for (int i = 0; i < NODES_CNT; i++) startGrid(i + NODES_CNT); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (isDebug()) ((TcpDiscoverySpi)cfg.getDiscoverySpi()).failureDetectionTimeoutEnabled(false); TcpCommunicationSpi commSpi = new TestCommunicationSpi(); cfg.setCommunicationSpi(commSpi); cfg.setClientMode(client); return cfg; }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); client = false; startGrids(NODES_CNT); client = true; for (int i = 0; i < NODES_CNT; i++) startGrid(i + NODES_CNT); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (isDebug()) { TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.failureDetectionTimeoutEnabled(false); cfg.setDiscoverySpi(discoSpi); } DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_MAX_SIZE * 10) .setName("dfltPlc")); cfg.setDataStorageConfiguration(memCfg); cfg.setClientMode(client); return cfg; }