Search in sources :

Example 21 with FileSystemConfiguration

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 22 with FileSystemConfiguration

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;
}
Also used : CachingHadoopFileSystemFactory(org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory) IgniteHadoopIgfsSecondaryFileSystem(org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 23 with FileSystemConfiguration

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 24 with FileSystemConfiguration

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 25 with FileSystemConfiguration

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;
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)59 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)40 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)31 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)30 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)24 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)16 IgfsIpcEndpointConfiguration (org.apache.ignite.igfs.IgfsIpcEndpointConfiguration)12 Ignite (org.apache.ignite.Ignite)6 HashMap (java.util.HashMap)5 IgniteHadoopIgfsSecondaryFileSystem (org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem)4 IgfsMode (org.apache.ignite.igfs.IgfsMode)4 ArrayList (java.util.ArrayList)3 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)3 IgniteEx (org.apache.ignite.internal.IgniteEx)2 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)2 IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteFileSystem (org.apache.ignite.IgniteFileSystem)1