/** * Initialize internal cache names */ private void initializeInternalCacheNames() { FileSystemConfiguration[] igfsCfgs = ctx.grid().configuration().getFileSystemConfiguration(); if (igfsCfgs != null) { for (FileSystemConfiguration igfsCfg : igfsCfgs) { internalCaches.add(igfsCfg.getMetaCacheConfiguration().getName()); internalCaches.add(igfsCfg.getDataCacheConfiguration().getName()); } } if (IgniteComponentType.HADOOP.inClassPath()) internalCaches.add(CU.SYS_CACHE_HADOOP_MR); }
/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { metaCacheStartLatch = new CountDownLatch(1); cfg = igfsCtx.configuration(); evts = igfsCtx.kernalContext().event(); sampling = new IgfsSamplingKey(cfg.getName()); log = igfsCtx.kernalContext().log(IgfsMetaManager.class); metaCacheName = cfg.getMetaCacheConfiguration().getName(); }
@Override public Object call() throws Exception { g.cache(((IgniteKernal)g).igfsx("igfs").configuration().getMetaCacheConfiguration().getName()); return null; } }, IllegalStateException.class, null);
@Override public boolean apply() { int metaSize = 0; for (Object metaId : grid(0).cachex(igfs.configuration().getMetaCacheConfiguration().getName()) .keySet()) { if (!IgfsUtils.isRootOrTrashId((IgniteUuid)metaId)) metaSize++; } return metaSize == 0; } }, 5000);
/** * @throws Exception If failed. */ @Test public void testLocalIfQueryIndexingEnabledForMetaCache() throws Exception { g1IgfsCfg1.setMetaCacheConfiguration(metaCache()); g1IgfsCfg1.getMetaCacheConfiguration().setIndexedTypes(Integer.class, String.class); checkGridStartFails(g1Cfg, "IGFS metadata cache cannot start with enabled query indexing", true); }
continue; CacheConfiguration ccfgMeta = igfsCfg.getMetaCacheConfiguration();
/** * Gets meta cache. * * @param igfs The IGFS instance. * @return The data cache. */ protected static GridCacheAdapter<IgniteUuid, IgfsEntryInfo> getMetaCache(IgniteFileSystem igfs) { String dataCacheName = igfs.configuration().getMetaCacheConfiguration().getName(); IgniteEx igniteEx = ((IgfsEx)igfs).context().kernalContext().grid(); return ((IgniteKernal)igniteEx).internalCache(dataCacheName); }
CacheConfiguration ccfgMeta = cfg.getMetaCacheConfiguration();
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { IgniteEx grid = grid(0); igfs = grid.fileSystem(igfsName()); FileSystemConfiguration[] cfgs = grid.configuration().getFileSystemConfiguration(); assert cfgs.length == 1; metaCacheName = cfgs[0].getMetaCacheConfiguration().getName(); metaCache = ((IgniteKernal)grid).internalCache(metaCacheName); }
String metaCacheName = cfg.getMetaCacheConfiguration().getName(); igfsCfg.getBlockSize(), ((IgfsGroupDataBlocksKeyMapper)affMapper).getGroupSize(), igfsCfg.getMetaCacheConfiguration().getName(), dataCacheName, igfsCfg.getDefaultMode(),
isProxyCache(ignite, igfsCfg.getMetaCacheConfiguration().getName())) continue;
/** * @throws Exception If failed. */ @Test public void testCacheStart() throws Exception { Ignite g0 = G.start(config(true, 0)); String dataCacheName = ((IgniteEx)g0).igfsx("igfs").configuration().getDataCacheConfiguration().getName(); String metaCacheName = ((IgniteEx)g0).igfsx("igfs").configuration().getMetaCacheConfiguration().getName(); checkIgfsCaches(g0, dataCacheName, metaCacheName); Ignite g1 = G.start(config(false, 1)); checkIgfsCaches(g1, dataCacheName, metaCacheName); IgniteFileSystem igfs = g0.fileSystem("igfs"); igfs.mkdirs(new IgfsPath("/test")); try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(igfs.create( new IgfsPath("/test/test.file"), true)))) { for (int i = 0; i < 1000; i++) bw.write("test-" + i); } }
/** * @throws Exception If failed. */ @Test public void testLocalIfAffinityMapperIsWrongClass() throws Exception { for (FileSystemConfiguration igfsCfg : g1Cfg.getFileSystemConfiguration()) { igfsCfg.setDataCacheConfiguration(dataCache(1024)); igfsCfg.setMetaCacheConfiguration(metaCache()); igfsCfg.getMetaCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper()); igfsCfg.getDataCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper()); } checkGridStartFails(g1Cfg, "Invalid IGFS data cache configuration (key affinity mapper class should be", true); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { for (int i = 0; i < NODES_CNT; i++) { grid(i).cachex(grid(i).igfsx("igfs").configuration().getMetaCacheConfiguration().getName()).clear(); grid(i).cachex(grid(i).igfsx("igfs").configuration().getDataCacheConfiguration().getName()).clear(); } }
/** * Create data transfer object for IGFS configuration properties. * @param igfs IGFS configuration. */ public VisorIgfsConfiguration(FileSystemConfiguration igfs) { name = igfs.getName(); metaCacheName = igfs.getMetaCacheConfiguration().getName(); dataCacheName = igfs.getDataCacheConfiguration().getName(); blockSize = igfs.getBlockSize(); prefetchBlocks = igfs.getPrefetchBlocks(); streamBufSize = igfs.getBufferSize(); perNodeBatchSize = igfs.getPerNodeBatchSize(); perNodeParallelBatchCnt = igfs.getPerNodeParallelBatchCount(); dfltMode = igfs.getDefaultMode(); pathModes = igfs.getPathModes(); maxTaskRangeLen = igfs.getMaximumTaskRangeLength(); fragmentizerConcurrentFiles = igfs.getFragmentizerConcurrentFiles(); fragmentizerEnabled = igfs.isFragmentizerEnabled(); fragmentizerThrottlingBlockLen = igfs.getFragmentizerThrottlingBlockLength(); fragmentizerThrottlingDelay = igfs.getFragmentizerThrottlingDelay(); IgfsIpcEndpointConfiguration endpointCfg = igfs.getIpcEndpointConfiguration(); ipcEndpointCfg = endpointCfg != null ? endpointCfg.toString() : null; ipcEndpointEnabled = igfs.isIpcEndpointEnabled(); mgmtPort = igfs.getManagementPort(); seqReadsBeforePrefetch = igfs.getSequentialReadsBeforePrefetch(); colocateMeta = igfs.isColocateMetadata(); relaxedConsistency = igfs.isRelaxedConsistency(); updateFileLenOnFlush = igfs.isUpdateFileLengthOnFlush(); }
ipcEndpointEnabled = cfg.isIpcEndpointEnabled(); maxTaskRangeLen = cfg.getMaximumTaskRangeLength(); metaCacheCfg = cfg.getMetaCacheConfiguration(); mgmtPort = cfg.getManagementPort(); name = cfg.getName();
public void testCreateFileFragmented() throws Exception { IgfsEx impl = (IgfsEx)grid(0).fileSystem("igfs"); String metaCacheName = grid(0).igfsx("igfs").configuration().getMetaCacheConfiguration().getName(); final String dataCacheName = grid(0).igfsx("igfs").configuration().getDataCacheConfiguration() .getName();
/** * @throws Exception If failed. */ @Test public void testPreConfiguredCache() throws Exception { FileSystemConfiguration igfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1); igfsCfg1.setName("igfs"); g1Cfg.setFileSystemConfiguration(igfsCfg1); CacheConfiguration ccfgData = dataCache(1024); ccfgData.setRebalanceTimeout(10001); CacheConfiguration ccfgMeta = metaCache(); ccfgMeta.setRebalanceTimeout(10002); igfsCfg1.setDataCacheConfiguration(ccfgData); igfsCfg1.setMetaCacheConfiguration(ccfgMeta); IgniteEx g = (IgniteEx)G.start(g1Cfg); assertEquals(10001, g.cachex(g.igfsx("igfs").configuration().getDataCacheConfiguration().getName()) .configuration().getRebalanceTimeout()); assertEquals(10002, g.cachex(g.igfsx("igfs").configuration().getMetaCacheConfiguration().getName()) .configuration().getRebalanceTimeout()); }
IgfsPath path = new IgfsPath("/someFile"); String metaCacheName = grid(0).igfsx("igfs").configuration().getMetaCacheConfiguration().getName(); String dataCacheName = grid(0).igfsx("igfs").configuration().getDataCacheConfiguration().getName();
/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { metaCacheStartLatch = new CountDownLatch(1); cfg = igfsCtx.configuration(); evts = igfsCtx.kernalContext().event(); sampling = new IgfsSamplingKey(cfg.getName()); log = igfsCtx.kernalContext().log(IgfsMetaManager.class); metaCacheName = cfg.getMetaCacheConfiguration().getName(); }