Search in sources :

Example 16 with FileSystemConfiguration

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

the class IgfsSecondaryFileSystemInjectionSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName(IGFS_NAME);
    igfsCfg.setDefaultMode(IgfsMode.DUAL_SYNC);
    igfsCfg.setSecondaryFileSystem(secondary);
    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
    dataCacheCfg.setCacheMode(PARTITIONED);
    dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
    CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
    metaCacheCfg.setCacheMode(REPLICATED);
    metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    cfg.setFileSystemConfiguration(igfsCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 17 with FileSystemConfiguration

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

the class IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest method igfsConfiguration.

/**
     * Creates test-purposed IgfsConfiguration.
     *
     * @param endPntType End point type.
     * @param endPntPort End point port.
     * @param endPntHost End point host.
     * @param dataCacheName Data cache name.
     * @param metaCacheName Meta cache name.
     * @return test-purposed IgfsConfiguration.
     * @throws IgniteCheckedException If failed.
     */
protected FileSystemConfiguration igfsConfiguration(@Nullable IgfsIpcEndpointType endPntType, @Nullable Integer endPntPort, @Nullable String endPntHost, String dataCacheName, String metaCacheName) throws IgniteCheckedException {
    IgfsIpcEndpointConfiguration endPntCfg = null;
    if (endPntType != null) {
        endPntCfg = new IgfsIpcEndpointConfiguration();
        endPntCfg.setType(endPntType);
        if (endPntPort != null)
            endPntCfg.setPort(endPntPort);
        if (endPntHost != null)
            endPntCfg.setHost(endPntHost);
    }
    FileSystemConfiguration igfsConfiguration = new FileSystemConfiguration();
    igfsConfiguration.setName("igfs" + UUID.randomUUID());
    igfsConfiguration.setManagementPort(mgmtPort.getAndIncrement());
    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
    dataCacheCfg.setCacheMode(CacheMode.PARTITIONED);
    dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
    dataCacheCfg.setBackups(0);
    dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
    CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
    metaCacheCfg.setCacheMode(CacheMode.REPLICATED);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    igfsConfiguration.setMetaCacheConfiguration(metaCacheCfg);
    igfsConfiguration.setDataCacheConfiguration(dataCacheCfg);
    if (endPntCfg != null)
        igfsConfiguration.setIpcEndpointConfiguration(endPntCfg);
    return igfsConfiguration;
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 18 with FileSystemConfiguration

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

the class IgfsProcessorValidationSelfTest method testLocalIfAffinityMapperIsWrongClass.

/**
     * @throws Exception If failed.
     */
public void testLocalIfAffinityMapperIsWrongClass() throws Exception {
    for (FileSystemConfiguration igfsCfg : g1Cfg.getFileSystemConfiguration()) {
        igfsCfg.setDataCacheConfiguration(dataCache(1024));
        igfsCfg.setMetaCacheConfiguration(metaCache());
        igfsCfg.getMetaCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
        igfsCfg.getDataCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
    }
    checkGridStartFails(g1Cfg, "Invalid IGFS data cache configuration (key affinity mapper class should be", true);
}
Also used : GridCacheDefaultAffinityKeyMapper(org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 19 with FileSystemConfiguration

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

the class IgfsProcessorValidationSelfTest method testRemoteIfDataBlockSizeDiffers.

/**
     * @throws Exception If failed.
     */
public void testRemoteIfDataBlockSizeDiffers() throws Exception {
    IgniteConfiguration g2Cfg = getConfiguration("g2");
    FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
    g2IgfsCfg1.setBlockSize(g2IgfsCfg1.getBlockSize() + 100);
    g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g1IgfsCfg2);
    G.start(g1Cfg);
    checkGridStartFails(g2Cfg, "Data block size should be the same on all nodes in grid for IGFS", false);
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 20 with FileSystemConfiguration

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

the class IgniteHadoopFileSystemClientBasedAbstractSelfTest method igfsConfiguration.

/** {@inheritDoc} */
@Override
protected FileSystemConfiguration igfsConfiguration(String gridName) throws IgniteCheckedException {
    FileSystemConfiguration cfg = super.igfsConfiguration(gridName);
    cfg.setIpcEndpointEnabled(false);
    return cfg;
}
Also used : FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

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