Search in sources :

Example 51 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IgniteHadoopFileSystemAbstractSelfTest method startNodes.

/**
 * Starts the nodes for this test.
 *
 * @throws Exception If failed.
 */
protected void startNodes() throws Exception {
    if (mode != PRIMARY) {
        // Start secondary IGFS.
        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
        igfsCfg.setName("igfs_secondary");
        igfsCfg.setIpcEndpointConfiguration(SECONDARY_ENDPOINT_CFG);
        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.setLocalPort(47510);
        TcpDiscoveryVmIpFinder finder = new TcpDiscoveryVmIpFinder(true);
        discoSpi.setIpFinder(finder);
        cfg.setDiscoverySpi(discoSpi);
        cfg.setFileSystemConfiguration(igfsCfg);
        cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
        G.start(cfg);
    }
    for (int i = 1; i < GRID_COUNT; ++i) startGrid(i);
    startGrid(0);
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 52 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class HadoopAbstractMapReduceTest 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);
    HadoopConfiguration hadoopCfg = createHadoopConfiguration();
    if (hadoopCfg != null)
        cfg.setHadoopConfiguration(hadoopCfg);
    return G.start(cfg);
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) HadoopConfiguration(org.apache.ignite.configuration.HadoopConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 53 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IpcSharedMemoryNodeStartup method main.

/**
 * @param args Args.
 * @throws Exception If failed.
 */
public static void main(String[] args) throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
    endpointCfg.setType(IgfsIpcEndpointType.SHMEM);
    endpointCfg.setPort(10500);
    igfsCfg.setIpcEndpointConfiguration(endpointCfg);
    igfsCfg.setName("igfs");
    CacheConfiguration metaCacheCfg = new CacheConfiguration();
    metaCacheCfg.setName("partitioned");
    metaCacheCfg.setCacheMode(PARTITIONED);
    metaCacheCfg.setNearConfiguration(null);
    metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    metaCacheCfg.setEvictionPolicy(null);
    metaCacheCfg.setBackups(0);
    CacheConfiguration dataCacheCfg = new CacheConfiguration();
    dataCacheCfg.setName("partitioned");
    dataCacheCfg.setCacheMode(PARTITIONED);
    dataCacheCfg.setNearConfiguration(null);
    dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    dataCacheCfg.setEvictionPolicy(null);
    dataCacheCfg.setBackups(0);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
    try (Ignite ignored = G.start(cfg)) {
        X.println("Press any key to stop grid...");
        System.in.read();
    }
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) Ignite(org.apache.ignite.Ignite) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 54 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IgfsCacheSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(CACHE_NAME));
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs");
    igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
    igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
    cfg.setFileSystemConfiguration(igfsCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 55 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IgfsProcessorSelfTest 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.setMetaCacheConfiguration(cacheConfiguration("meta"));
    igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
    igfsCfg.setName("igfs");
    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)

Aggregations

FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)60 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)41 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)31 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)31 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)25 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)16 IgfsIpcEndpointConfiguration (org.apache.ignite.igfs.IgfsIpcEndpointConfiguration)12 HashMap (java.util.HashMap)6 Ignite (org.apache.ignite.Ignite)6 ArrayList (java.util.ArrayList)4 IgniteHadoopIgfsSecondaryFileSystem (org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem)4 IgfsMode (org.apache.ignite.igfs.IgfsMode)4 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)3 AffinityKeyMapper (org.apache.ignite.cache.affinity.AffinityKeyMapper)2 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)2 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)2 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