Search in sources :

Example 1 with IgfsImpl

use of org.apache.ignite.internal.processors.igfs.IgfsImpl in project ignite by apache.

the class IgfsFragmentizerSelfTest method testDeleteFragmentizing.

/**
 * @throws Exception If failed.
 */
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());
            }
        }
    });
}
Also used : IgfsImpl(org.apache.ignite.internal.processors.igfs.IgfsImpl) GridCacheAdapter(org.apache.ignite.internal.processors.cache.GridCacheAdapter) IgniteEx(org.apache.ignite.internal.IgniteEx) CA(org.apache.ignite.internal.util.typedef.CA)

Aggregations

IgniteEx (org.apache.ignite.internal.IgniteEx)1 GridCacheAdapter (org.apache.ignite.internal.processors.cache.GridCacheAdapter)1 IgfsImpl (org.apache.ignite.internal.processors.igfs.IgfsImpl)1 CA (org.apache.ignite.internal.util.typedef.CA)1