use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class HadoopAbstractMapReduceTest method igfsConfiguration.
/** {@inheritDoc} */
@Override
public FileSystemConfiguration igfsConfiguration() throws Exception {
FileSystemConfiguration fsCfg = super.igfsConfiguration();
secondaryFs = new IgniteHadoopIgfsSecondaryFileSystem(SECONDARY_URI, SECONDARY_CFG);
fsCfg.setSecondaryFileSystem(secondaryFs);
return fsCfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class HadoopAbstractSelfTest method igfsConfiguration.
/**
* @return IGFS configuration.
* @throws Exception If failed.
*/
public FileSystemConfiguration igfsConfiguration() throws Exception {
FileSystemConfiguration cfg = new FileSystemConfiguration();
cfg.setName(igfsName);
cfg.setBlockSize(igfsBlockSize);
cfg.setDataCacheConfiguration(dataCacheConfiguration());
cfg.setMetaCacheConfiguration(metaCacheConfiguration());
cfg.setFragmentizerEnabled(false);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsSizeSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(IGFS_NAME);
igfsCfg.setBlockSize(BLOCK_SIZE);
igfsCfg.setFragmentizerEnabled(false);
igfsCfg.setManagementPort(++mgmtPort);
CacheConfiguration dataCfg = defaultCacheConfiguration();
dataCfg.setCacheMode(cacheMode);
if (cacheMode == PARTITIONED) {
if (nearEnabled)
dataCfg.setNearConfiguration(new NearCacheConfiguration());
dataCfg.setBackups(0);
}
dataCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCfg.setRebalanceMode(SYNC);
dataCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCfg = defaultCacheConfiguration();
metaCfg.setCacheMode(REPLICATED);
metaCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCfg.setRebalanceMode(SYNC);
metaCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setMetaCacheConfiguration(metaCfg);
igfsCfg.setDataCacheConfiguration(dataCfg);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
if (memIgfsdDataPlcSetter != null)
memIgfsdDataPlcSetter.apply(cfg);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsMetricsSelfTest method primaryConfiguration.
/**
* Get configuration for a grid with the primary file system.
*
* @param idx Node index.
* @return Configuration.
* @throws Exception If failed.
*/
@SuppressWarnings("unchecked")
private IgniteConfiguration primaryConfiguration(int idx) throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(IGFS_PRIMARY);
igfsCfg.setBlockSize(PRIMARY_BLOCK_SIZE);
igfsCfg.setDefaultMode(DUAL_SYNC);
igfsCfg.setSecondaryFileSystem(igfsSecondary.asSecondary());
Map<String, IgfsMode> pathModes = new HashMap<>();
pathModes.put("/primary", PRIMARY);
igfsCfg.setPathModes(pathModes);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setNearConfiguration(null);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("grid-" + idx);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsMetricsSelfTest method startSecondary.
/**
* Start a grid with the secondary file system.
*
* @throws Exception If failed.
*/
@SuppressWarnings("unchecked")
private void startSecondary() throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(IGFS_SECONDARY);
igfsCfg.setBlockSize(SECONDARY_BLOCK_SIZE);
igfsCfg.setDefaultMode(PRIMARY);
igfsCfg.setIpcEndpointConfiguration(SECONDARY_REST_CFG);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setNearConfiguration(null);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("grid-secondary");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
Ignite g = G.start(cfg);
igfsSecondary = (IgfsImpl) g.fileSystem(IGFS_SECONDARY);
}
Aggregations