use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsNearOnlyMultiNodeSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER).setForceServerMode(true));
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setDataCacheConfiguration(cacheConfiguration(igniteInstanceName, "data"));
igfsCfg.setMetaCacheConfiguration(cacheConfiguration(igniteInstanceName, "meta"));
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.SHMEM);
endpointCfg.setPort(IpcSharedMemoryServerEndpoint.DFLT_IPC_PORT + cnt);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
// Together with group blocks mapper will yield 64M per node groups.
igfsCfg.setBlockSize(512 * 1024);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
if (cnt == 0)
cfg.setClientMode(true);
cnt++;
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemAbstractSelfTest method igfsConfiguration.
/**
* Gets IGFS configuration.
*
* @param igniteInstanceName Ignite instance name.
* @return IGFS configuration.
*/
protected FileSystemConfiguration igfsConfiguration(String igniteInstanceName) throws IgniteCheckedException {
FileSystemConfiguration cfg = new FileSystemConfiguration();
cfg.setDataCacheConfiguration(dataCacheConfiguration(igniteInstanceName));
cfg.setMetaCacheConfiguration(metaCacheConfiguration(igniteInstanceName));
cfg.setName("igfs");
cfg.setPrefetchBlocks(1);
cfg.setDefaultMode(mode);
if (mode != PRIMARY) {
CachingHadoopFileSystemFactory fac = new CachingHadoopFileSystemFactory();
fac.setUri(SECONDARY_URI);
fac.setConfigPaths(SECONDARY_CFG_PATH);
IgniteHadoopIgfsSecondaryFileSystem sec = new IgniteHadoopIgfsSecondaryFileSystem();
sec.setFileSystemFactory(fac);
sec.setDefaultUserName(SECONDARY_FS_USER);
// NB: start() will be invoked upon IgfsImpl init.
cfg.setSecondaryFileSystem(sec);
}
cfg.setIpcEndpointConfiguration(primaryIpcEndpointConfiguration(igniteInstanceName));
cfg.setManagementPort(-1);
// Together with group blocks mapper will yield 64M per node groups.
cfg.setBlockSize(512 * 1024);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsFragmentizerAbstractSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
// Need to set this to avoid thread starvation.
igfsCfg.setPerNodeParallelBatchCount(8);
igfsCfg.setFragmentizerThrottlingBlockLength(16 * IGFS_BLOCK_SIZE);
igfsCfg.setFragmentizerThrottlingDelay(10);
igfsCfg.setMetaCacheConfiguration(metaConfiguration());
igfsCfg.setDataCacheConfiguration(dataConfiguration());
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsStreamsSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setLateAffinityAssignment(false);
cfg.setCacheConfiguration();
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(CFG_BLOCK_SIZE);
igfsCfg.setFragmentizerEnabled(true);
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsTaskSelfTest method config.
/**
* Create grid configuration.
*
* @param idx Node index.
* @return Grid configuration
*/
private IgniteConfiguration config(int idx) {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(BLOCK_SIZE);
igfsCfg.setDefaultMode(PRIMARY);
igfsCfg.setFragmentizerEnabled(false);
CacheConfiguration dataCacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(1));
dataCacheCfg.setBackups(0);
CacheConfiguration metaCacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setIgniteInstanceName("node-" + idx);
return cfg;
}
Aggregations