/** {@inheritDoc} */ @Override public void run() { IgfsException err = null; try { clear(); } catch (Throwable err0) { err = IgfsUtils.toIgfsException(err0); } finally { if (err == null) fut.onDone(); else fut.onDone(err); } } }
/** * Check root property update. * * @throws Exception If failed. */ private void checkRootPropertyUpdate(String prop, String setVal, String expGetVal) throws Exception { igfs.update(IgfsPath.ROOT, Collections.singletonMap(prop, setVal)); igfs.clear(); IgfsFile file = igfs.info(IgfsPath.ROOT); assert file != null; Map<String,String> props = file.properties(); assertEquals(expGetVal, props.get(prop)); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { if (lsnr != null) { grid(1).events().stopLocalListen(lsnr, EVTS_IGFS); lsnr = null; } // Clean up file system. if (igfs != null) igfs.clear(); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { try { // Cleanup. igfsPrimary.clear(); while (!dataCache.isEmpty()) U.sleep(100); checkEvictionPolicy(0, 0); } finally { stopAllGrids(false); } }
/** * @throws Exception If failed. */ @Test public void testDeleteFragmentizing() throws Exception { IgfsImpl igfs = (IgfsImpl)grid(0).fileSystem("igfs"); for (int i = 0; i < 30; i++) { IgfsPath path = new IgfsPath("/someFile" + i); try (IgfsOutputStream out = igfs.create(path, true)) { for (int j = 0; j < 5 * IGFS_GROUP_SIZE; j++) out.write(new byte[IGFS_BLOCK_SIZE]); } U.sleep(200); } igfs.clear(); GridTestUtils.retryAssert(log, 50, 100, new CA() { @Override public void apply() { for (int i = 0; i < NODE_CNT; i++) { IgniteEx g = grid(i); GridCacheAdapter<Object, Object> cache = ((IgniteKernal)g).internalCache( g.igfsx("igfs").configuration().getDataCacheConfiguration().getName()); assertTrue("Data cache is not empty [keys=" + cache.keySet() + ", node=" + g.localNode().id() + ']', cache.isEmpty()); } } }); }
/** {@inheritDoc} */ @Override public void run() { IgfsException err = null; try { clear(); } catch (Throwable err0) { err = IgfsUtils.toIgfsException(err0); } finally { if (err == null) fut.onDone(); else fut.onDone(err); } } }