use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemLoggerStateSelfTest method startUp.
/**
* Startup the grid and instantiate the file system.
*
* @throws Exception If failed.
*/
private void startUp() throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(512 * 1024);
igfsCfg.setDefaultMode(PRIMARY);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.TCP);
endpointCfg.setPort(10500);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setName("partitioned");
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.setName("replicated");
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("igfs-grid");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
Ignite g = G.start(cfg);
igfs = (IgfsEx) g.fileSystem("igfs");
igfs.globalSampling(sampling);
fs = fileSystem();
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class HadoopTaskExecutionSelfTest method igfsConfiguration.
/**
* {@inheritDoc}
*/
@Override
public FileSystemConfiguration igfsConfiguration() throws Exception {
FileSystemConfiguration cfg = super.igfsConfiguration();
cfg.setFragmentizerEnabled(false);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class HadoopIgfs20FileSystemAbstractSelfTest method startNodes.
/**
* Starts the nodes for this test.
*
* @throws Exception If failed.
*/
private void startNodes() throws Exception {
if (mode != PRIMARY) {
// Start secondary IGFS.
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs_secondary");
igfsCfg.setIpcEndpointConfiguration(secondaryIpcEndpointConfiguration());
igfsCfg.setManagementPort(-1);
igfsCfg.setBlockSize(512 * 1024);
igfsCfg.setPrefetchBlocks(1);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setName("partitioned");
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setName("replicated");
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("grid_secondary");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
cfg.setLocalHost(U.getLocalHost().getHostAddress());
cfg.setCommunicationSpi(communicationSpi());
G.start(cfg);
}
startGrids(4);
awaitPartitionMapExchange();
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class HadoopIgfsDualAbstractSelfTest method startGridWithIgfs.
/**
* Start grid with IGFS.
*
* @param igniteInstanceName Ignite instance name.
* @param igfsName IGFS name
* @param mode IGFS mode.
* @param secondaryFs Secondary file system (optional).
* @param restCfg Rest configuration string (optional).
* @return Started grid instance.
* @throws Exception If failed.
*/
protected Ignite startGridWithIgfs(String igniteInstanceName, String igfsName, IgfsMode mode, @Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg) throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(igfsName);
igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
igfsCfg.setDefaultMode(mode);
igfsCfg.setIpcEndpointConfiguration(restCfg);
igfsCfg.setSecondaryFileSystem(secondaryFs);
igfsCfg.setPrefetchBlocks(PREFETCH_BLOCKS);
igfsCfg.setSequentialReadsBeforePrefetch(SEQ_READS_BEFORE_PREFETCH);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setName("dataCache");
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(2));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setName("metaCache");
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
return G.start(cfg);
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class HadoopSecondaryFileSystemConfigurationTest method fsConfiguration.
/**
* Gets IGFS configuration.
*
* @param igniteInstanceName Ignite instance name.
* @return IGFS configuration.
*/
protected FileSystemConfiguration fsConfiguration(String igniteInstanceName) throws IgniteCheckedException {
FileSystemConfiguration cfg = new FileSystemConfiguration();
cfg.setName("igfs");
cfg.setPrefetchBlocks(1);
cfg.setDefaultMode(mode);
if (mode != PRIMARY)
cfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(secondaryFsUriStr, secondaryConfFullPath));
cfg.setIpcEndpointConfiguration(primaryIpcEndpointConfiguration(igniteInstanceName));
cfg.setManagementPort(-1);
// Together with group blocks mapper will yield 64M per node groups.
cfg.setBlockSize(512 * 1024);
cfg.setDataCacheConfiguration(dataCacheConfiguration());
cfg.setMetaCacheConfiguration(metaCacheConfiguration());
return cfg;
}
Aggregations