Search in sources :

Example 11 with FileSystemConfiguration

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

the class IgfsProcessorValidationSelfTest method testRemoteIfDefaultModeDiffers.

/**
     * @throws Exception If failed.
     */
public void testRemoteIfDefaultModeDiffers() throws Exception {
    IgniteConfiguration g2Cfg = getConfiguration("g2");
    FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
    FileSystemConfiguration g2IgfsCfg2 = new FileSystemConfiguration(g1IgfsCfg2);
    g1IgfsCfg1.setDefaultMode(DUAL_ASYNC);
    g1IgfsCfg2.setDefaultMode(DUAL_ASYNC);
    g2IgfsCfg1.setDefaultMode(DUAL_SYNC);
    g2IgfsCfg2.setDefaultMode(DUAL_SYNC);
    g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
    G.start(g1Cfg);
    checkGridStartFails(g2Cfg, "Default mode 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 12 with FileSystemConfiguration

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

the class IgfsProcessorValidationSelfTest method testPreConfiguredCache.

/**
     * @throws Exception If failed.
     */
public void testPreConfiguredCache() throws Exception {
    FileSystemConfiguration igfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
    igfsCfg1.setName("igfs");
    g1Cfg.setFileSystemConfiguration(igfsCfg1);
    CacheConfiguration ccfgData = dataCache(1024);
    ccfgData.setRebalanceTimeout(10001);
    CacheConfiguration ccfgMeta = metaCache();
    ccfgMeta.setRebalanceTimeout(10002);
    igfsCfg1.setDataCacheConfiguration(ccfgData);
    igfsCfg1.setMetaCacheConfiguration(ccfgMeta);
    IgniteEx g = (IgniteEx) G.start(g1Cfg);
    assertEquals(10001, g.cachex(g.igfsx("igfs").configuration().getDataCacheConfiguration().getName()).configuration().getRebalanceTimeout());
    assertEquals(10002, g.cachex(g.igfsx("igfs").configuration().getMetaCacheConfiguration().getName()).configuration().getRebalanceTimeout());
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 13 with FileSystemConfiguration

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

the class IgfsProcessorValidationSelfTest method testRemoteIfAffinityMapperGroupSizeDiffers.

/**
     * @throws Exception If failed.
     */
public void testRemoteIfAffinityMapperGroupSizeDiffers() throws Exception {
    IgniteConfiguration g2Cfg = getConfiguration("g2");
    G.start(g1Cfg);
    for (FileSystemConfiguration igfsCfg : g2Cfg.getFileSystemConfiguration()) igfsCfg.setDataCacheConfiguration(dataCache(1000));
    checkGridStartFails(g2Cfg, "Affinity mapper group 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 14 with FileSystemConfiguration

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

the class IgfsProcessorSelfTest method beforeTest.

/** {@inheritDoc} */
@Override
protected void beforeTest() throws Exception {
    IgniteEx grid = grid(0);
    igfs = grid.fileSystem(igfsName());
    FileSystemConfiguration[] cfgs = grid.configuration().getFileSystemConfiguration();
    assert cfgs.length == 1;
    metaCacheName = cfgs[0].getMetaCacheConfiguration().getName();
    metaCache = ((IgniteKernal) grid).internalCache(metaCacheName);
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 15 with FileSystemConfiguration

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

the class IgfsModesSelfTest method startUpSecondary.

/**
     * Startup secondary file system.
     *
     * @throws Exception If failed.
     */
private void startUpSecondary() throws Exception {
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs-secondary");
    igfsCfg.setBlockSize(512 * 1024);
    igfsCfg.setDefaultMode(PRIMARY);
    IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
    endpointCfg.setType(IgfsIpcEndpointType.TCP);
    endpointCfg.setPort(11500);
    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
    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.setCacheMode(REPLICATED);
    metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName("igfs-grid-secondary");
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setLocalHost("127.0.0.1");
    cfg.setConnectorConfiguration(null);
    igfsSecondary = (IgfsImpl) G.start(cfg).fileSystem("igfs-secondary");
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) 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